列出账户的堆栈 (describe-stacks) - AWS OpsWorks

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

列出账户的堆栈 (describe-stacks)

重要

AWS OpsWorks Stacks 不再接受新客户。在 2024 年 5 月 26 日之前,现有客户将能够照常使用 OpsWorks 控制台、API、CLI 和 CloudFormation 资源,届时这些工具或资源将停用。为准备此过渡,我们建议您尽快将堆栈过渡到AWS Systems Manager。有关更多信息,请参阅 AWS OpsWorks Stacks 生命周期终止常见问题解答将 AWS OpsWorks Stacks 应用程序迁移到 AWS Systems Manager Application Manager

使用 describe-stacks 命令列出账户的堆栈或者获取有关指定堆栈的详细信息。

aws opsworks --region us-west-2 describe-stacks

前面的命令返回一个 JSON 对象,其中包含账户中每个堆栈 (在本示例中为两个) 的详细信息。有关各个参数的说明,请参阅 describe-stacks

{ "Stacks": [ { "ServiceRoleArn": "arn:aws:iam::444455556666:role/aws-opsworks-service-role", "StackId": "aeb7523e-7c8b-49d4-b866-03aae9d4fbcb", "DefaultRootDeviceType": "instance-store", "Name": "TomStack-sd", "ConfigurationManager": { "Version": "11.4", "Name": "Chef" }, "UseCustomCookbooks": true, "CustomJson": "{\n \"tomcat\": {\n \"base_version\": 7,\n \"java_opts\": \"-Djava.awt.headless=true -Xmx256m\"\n },\n \ "datasources\": {\n \"ROOT\": \"jdbc/mydb\"\n }\n}", "Region": "us-west-2", "DefaultInstanceProfileArn": "arn:aws:iam::444455556666:instance-profile/aws-opsworks-ec2-role", "CustomCookbooksSource": { "Url": "git://github.com/example-repo/tomcustom.git", "Type": "git" }, "DefaultAvailabilityZone": "us-west-2a", "HostnameTheme": "Layer_Dependent", "Attributes": { "Color": "rgb(45, 114, 184)" }, "DefaultOs": "Amazon Linux", "CreatedAt": "2013-08-01T22:53:42+00:00" }, { "ServiceRoleArn": "arn:aws:iam::444455556666:role/aws-opsworks-service-role", "StackId": "40738975-da59-4c5b-9789-3e422f2cf099", "DefaultRootDeviceType": "instance-store", "Name": "MyStack", "ConfigurationManager": { "Version": "11.4", "Name": "Chef" }, "UseCustomCookbooks": false, "Region": "us-west-2", "DefaultInstanceProfileArn": "arn:aws:iam::444455556666:instance-profile/aws-opsworks-ec2-role", "CustomCookbooksSource": {}, "DefaultAvailabilityZone": "us-west-2a", "HostnameTheme": "Layer_Dependent", "Attributes": { "Color": "rgb(45, 114, 184)" }, "DefaultOs": "Amazon Linux", "CreatedAt": "2013-10-25T19:24:30+00:00" } ] }