Deploy an App (create-deployment) - AWS OpsWorks

Deploy an App (create-deployment)

Important

AWS OpsWorks Stacks is no longer accepting new customers. Existing customers will be able to use the OpsWorks console, API, CLI, and CloudFormation resources as normal until May 26, 2024, at which time they will be discontinued. To prepare for this transition, we recommend you transition your stacks to AWS Systems Manager as soon as possible. For more information, see AWS OpsWorks Stacks End of Life FAQs and Migrating your AWS OpsWorks Stacks applications to AWS Systems Manager Application Manager.

Use the create-deployment command to deploy an app to a specified stack.

Deploy an App

aws opsworks --region us-west-1 create-deployment --stack-id cfb7e082-ad1d-4599-8e81-de1c39ab45bf --app-id 307be5c8-d55d-47b5-bd6e-7bd417c6c7eb --command "{\"Name\":\"deploy\"}"

The arguments are as follows:

  • stack-id – You can get the stack ID from the stack's settings page on the console (look for OpsWorks ID) or by calling describe-stacks.

  • app-id – You can get app ID from the app's details page (look for OpsWorks ID) or by calling describe-apps.

  • command – The argument takes a JSON object that sets the command name to deploy, which deploys the specified app to the stack.

    Notice that the " characters in the JSON object are all escaped. Otherwise, the command might return an error that the JSON is invalid.

The command returns a JSON object that contains the deployment ID, as follows:

{ "DeploymentId": "5746c781-df7f-4c87-84a7-65a119880560" }
Note

The preceding example deploys to every instance in the stack. To deploy to a specified subset of instances, add an instance-ids argument and list the instance IDs.