AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
DescribeStackEvents
与 a 一起使用 CLI
以下代码示例演示如何使用 DescribeStackEvents
。
- CLI
-
- AWS CLI
-
描述堆栈事件
以下
describe-stack-events
示例显示了指定堆栈的 2 个最新事件。aws cloudformation describe-stack-events \ --stack-name
my-stack
\ --max-items2
{
"StackEvents":[
{
"StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204", "EventId": "4e1516d0-e4d6-xmpl-b94f-0a51958a168c", "StackName": "my-stack", "LogicalResourceId": "my-stack", "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2019-10-02T05:34:29.556Z", "ResourceStatus":"UPDATE_COMPLETE"
},
{
"StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204", "EventId": "4dd3c810-e4d6-xmpl-bade-0aaf8b31ab7a", "StackName": "my-stack", "LogicalResourceId": "my-stack", "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2019-10-02T05:34:29.127Z", "ResourceStatus":"UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"
}
],
"NextToken":"eyJOZXh0VG9XMPLiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ=="
}
-
有关API详细信息,请参阅 “DescribeStackEvents AWS CLI
命令参考”。
-
- PowerShell
-
- 用于 PowerShell
-
示例 1:返回指定堆栈的所有堆栈相关事件。
Get-CFNStackEvent -StackName "myStack"
-
有关API详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考DescribeStackEvents中的。
-
DeleteStack
DescribeStackResource