本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
stack_state
重要
该 AWS OpsWorks Stacks 服务于 2024 年 5 月 26 日终止,新客户和现有客户均已禁用。我们强烈建议客户尽快将其工作负载迁移到其他解决方案。如果您对迁移有疑问,请通过 re AWS : Post 或通过 Pre
显示 AWS OpsWorks Stacks 内部在最近运行 Chef 时使用的信息。
opsworks-agent-cli stack_state
注意
对于 Chef 12 Linux 实例,运行此命令将返回有效的信息,例如实例的堆栈配置和部署属性。但是,要获得更完整的信息,请参阅 AWS OpsWorks Stacks 在实例上创建的 Chef 数据包。有关更多信息,请参阅 AWS OpsWorks 堆栈数据包参考。
以下输出示例来自一个实例。
$ sudo opsworks-agent-cli stack_state
{
"last_command": {
"sent_at": "2015-12-01T18:19:23+00:00",
"activity": "configure"
},
"instance": {
"ami_id": "ami-d93622EX",
"architecture": "x86_64",
"auto_scaling_type": null,
"availability_zone": "us-west-2a",
"created_at": "2015-11-18T00:21:05+00:00",
"ebs_optimized": false,
"ec2_instance_id": "i-a480e9EX",
"elastic_ip": null,
"hostname": "cookbooks-demo1",
"instance_id": "cfdaa716-42fe-4e3b-9762-fef184ddd8EX",
"instance_type": "c3.large",
"layer_ids": [
"93f50d83-1e73-45c4-840a-0d4f07cda1EX"
],
"os": "Amazon Linux 2015.09",
"private_dns": "ip-192-0-2-0.us-west-2.compute.internal",
"private_ip": "10.122.69.33",
"public_dns": "ec2-203-0-113-0.us-west-2.compute.amazonaws.com",
"public_ip": "192.0.2.0",
"root_device_type": "ebs",
"root_device_volume_id": "vol-f6f7e8EX",
"ssh_host_dsa_key_fingerprint": "f2:...:15",
"ssh_host_dsa_key_public": "ssh-dss AAAAB3Nz...a8vMbqA=",
"ssh_host_rsa_key_fingerprint": "0a:...:96",
"ssh_host_rsa_key_public": "ssh-rsa AAAAB3Nz...yhPanvo7",
"status": "online",
"subnet_id": null,
"virtualization_type": "paravirtual",
"infrastructure_class": "ec2",
"ssh_host_dsa_key_private": "-----BEGIN DSA PRIVATE KEY-----\nMIIDVwIB...g5OtgQ==\n-----END DSA PRIVATE KEY-----\n",
"ssh_host_rsa_key_private": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIB...78kprtIw\n-----END RSA PRIVATE KEY-----\n"
},
"layers": [
{
"layer_id": "93f50d83-1e73-45c4-840a-0d4f07cda1EX",
"name": "MyCookbooksDemoLayer",
"packages": [
],
"shortname": "cookbooks-demo",
"type": "custom",
"volume_configurations": [
]
}
],
"applications": null,
"stack": {
"arn": "arn:aws:opsworks:us-west-2:80398EXAMPLE:stack/040c3def-b2b4-4489-bb1b-e08425886fEX/",
"custom_cookbooks_source": {
"type": "s3",
"url": "https://s3.amazonaws.com/amzn-s3-demo-bucket/opsworks-cookbook-demo.tar.gz",
"username": "AKIAJUQN...WG644EXA",
"password": "O5v+4Zz+...rcKbFTJu",
"ssh_key": null,
"revision": null
},
"name": "MyCookbooksDemoStack",
"region": "us-west-2",
"stack_id": "040c3def-b2b4-4489-bb1b-e08425886fEX",
"use_custom_cookbooks": true,
"vpc_id": null
},
"agent": {
"valid_activities": [
"reboot",
"stop",
"deploy",
"grant_remote_access",
"revoke_remote_access",
"update_agent",
"setup",
"configure",
"update_dependencies",
"install_dependencies",
"update_custom_cookbooks",
"execute_recipes",
"sync_remote_users"
]
}
}