Tagging S3 objects: configuring the components - 7.2

Amazon S3

Version
7.2
Language
English (United States)
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Amazon services (Integration) > Amazon S3 components
Data Quality and Preparation > Third-party systems > Amazon services (Integration) > Amazon S3 components
Design and Development > Third-party systems > Amazon services (Integration) > Amazon S3 components

Procedure

  1. Double-click tS3Connection to open its Basic settings view.
    1. In the Access Key and Secret Key fields, enter the authentication credentials.
    2. Set the Region option.
  2. Double-click tS3List to open its Basic settings view.
    1. Select the Use existing connection check box to reuse the connection.
    2. In the Bucket name field, enter the bucket name.
    3. In the Key prefix field, enter the prefix of the files to add the tag to ("file" in this example).
  3. Double-click tJavaFlex to open its Basic settings view.
    1. Copy-paste the following code into the Start code field.
      com.amazonaws.services.s3.AmazonS3Client s3Client = (com.amazonaws.services.s3.AmazonS3Client) globalMap
          .get("conn_tS3Connection_1");
      List<Tag> myTags = new ArrayList<Tag>();
    2. Copy-paste the following code into the Main code field.
      myTags.add(new Tag("Tag1", "Tag1 value"));
      s3Client.setObjectTagging(new SetObjectTaggingRequest("compdoc-bucket",((String)globalMap.get("tS3List_1_CURRENT_KEY")), new ObjectTagging(myTags)));
    3. In the Advanced settings view, copy-paste the following into the Import field.
      import com.amazonaws.AmazonServiceException;
      import com.amazonaws.SdkClientException;
      import com.amazonaws.auth.profile.ProfileCredentialsProvider;
      import com.amazonaws.regions.Regions;
      import com.amazonaws.services.s3.AmazonS3;
      import com.amazonaws.services.s3.AmazonS3ClientBuilder;
      import com.amazonaws.services.s3.model.*;
                                 
      import java.io.File;
      import java.util.ArrayList;
      import java.util.List;
    Note: For information about the code blocks in this step, see Managing Tags Using the AWS SDK for Java.
  4. Double-click tS3Close and make sure tS3Connection_1 appears in the Component List drop-down list.