How do I create a Greengrass v2 deployment from on a config file using the Java SDK

0

When using the AWS CLI, I can create a Greengrass v2 deployment using aws greengrassv2 create-deployment --target-arn <thing-name> --cli-input-json file://<path-to-deployment-config>

I already have the deployment file and would like to create the Greengrass v2 deployment programmatically using the Java SDK. GreengrassV2Client's createDeployment method takes a CreateDeploymentRequest parameter but I didn't figure out how to parse a deployment config file into a CreateDeploymentRequest object.

Can you please advise on the idiomatic way to programmatically create a Greengrass v2 deployment from a deployment config file using the Java SDK?

asked 15 days ago74 views
1 Answer
0
Accepted Answer

I did find the answer eventually:

GetDeploymentResponse deployment = new ObjectMapper().readValue(deploymentJson, GetDeploymentResponse.serializableBuilderClass()).build();

The answer is provided in Stackoverflow https://stackoverflow.com/questions/75568439/how-can-you-serialize-deserialize-aws-java-sdk-v2-classes-into-from-json and Github https://github.com/aws/aws-sdk-java-v2/issues/2254

answered 15 days 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