Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Execute a Recipe (create-deployment) - AWS OpsWorks

Execute a Recipe (create-deployment)

Important

The AWS OpsWorks Stacks service reached end of life on May 26, 2024 and has been disabled for both new and existing customers. We strongly recommend customers migrate their workloads to other solutions as soon as possible. If you have questions about migration, reach out to the AWS Support Team on AWS re:Post or through AWS Premium Support.

Use the create-deployment command to execute stack commands and deployment commands. The following example executes a stack command to run a custom recipe on a specified stack.

aws opsworks --region us-west-1 create-deployment --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --command "{\"Name\":\"execute_recipes\", \"Args\":{\"recipes\":[\"phpapp::appsetup\"]}}"

The command argument takes a JSON object that is formatted as follows:

  • Name - Specifies the command name. The execute_recipes command used for this example executes a specified recipe on the stack's instances.

  • Args - Specifies a list of arguments and their values. This example has one argument, recipes, which is set to the recipe to be executed, phpapp::appsetup.

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 deployment ID, which you can use to identify the command for other CLI commands such as describe-commands.

{ "DeploymentId": "5cbaa7b9-4e09-4e53-aa1b-314fbd106038" }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.