There are more AWS SDK examples available in the AWS Doc SDK Examples
Use DescribeStackEvents with a CLI
The following code examples show how to use DescribeStackEvents.
- CLI
-
- AWS CLI
-
To describe stack events
The following
describe-stack-eventsexample displays the 2 most recent events for the specified stack.aws cloudformation describe-stack-events \ --stack-namemy-stack\ --max-items2Output:
{ "StackEvents": [ { "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "EventId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "StackName": "my-stack", "LogicalResourceId": "my-stack", "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "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/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "EventId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "StackName": "my-stack", "LogicalResourceId": "my-stack", "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2019-10-02T05:34:29.127Z", "ResourceStatus": "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS" } ], "NextToken": "eyJOZXh0VG9XMPLiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ==" }For more information, see Monitor stack progress in the AWS CloudFormation User Guide.
-
For API details, see DescribeStackEvents
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: Returns all stack related events for the specified stack.
Get-CFNStackEvent -StackName "myStack"-
For API details, see DescribeStackEvents in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: Returns all stack related events for the specified stack.
Get-CFNStackEvent -StackName "myStack"-
For API details, see DescribeStackEvents in AWS Tools for PowerShell Cmdlet Reference (V5).
-