Command Data Bag (aws_opsworks_command) - AWS OpsWorks

Command Data Bag (aws_opsworks_command)

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.

Represents settings for a command that AWS OpsWorks Stacks runs on one or more instances.

The following example shows how to use Chef search to search through a single data bag item and then multiple data bag items to write messages to the Chef log with the commands' types and when they were sent:

command = search("aws_opsworks_command").first Chef::Log.info("********** The command's type is '#{command['type']}' **********") Chef::Log.info("********** The command was sent at '#{command['sent_at']}' **********") search("aws_opsworks_command").each do |command| Chef::Log.info("********** The command's type is '#{command['type']}' **********") Chef::Log.info("********** The command was sent at '#{command['sent_at']}' **********") end
args

Arguments for the command (string).

command_id

The command's random unique identifier, assigned by AWS OpsWorks Stacks (string).

iam_user_arn

If the command is created by the customer, the Amazon Resource Name (ARN) of the user who created the command (string).

instance_id

The identifier of the instance that the command was run on (string).

sent_at

The timestamp of when AWS OpsWorks Stacks ran the command (string).

type

The command's type (string). Valid values include:

  • "configure"

  • "deploy"

  • "deregister"

  • "execute_recipes"

  • "grant_remote_access"

  • "install_dependencies"

  • "restart"

  • "revoke_remote_access"

  • "rollback"

  • "setup"

  • "shutdown"

  • "start"

  • "stop"

  • "sync_remote_users"

  • "undeploy"

  • "update_agent"

  • "update_custom_cookbooks"

  • "update_dependencies"