Bucket policy

Bucket policy is an access policy option available to grant permission to AWS S3 resources.

You can perform the following operations through a workflow BP definition:
  • Get Bucket Policy
  • Set Bucket Policy
  • Delete Bucket Policy

AWS S3 Client Service - Get Bucket Policy

Description

This service is used to retrieve a bucket policy for a given AWS S3 bucket. The json content of the bucket policy is stored as the primary document.

Business usage

This service is used to retrieve bucket policy for a given bucket dynamically using Sterling B2B Integrator.

Parameters description


action -           getbucketpolicy
awss3.bucketname – Name of the AWS S3 bucket
awss3.accesskey –  Access key of the IAM user
awss3.secretkey –  Secret key of the IAM user
awss3.region    –  Region of S3 bucket. This is optional.
awss3.endpoint  –  Endpoint for S3. This is optional.

Implementing the AWS S3 Client - Get Bucket Policy Service

To implement the AWS S3 Client - Get Bucket Policy Service, replace the dummy values with the actual values in the following BP:

<process name="AWSS3ClientGet">
  <sequence>
        <operation name="Extract File">
          <participant name='AWSS3Client'/>
          <output message='xout'>
            <assign to='action'>getbucketpolicy</assign>
            <assign to="awss3.bucketname">dummybucketname</assign>
                <assign to="awss3.accesskey">dummyaccesskey</assign>
                <assign to="awss3.secretkey">dummysecretkey</assign>
                <assign to="awss3.endpoint">dummyendpoint</assign>
                <assign to="awss3.region">dummyregion</assign>
            <assign to='.' from='PrimaryDocument' />
          </output>
         <input message="xin">
           <assign to="." from="*"/>
         </input>
        </operation>
  </sequence>
</process>

AWS S3 Client Service - Set Bucket Policy

Description

This service is used to set a bucket policy for a given AWS S3 bucket. The json content of the bucket policy is added as part of the BP definition.

Business usage

This service is used to set bucket policy for a given bucket dynamically using Sterling B2B Integrator.

Parameters description


action -           setbucketpolicy
awss3.bucketname – Name of the AWS S3 bucket
awss3.accesskey –  Access key of the IAM user
awss3.secretkey –  Secret key of the IAM user
awss3.region –     Region of S3 bucket. This is optional.
awss3.endpoint –   Endpoint for S3. This is optional.
s3.bucketpolicy –  json content of bucket policy

Implementing the AWS S3 Client - Set Bucket Policy Service

To implement the AWS S3 Client - Set Bucket Policy Service, replace the dummy values with the actual values in the following BP:
<process name="AWSS3ClientGet">
  <sequence>
        <operation name="Extract File">
          <participant name='AWSS3Client'/>
          <output message='xout'>
            <assign to='action'>setbucketpolicy</assign>
            <assign to="awss3.bucketname">dummybucketname</assign>
                <assign to="awss3.accesskey">dummyaccesskey</assign>
                <assign to="awss3.secretkey">dummysecretkey</assign>
                <assign to="awss3.endpoint">dummyendpoint</assign>
                <assign to="awss3.region">dummyregion</assign>
                <assign to="s3.bucketpolicy">dummybucketpolicy</assign>
            <assign to='.' from='PrimaryDocument' />
          </output>
         <input message="xin">
           <assign to="." from="*"/>
         </input>
        </operation>
  </sequence>
</process>

AWS S3 Client Service - Delete Bucket Policy

Description

This service is used to delete a bucket policy for a given AWS S3 bucket.

Business usage

This service is used to delete bucket policy for a given bucket dynamically using Sterling B2B Integrator.

Parameters description


action -           deletebucketpolicy
awss3.bucketname – Name of the AWS S3 bucket
awss3.accesskey –  Access key of the IAM user
awss3.secretkey –  Secret key of the IAM user
awss3.region –     Region of S3 bucket. This is optional.
awss3.endpoint –   Endpoint for S3. This is optional.

Implementing the AWS S3 Client - Delete Bucket Policy Service

To implement the AWS S3 Client - Delete Bucket Policy Service, replace the dummy values with the actual values in the following BP:

<process name="AWSS3ClientGet">
  <sequence>
        <operation name="Extract File">
          <participant name='AWSS3Client'/>
          <output message='xout'>
            <assign to='action'>deletebucketpolicy</assign>
            <assign to="awss3.bucketname">dummybucketname</assign>
                <assign to="awss3.accesskey">dummyaccesskey</assign>
                <assign to="awss3.secretkey">dummysecretkey</assign>
                <assign to="awss3.endpoint">dummyendpoint</assign>
                <assign to="awss3.region">dummyregion</assign>
            <assign to='.' from='PrimaryDocument' />
          </output>
         <input message="xin">
           <assign to="." from="*"/>
         </input>
        </operation>
  </sequence>
</process>