run_command - AWS OpsWorks


Runs an AWS OpsWorks Stacks command, which is a JSON file containing a Chef run-list that contains the information necessary to execute an AWS OpsWorks Stacks activity (setup, configure, deploy, and so on). The run_command command generates a log entry that you can view by running show_log . This option is intended only for development purposes, so AWS OpsWorks Stacks does not track changes.

sudo opsworks-agent-cli run_command [activity] [date] [/path/to/valid/json.file]

By default, run_command runs the most recent AWS OpsWorks Stacks command. Use the following options to specify a particular command.


Run a specified AWS OpsWorks Stacks command: setup, configure, deploy, undeploy, start, stop, or restart.


Run the AWS OpsWorks command that executed at the specified timestamp. To get a list of valid timestamps, run list_commands.


Run the specified command JSON file. To get a command's file path, run get_json.

The following output example is from an instance and runs the configure command.

$ sudo opsworks-agent-cli run_command configure [2015-12-02 16:52:53] INFO [opsworks-agent(21970)]: About to re-run 'configure' from 2015-12-01T18:20:24 ... [2015-12-02 16:53:02] INFO [opsworks-agent(21970)]: Finished Chef run with exitcode 0