PATH:
usr
/
local
/
jetapps
/
var
/
lib
/
aws
/
lib
/
python2.7
/
site-packages
/
awscli
/
examples
/
opsworks
**To deploy apps and run stack commands** The following examples show how to use the ``create-deployment`` command to deploy apps and run stack commands. Notice that the quote (``"``) characters in the JSON object that specifies the command are all preceded by escape characters (\). Without the escape characters, the command might return an invalid JSON error. **Deploy an App** The following ``create-deployment`` command deploys an app to a specified stack. :: aws opsworks --region us-east-1 create-deployment --stack-id cfb7e082-ad1d-4599-8e81-de1c39ab45bf --app-id 307be5c8-d55d-47b5-bd6e-7bd417c6c7eb --command "{\"Name\":\"deploy\"}" *Output*:: { "DeploymentId": "5746c781-df7f-4c87-84a7-65a119880560" } **Deploy a Rails App and Migrate the Database** The following ``create-deployment`` command deploys a Ruby on Rails app to a specified stack and migrates the database. :: aws opsworks --region us-east-1 create-deployment --stack-id cfb7e082-ad1d-4599-8e81-de1c39ab45bf --app-id 307be5c8-d55d-47b5-bd6e-7bd417c6c7eb --command "{\"Name\":\"deploy\", \"Args\":{\"migrate\":[\"true\"]}}" *Output*:: { "DeploymentId": "5746c781-df7f-4c87-84a7-65a119880560" } For more information on deployment, see `Deploying Apps`_ in the *AWS OpsWorks User Guide*. **Execute a Recipe** The following ``create-deployment`` command runs a custom recipe, ``phpapp::appsetup``, on the instances in a specified stack. :: aws opsworks --region ap-south-1 create-deployment --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --command "{\"Name\":\"execute_recipes\", \"Args\":{\"recipes\":[\"phpapp::appsetup\"]}} *Output*:: { "DeploymentId": "5cbaa7b9-4e09-4e53-aa1b-314fbd106038" } For more information, see `Run Stack Commands`_ in the *AWS OpsWorks User Guide*. **Install Dependencies** The following ``create-deployment`` command installs dependencies, such as packages or Ruby gems, on the instances in a specified stack. :: aws opsworks --region ap-south-1 create-deployment --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --command "{\"Name\":\"install_dependencies\"}" *Output*:: { "DeploymentId": "aef5b255-8604-4928-81b3-9b0187f962ff" } **More Information** For more information, see `Run Stack Commands`_ in the *AWS OpsWorks User Guide*. .. _`Deploying Apps`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-deploying.html .. _`Run Stack Commands`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-commands.html
[-] get-hostname-suggestion.rst
[edit]
[-] describe-apps.rst
[edit]
[-] describe-load-based-auto-scaling.rst
[edit]
[-] update-rds-db-instance.rst
[edit]
[-] create-deployment.rst
[edit]
[-] describe-timebased-auto-scaling.rst
[edit]
[-] create-user-profile.rst
[edit]
[-] disassociate-elastic-ip.rst
[edit]
[-] start-instance.rst
[edit]
[-] describe-elastic-load-balancers.rst
[edit]
[-] delete-instance.rst
[edit]
[-] describe-layers.rst
[edit]
[-] deregister-volume.rst
[edit]
[-] describe-deployments.rst
[edit]
[+]
..
[-] delete-user-profile.rst
[edit]
[-] describe-user-profiles.rst
[edit]
[-] update-my-user-profile.rst
[edit]
[-] describe-my-user-profile.rst
[edit]
[-] register.rst
[edit]
[-] create-stack.rst
[edit]
[-] describe-rds-db-instances.rst
[edit]
[-] assign-instance.rst
[edit]
[-] describe-instances.rst
[edit]
[-] describe-volumes.rst
[edit]
[-] update-elastic-ip.rst
[edit]
[-] delete-stack.rst
[edit]
[-] stop-stack.rst
[edit]
[-] create-layer.rst
[edit]
[-] delete-app.rst
[edit]
[-] update-volume.rst
[edit]
[-] set-time-based-auto-scaling.rst
[edit]
[-] stop-instance.rst
[edit]
[-] register-rds-db-instance.rst
[edit]
[-] start-stack.rst
[edit]
[-] describe-permissions.rst
[edit]
[-] describe-stacks.rst
[edit]
[-] associate-elastic-ip.rst
[edit]
[-] update-instance.rst
[edit]
[-] reboot-instance.rst
[edit]
[-] register-volume.rst
[edit]
[-] deregister-rds-db-instance.rst
[edit]
[-] update-app.rst
[edit]
[-] describe-elastic-ips.rst
[edit]
[-] register-elastic-ip.rst
[edit]
[-] unassign-volume.rst
[edit]
[-] describe-commands.rst
[edit]
[-] describe-raid-arrays.rst
[edit]
[-] detach-elastic-load-balancer.rst
[edit]
[-] unassign-instance.rst
[edit]
[-] set-load-based-auto-scaling.rst
[edit]
[-] deregister-elastic-ip.rst
[edit]
[-] update-layer.rst
[edit]
[-] describe-stack-summary.rst
[edit]
[-] attach-elastic-load-balancer.rst
[edit]
[-] delete-layer.rst
[edit]
[-] set-permission.rst
[edit]
[-] create-app.rst
[edit]
[-] create-instance.rst
[edit]
[-] deregister-instance.rst
[edit]
[-] assign-volume.rst
[edit]