Skip to main content Skip to complementary content

Tagging S3 objects: configuring the 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;
    Information noteNote: 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.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!