Amazon Web Service Simple Storage Service
A new business process service that allows you to integrate with the Amazon Web Service Simple Storage Service (AWS S3) is introduced.
AWS S3 is an easy to use object storage, with a simple web service interface to store and retrieve any amount of data from anywhere on the web. With this, you pay only for the storage you actually use. There is no minimum fee and no setup cost.
- Secure, durable, highly-scalable cloud based storage solution
- Large amounts of data storage and retrieval
- Event notification in case of upload or download
- Interactive web-based UI console
After integrating AWS S3 with Sterling B2B Integrator, it creates a seamless connectivity to the cloud storage environment hosted by Amazon. This is a scalable, reliable, and portable storage solution. You can easily perform operations such as get, put, delete files and many more.
- create a directory on AWS S3
- delete a file or a directory on AWS S3
- retrieve a specific file (using specific filename) from AWS S3
- put a specific file from mailbox or file system to AWS S3
- retrieve or put files based on wildcard
- obscure access key and secret key
- list the files
- retrieve the list of files
- connect to a specific AWS S3 endpoint
- From v6.0.2 or later, the AWS S3 client service supports multipart object upload and download to AWS S3 from Sterling B2B Integrator.
- From v6.0.1 onward, proxy support for AWS S3 is introduced. For more information, see Proxy support for AWS S3.
Installing AWS SDK for Java
- Download AWS SDK for Java from this location - https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip.
- Go to aws-java-sdk[version]/lib and copy aws-java-sdk-[version].jar file to the server where Sterling B2B Integrator is installed.
- Go to aws-java-sdk[version]/third-party/lib and copy these jar files to the
server where Sterling B2B Integrator is
installed.
httpclient-[version].jar httpcore-[version].jar jackson-annotations-[version].jar jackson-core-[version].jar jackson-databind-[version].jar joda-time-[version].jar netty-*.jar
- Install the above jar files using
install3rdParty.sh
.- Stop Sterling B2B Integrator.
- Go to
./install/bin
and runinstall3rdParty.sh
../install3rdParty.sh awssdk [aws version] -j <path>/[jar name].jar
For example:
./install3rdParty.sh awssdk 1.11.401 -j <path>/aws-java-sdk-1.11.401.jar
./install3rdParty.sh awssdk 1.11.401 -j <path>/httpclient-4.5.2.jar
- Edit
install/properties/dynamicclasspath.cfg.in
and move these entries to top of the file.VENDOR_JAR=&INSTALL_DIR;/jar/awssdk/1.11.401/aws-java-sdk-1.11.401.jar
VENDOR_JAR=&INSTALL_DIR;/jar/awssdk/1.11.401/httpclient-4.5.2.jar
- Restart Sterling B2B Integrator.
Making AWS keys as optional for AWS S3
- Add Access Keys and Secret Keys as part of environment variables
- Add Access Keys and Secret Keys as part of credentials file
- Allow EC2 instance to access S3 bucket using IAM roles
- Credentials in business process
- Credentials in S3 Adapter
- Environment variables
- Instance default credential profiles file
- EC2 instance profile credentials
For more information on AWS Identity and Access Management (IAM) service, see Security best practices in IAM.
AWS S3 Client Service - Create Directory Operation
Description |
This service is used to create a directory inside a given AWS S3 bucket. |
Business usage |
This service is used to create a specific directory on a given bucket dynamically using Sterling B2B Integrator and then you can use put/ get services to put/get files into that directory. |
Parameters description |
|
Implementing the AWS S3 Client - Create Directory Service
<process name="AWSS3ClientCreate">
<sequence>
<operation name="Extract File">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>mkdir</assign>
<assign to="awss3.foldername">dummyfoldername</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 - Delete File Operation
Description |
This service is used to delete a specific file inside a specific folder from a given AWS S3 bucket. |
Business usage |
This service is used to delete any unwanted file from a specific directory on a given bucket dynamically using Sterling B2B Integrator. |
Parameters description |
|
Implementing the AWS S3 Client - Delete File Service
<process name="AWSS3ClientDeleteFile">
<sequence>
<operation name="Extract File">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>delete</assign>
<assign to="awss3.foldername">dummyfoldername</assign>
<assign to="awss3.filename">dummyfilename</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>
To delete a file present in a specific directory, make sure to mention the awss3
foldername parameter with correct value. To delete a file under the bucket, mention the
awss3
foldername parameter as /.
AWS S3 Client Service - Delete Directory Operation
Description |
This service is used to delete a directory inside a given AWS S3 bucket. |
Business usage |
This service is used to delete a specific directory on a given bucket dynamically using Sterling B2B Integrator. |
Parameters description |
|
Implementing the AWS S3 Client - Delete Directory Service
<process name="AWSS3ClientDeleteFolder">
<sequence>
<operation name="Extract File">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>delete</assign>
<assign to="awss3.foldername">dummyfoldername</assign>
<assign to="awss3.bucketname">dummybucketname</assign>
<assign to="awss3.accesskey">dummysccesskey</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 - Get A File Operation
Description |
This service is used to retrieve a specific file from a given AWS S3 bucket. |
Business usage |
This service is used to retrieve a specific file from a given bucket dynamically using Sterling B2B Integrator. |
Parameters description |
|
Properties | The following properties are included in the awss3.properties
file:
|
Implementing the AWS S3 Client - Get A File Service
<process name="AWSS3ClientGet">
<sequence>
<operation name="Extract File">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>get</assign>
<assign to="awss3.bucketname">dummybucketname</assign>
<assign to="awss3.filename">dummyfilename</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="useOrigFileName">true</assign>
<assign to='.' from='PrimaryDocument' />
</output>
<input message="xin">
<assign to="." from="*"/>
</input>
</operation>
</sequence>
</process>
AWS S3 Client Service - Put a File from Mailbox to AWS S3
Description |
This service is used to retrieve message from mailbox and put it on AWS S3 to a given AWS S3 bucket. |
Business usage |
This service is used to retrieve a message from mailbox and send it to AWS S3 on a given bucket dynamically using Sterling B2B Integrator. You can then process this file using other AWS capabilities. |
Parameters description |
|
Implementing the AWS S3 Client Put Service (Put a File from Mailbox to AWS S3)
<process name="AWSS3ClientPUTFromMBXtoAWSS3">
<sequence>
<operation name="Extract File">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>put</assign>
<assign to='mbx.messageid'>dummymessageid</assign>
<assign to="awss3.bucketname">dummybucketname</assign>
<assign to="awss3.filename">dummyfilename</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 - Put a File from File System to AWS S3
Description |
This service is used to retrieve the file from file system and put it on AWS S3 to a given AWS S3 bucket. |
Business usage |
This service is used to retrieve a file from file system and send it to AWS S3 on a given bucket dynamically using Sterling B2B Integrator. You can then process this file using other AWS capabilities. |
Parameters description |
|
Implementing the AWS S3 Client Put Service (Put a File from File System to AWS S3)
<process name="AWSS3ClientPut">
<sequence>
<operation name="Extract File">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>put</assign>
<assign to='source.path'>dummysourcepath</assign>
<assign to="awss3.bucketname">dummybucketname</assign>
<assign to="awss3.filename">dummyfilename</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>
<assign to="awss3.filename">
.<assign to="awss3.filename">TestFolder/testfile.txt</assign>
AWS S3 Client Service - Put a Folder from File System to AWS S3
Description |
This service is used to retrieve a folder from file system and put all the contents of directory on AWS S3 to a given AWS S3 bucket. |
Business usage |
This service is used to retrieve a folder from file system and send it to AWS S3 on a given bucket dynamically using Sterling B2B Integrator. You can then process this file using other AWS capabilities. |
Parameters description |
|
Implementing the AWS S3 Client Put Service (Put a Folder from File System to AWS S3)
<process name="AWSS3ClientPutDirectory">
<sequence>
<operation name=" Upload directory">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>put</assign>
<assign to='source.path'>dummysourcepath</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>
<assign
to="awss3.foldername">dummyfoldername</assign>
.If you do not mention the folder name, all the files present in directory in the local file system are copied directly to the bucket in AWS S3.
AWS S3 Client Service - Get a Folder from AWS S3 to File System
Description |
This service is used to retrieve folder from AWS S3 and put it on the file system. |
Business usage |
This service is used to retrieve a folder from AWS S3 and send it to the file system dynamically using Sterling B2B Integrator. You can then process this file using other AWS capabilities. |
Parameters description |
|
Implementing the AWS S3 Client Get Service (Get a Folder from AWS S3 to File System)
<process name="AWSS3ClientGetDirectory">
<sequence>
<operation name="Extract directory">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>get</assign>
<assign to="awss3.foldername">dummyfoldername</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 - Get a List of files from AWS S3 to File System
Description |
This service is used to retrieve list of files from AWS S3 and put it on file system. |
Business usage |
This service is used to retrieve a list of files from AWS S3 and send it to file system dynamically using Sterling B2B Integrator. You can then process this file using other AWS capabilities. |
Parameters description |
|
Implementing the AWS S3 Client Get Service (Get a List of Files from AWS S3 to File System)
<process name="AWSS3ClientGetFileList">
<sequence>
<operation name="Extract File List">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>get</assign>
<assign to="awss3.fileList">dummyfilename1,dummyfilename2,dummyfilename3</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 - Put a List of files from File System to AWS S3
Description |
This service is used to put list of files from the file system on AWS S3. |
Business usage |
This service is used to retrieve a list of files from AWS S3 and send it to file system dynamically using Sterling B2B Integrator. You can then process this file using other AWS capabilities. |
Parameters description |
|
Implementing the AWS S3 Client Put Service (Put a List of Files from File System to AWS S3)
<process name="AWSS3ClientPutFileList">
<sequence>
<operation name="Extract File List">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>put</assign>
<assign to='source.path'>dummysourcepath</assign>
<assign to="awss3.fileList">dummyfilename1,dummyfilename2,dummyfilename3</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>
<assign to="awss3.foldername">dummyfoldername</assign>
.AWS S3 Client Service - Get files based on pattern from AWS S3 to file system
Description |
This service is used to get files based on pattern from AWS S3 to file system. |
Business usage |
This service is used to get files based on pattern from AWS S3 to file system dynamically using Sterling B2B Integrator. |
Parameters description |
|
Implementing the AWS S3 Client Get Service (Get Files based on pattern from AWS S3 to file system)
<process name="AWSS3ClientGetFilePatternList">
<sequence>
<operation name=" Extract File Pattern List">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>get</assign>
<assign to="awss3. filepattern">dummyfilepattern</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 prefixes (similar to folders) are included when matching the awss3.filepattern.
- The awss3.filepattern must contain a valid regular expression supported by Java 8.
- Example values of awss3.filepattern:
Assignment Result <assign to="awss3.filepattern">.*\/*test.*[.]txt$</assign>
All test*.txt objects <assign to="awss3.filepattern">test/support/activemq_.+</assign>
All objects with prefixes test/support and starting with active_mq_ <assign to="awss3.filepattern">test/support/.+</assign>
All objects with prefixes test/support <assign to="s3.prefix">test/support</assign>
<assign to="awss3.filepattern">.+</assign>This operation will list the specified prefix and apply the pattern match.
AWS S3 Client Service - Put files based on pattern from File System to AWS S3
Description |
This service is used to put files based on pattern from file system on AWS S3. |
Business usage |
This service is used to put files based on pattern from file system on file AWS S3 dynamically using Sterling B2B Integrator. |
Parameters description |
|
Implementing the AWS S3 Client Put Service (Put files based on pattern from File System to AWS S3 )
<process name="AWSS3ClientPutFilePatternList">
<sequence>
<operation name=" Extract File Pattern List">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>put</assign>
<assign to='source.path'>dummysourcepath</assign>
<assign to="source.filepattern">dummyfilepattern</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>
<assign to="awss3.foldername">dummyfoldername</assign>
.AWS S3 Client Service - List files on AWS S3
Description |
This service is used to list files on AWS S3. |
Business usage |
This service is used to list files on AWS S3 dynamically using Sterling B2B Integrator. |
Parameters description |
|
Implementing the AWS S3 Client List Service (List Files on AWS S3)
<process name="AWSS3ClientList">
<sequence>
<operation name="List File">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>list</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 - Obscuring Keys for AWS S3
Description |
This service works with obscured access key and secret key on all AWS S3 operations. |
Business usage |
This service works with obscured access key and secret key on all AWS S3 operations dynamically using Sterling B2B Integrator. |
Parameters description |
|
Implementing the AWS S3 Client Service with Obscuring keys (Obscuring Files on AWS S3)
To obscure key, run the below script and use the output in the BP. Go to
./install/bin
and run
obscure_passphrase.sh
/obscure_passphrase.sh
accesskey/secretkey
.
<process name="AWSS3ClientGetWithObscuredKey ">
<sequence>
<operation name=" Extract File with obscured keys ">
<participant name='AWSS3Client'/>
<output message='xout'>
<assign to='action'>get</assign>
<assign to="awss3.bucketname">dummybucketname</assign>
<assign to="awss3.filename">testplain.txt</assign>
<assign to="awss3.obscuredaccesskey ">dummyobscuredaccesskey</assign>
<assign to="awss3.obscuredsecretkey ">dummyobscuredsecretkey</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>
Dell Elastic Cloud Storage (ECS) support
Dell ECS supports a subset of the Amazon S3 API.
You can import the certificates related to Dell ECS to the CA certificate store. To connect to Dell ECS Storage, you must configure these certificates as part of the AWSS3ClientForB2Bi Adapter. Additionally, you can add the appropriate Endpoint URL and Port for the connection.
Region
. So, you must set the region as Standard while
configuring the AWSS3ClientForB2Bi Adapter or the AWSS3 Business Processes for Dell ECS
Storage.-
You can specify the file storage location for S3 Get Service as Document Store and Filesystem in the adapter or Business Process. By default, files are stored in Document Store or Filesystem. If the files need to be stored only in Document Store, you can select Document Store option in the AWSS3ClientForB2Bi Adapter or add an entry in the Business Process as below.
<assign to="s3.fileStorage">DOCUMENT_STORE</assign>
- You can upload the files to S3 bucket with Public Read access by specifying
awss3.publicaccess
in AWS Put BPs such asPut file
,Put directory
,Put File list
,Put File Pattern list
, andPut from Mailbox
. The valid values forawss3.publicaccess
are true and false. - While uploading the files to AWS S3 server with Public Read access, make sure that the AWS
account also has Public_access permission granted, for the
PUT
file operation to be successful. If the AWS account does not have this (public_read access) permission and you try to PUT a file with parameter, the system displays an error message. - The Primary Document or document info link for the get file is available for files lesser than 2MB and unavailable for files greater than 2MB.
IBM Cloud Object Storage support
IBM Cloud Object Storage supports a subset of the S3 API for easy migration of applications to IBM Cloud.
You can add the bucket and its appropriate Endpoint URL for connection along with the Access Key and Secret key. Region is optional if the IBM Cloud Object Storage Endpoint URL has the region in it. All the S3 operations are supported when you connect to IBM Cloud Object Storage. For more information, see IBM Cloud Object Storage S3 API.