Tagging S3 objects: configuring the components
-
Double-click tS3Connection to open its Basic settings view.
-
In the Access
Key and Secret Key fields, enter the authentication
credentials. - Set the Region option.
-
In the Access
-
Double-click tS3List to open its Basic settings view.
-
Select the Use existing
connection check box to reuse the connection. -
In the Bucket
name field, enter the bucket name. -
In the Key
prefix field, enter the prefix of the files to add the
tag to ("file" in this
example).
-
Select the Use existing
-
Double-click tJavaFlex to open its Basic settings view.
-
Copy-paste the following code into the Start
code field.123com.amazonaws.services.s3.AmazonS3Client s3Client = (com.amazonaws.services.s3.AmazonS3Client) globalMap.get("conn_tS3Connection_1");List<Tag> myTags = new ArrayList<Tag>(); -
Copy-paste the following code into the Main
code field.12myTags.add(new Tag("Tag1", "Tag1 value"));s3Client.setObjectTagging(new SetObjectTaggingRequest("compdoc-bucket",((String)globalMap.get("tS3List_1_CURRENT_KEY")), new ObjectTagging(myTags))); -
In the Advanced settings view,
copy-paste the following into the Import
field.1234567891011import 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. -
Copy-paste the following code into the Start
- Double-click tS3Close and make sure tS3Connection_1 appears in the Component List drop-down list.
Parent topic: Tagging S3 objects
Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Login
0 Comments