Examples

ARTIFACTORY: How should I switch to use the Amazon S3 Official SDK?

AuthorFullName__c
Noa Shechter
articleNumber
000005831
ft:sourceType
Salesforce
FirstPublishedDate
2023-07-24T13:14:57Z
lastModifiedDate
2023-07-24
VersionNumber
7
Migrated Configuration #1 - simple "s3"
<config version="2">
    <chain template="s3-storage-v3"/>
    <provider id="s3-storage-v3" type="s3-storage-v3">
       <endpoint>http://s3.amazonaws.com</endpoint>
       <identity>[ENTER IDENTITY HERE]</identity>
       <credential>[ENTER CREDENTIALS HERE]</credential>
       <path>[ENTER PATH HERE]</path>
       <bucketName>[ENTER BUCKET NAME HERE]</bucketName>
    </provider>
</config>
Old Configuration #2 - "s3" with properties
<config version="v1">
    <chain>
        <provider id="cache-fs" type="cache-fs">
            <provider id="eventual" type="eventual">
                <provider id="retry" type="retry">
                    <provider id="s3" type="s3"/>
                </provider>
            </provider>
        </provider>
    </chain>

    <provider id="cache-fs" type="cache-fs">
        <maxCacheSize>100000000000</maxCacheSize>
    </provider>

    <provider id="eventual" type="eventual">
        <numberOfThreads>10</numberOfThreads>  
        <timeout>180000</timeout>
        <dispatcherInterval>5000</dispatcherInterval>
    </provider>

    <provider id="retry" type="retry">
        <maxTrys>10</maxTrys>
        <interval>1000</interval>
    </provider>

    <provider id="s3" type="s3">
       <endpoint>http://s3.amazonaws.com</endpoint>
       <refreshCredentials>true</refreshCredentials>
       <roleName>[ENTER IAM Role NAME HERE]</roleName>
       <path>[ENTER PATH HERE]</path>
       <bucketName>[ENTER BUCKET NAME HERE]</bucketName>
       <property name="s3service.server-side-encryption" value="AES256"></property>
       <property name="s3service.disable-dns-buckets" value="true"></property>                              
       <property name="httpclient.max-connections"  value="200"></property>
    </provider>

</config>

Migrated Configuration #2 - "s3" with properties
<config version="v1">
    <chain>
        <provider id="cache-fs" type="cache-fs">
            <provider id="eventual" type="eventual">
                <provider id="retry" type="retry">
                    <provider id="s3-storage-v3" type="s3-storage-v3"/>
                </provider>
            </provider>
        </provider>
    </chain>

    <provider id="cache-fs" type="cache-fs">
        <maxCacheSize>100000000000</maxCacheSize>
    </provider>

    <provider id="eventual" type="eventual">
        <numberOfThreads>10</numberOfThreads>  
        <timeout>180000</timeout>
        <dispatcherInterval>5000</dispatcherInterval>
    </provider>

    <provider id="retry" type="retry">
        <maxTrys>10</maxTrys>
        <interval>1000</interval>
    </provider>

    <provider id="s3-storage-v3" type="s3-storage-v3">
       <endpoint>http://s3.amazonaws.com</endpoint>
       <useInstanceCredentials>true</useInstanceCredentials>
       <path>[ENTER PATH HERE]</path>
       <bucketName>[ENTER BUCKET NAME HERE]</bucketName>
       <server-side-encryption-aws-kms>true</server-side-encryption-aws-kms>            
       <enablePathStyleAccess>true</enablePathStyleAccess>                              
       <maxConnections>200</maxConnections>
    </provider>

</config>

Old Configuration #3 - "cluster-s3"
<config version="2">
    <chain>
        <provider id="cache-fs-eventual-s3" type="cache-fs">
            <provider id="sharding-cluster-eventual-s3" type="sharding-cluster">
                <sub-provider id="eventual-cluster-s3" type="eventual-cluster">
                    <provider id="retry-s3" type="retry">
                        <provider id="s3" type="s3"/>
                    </provider>
                </sub-provider>
                <dynamic-provider id="remote-s3" type="remote"/>
            </provider>
        </provider>
    </chain> 

    <provider id="cache-fs-eventual-s3" type="cache-fs">
        <maxCacheSize>100000000000</maxCacheSize>
    </provider>
  
    <provider id="sharding-cluster-eventual-s3" type="sharding-cluster">
        <redundancy>3</redundancy>
        <lenientLimit>2</lenientLimit>
        <property name="zones" value="local,remote"/>
    </provider>
 
    <provider id="eventual-cluster-s3" type="eventual-cluster">
        <maxWorkers>10</maxWorkers>
        <dispatcherInterval>1000</dispatcherInterval>
        <checkPeriod>15000</checkPeriod>
        <addStalePeriod>300000</addStalePeriod>
        <zone>local</zone>
    </provider>

    <provider id="remote-s3" type="remote">
        <checkPeriod>15000</checkPeriod>
        <connectionTimeout>5000</connectionTimeout>
        <socketTimeout>15000</socketTimeout>
        <maxConnections>200</maxConnections>
        <connectionRetry>2</connectionRetry>
       <zone>remote</zone>
    </provider>

    <provider id="s3" type="s3">
       <endpoint>http://s3.amazonaws.com</endpoint>
       <identity>[ENTER IDENTITY HERE]</identity>
       <credential>[ENTER CREDENTIALS HERE]</credential>
       <path>[ENTER PATH HERE]</path>
       <bucketName>[ENTER BUCKET NAME HERE]</bucketName>
    </provider>

</config>

Migrated Configuration #3 - "cluster-s3"
<config version="2">
    <chain>
        <provider id="cache-fs-eventual-s3" type="cache-fs">
            <provider id="sharding-cluster-eventual-s3" type="sharding-cluster">
                <sub-provider id="eventual-cluster-s3" type="eventual-cluster">
                    <provider id="retry-s3" type="retry">
                        <provider id="s3-storage-v3" type="s3-storage-v3"/>
                    </provider>
                </sub-provider>
                <dynamic-provider id="remote-s3" type="remote"/>
            </provider>
        </provider>
    </chain> 

    <provider id="cache-fs-eventual-s3" type="cache-fs">
        <maxCacheSize>100000000000</maxCacheSize>
    </provider>
  
    <provider id="sharding-cluster-eventual-s3" type="sharding-cluster">
        <redundancy>3</redundancy>
        <lenientLimit>2</lenientLimit>
        <property name="zones" value="local,remote"/>
    </provider>
 
    <provider id="eventual-cluster-s3" type="eventual-cluster">
        <maxWorkers>10</maxWorkers>
        <dispatcherInterval>1000</dispatcherInterval>
        <checkPeriod>15000</checkPeriod>
        <addStalePeriod>300000</addStalePeriod>
        <zone>local</zone>
    </provider>

    <provider id="remote-s3" type="remote">
        <checkPeriod>15000</checkPeriod>
        <connectionTimeout>5000</connectionTimeout>
        <socketTimeout>15000</socketTimeout>
        <maxConnections>200</maxConnections>
        <connectionRetry>2</connectionRetry>
       <zone>remote</zone>
    </provider>

    <provider id="s3-storage-v3" type="s3-storage-v3">
       <endpoint>http://s3.amazonaws.com</endpoint>
       <identity>[ENTER IDENTITY HERE]</identity>
       <credential>[ENTER CREDENTIALS HERE]</credential>
       <path>[ENTER PATH HERE]</path>
       <bucketName>[ENTER BUCKET NAME HERE]</bucketName>
    </provider>

</config>