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?

gefragt vor 2 Monaten120 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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

beantwortet vor 2 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen