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?

demandé il y a 3 mois149 vues
1 réponse
0
Réponse acceptée

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

répondu il y a 3 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions