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


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
Accepted Answer

I did find the answer eventually:

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

The answer is provided in Stackoverflow and Github

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