列出资源
在运行 aws cloudformation create-stack
命令后,紧接着使用 aws cloudformation list-stack-resources
命令,可列出其资源。该命令将列出您使用 --stack-name
参数指定的堆栈中的每个资源的汇总信息。该报表包含堆栈的汇总信息,包括创建或删除状态。
以下示例显示了 myteststack
堆栈的资源:
PROMPT>
aws cloudformation list-stack-resources --stack-name myteststack{ "StackResourceSummaries": [ { "ResourceStatus": "CREATE_COMPLETE", "ResourceType": "AWS::S3::Bucket", "ResourceStatusReason": null, "LastUpdatedTimestamp": "2013-08-23T01:02:28.025Z", "PhysicalResourceId": "myteststack-s3bucket-sample", "LogicalResourceId": "S3Bucket" } ] }
Amazon CloudFormation 将报告有关任何正在运行或已删除的堆栈的资源详细信息。如果您指定了状态为 CREATE_IN_PROCESS
的堆栈的名称,Amazon CloudFormation 将仅报告状态为 CREATE_COMPLETE
的资源。
注意
aws cloudformation describe-stack-resources
命令可返回 90 天内删除的堆栈的信息。