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?

질문됨 2달 전120회 조회
1개 답변
0
수락된 답변

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

답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠