

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# コマンドデータバッグ (aws\$1opsworks\$1command)
<a name="data-bag-json-command"></a>

**重要**  
この AWS OpsWorks Stacks サービスは 2024 年 5 月 26 日にサポート終了となり、新規および既存のお客様の両方で無効になっています。できるだけ早くワークロードを他のソリューションに移行することを強くお勧めします。移行についてご質問がある場合は、[AWS re:Post](https://repost.aws/) または[AWS プレミアムサポート](https://aws.amazon.com/support)を通じて AWS サポート チームにお問い合わせください。

スタックが 1 OpsWorks つ以上のインスタンスで実行するコマンドの設定を表します。

以下の例は、Chef 検索を使用して単一のデータバッグ項目を通じて検索を実行し、次に複数のデータバッグ項目を使用して、コマンドのタイプと送信されるタイミングとともに Chef ログにメッセージを書き込む方法を示しています。

```
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](#data-bag-json-command-args) | [command\$1id](#data-bag-json-command-command-id) | [iam\$1user\$1arn](#data-bag-json-command-iam-user-arn) | 
| [instance\$1id](#data-bag-json-command-instance-id) | [sent\$1at](#data-bag-json-command-sent-at) | [型](#data-bag-json-command-type) | 

**args**  <a name="data-bag-json-command-args"></a>
コマンドの引数 (文字列)。

**command\$1id**  <a name="data-bag-json-command-command-id"></a>
 OpsWorks スタックによって割り当てられたコマンドのランダムな一意の識別子 (文字列）。

**iam\$1user\$1arn**  <a name="data-bag-json-command-iam-user-arn"></a>
コマンドがユーザーによって作成された場合、コマンドを作成したユーザーの Amazon リソース名 (ARN) (文字列)。

**instance\$1id**  <a name="data-bag-json-command-instance-id"></a>
コマンドが実行されたインスタンスの識別子 (文字列)。

**sent\$1at**  <a name="data-bag-json-command-sent-at"></a>
 OpsWorks スタックがコマンドを実行したときのタイムスタンプ (文字列）。

**型**  <a name="data-bag-json-command-type"></a>
コマンドのタイプ (文字列)。有効な値を次に示します。  
+ `"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"`