Greengrass V2 Custom Component having S3client | Java


we have requirement to download/upload files in S3 using GreengrassV2 Custom component. Can anyone help how we can get the S3client Object with provided credential. We have created thing with role-alias which has S3 Get/Put access. As GreengrassV2 thing has already access policy, How can we create S3 Object? How the credential exchange in custom-component in java.

asked 2 years ago528 views
1 Answer

Hi there! So one thing you will need to do is deploy the Token exchange service component. The token exchange service component (aws.greengrass.TokenExchangeService) provides AWS credentials that you can use to interact with AWS services in your custom components.

With that being said, I would also considering using the Greengrass Stream Manager component? It contains an S3 destination option and handles all that data transfer logic for you. Has a bunch of features, but you simply just add the file to the S3 stream and StreamManager will upload the object to S3 for you.

Greengrass StreamManager Component

Sample Code in Java to export objects to S3 using Stream Manager

Hope this helps!

profile pictureAWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions