スタックイベント履歴の表示 - AWS CloudFormation

スタックイベント履歴の表示

AWS CloudFormation によって作成または削除されるリソースのステータスは、aws cloudformation describe-stack-events コマンドを使用して追跡できます。スタックの作成または削除に要する時間は、目的のスタックの複雑さによって異なります。

次の例では、aws cloudformation create-stack コマンドを使用してテンプレートファイルからサンプルスタックを作成しています。スタックの作成後、aws cloudformation describe-stack-events コマンドを使って、スタックの作成中に報告されたイベントを表示します。

次の例では、myteststack テンプレートファイルを使用して、sampletemplate.json という名前のスタックを作成します。

$ aws cloudformation create-stack \ --stack-name myteststack \ --template-body file:///home/local/test/sampletemplate.json [ { "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896", "Description": "AWS CloudFormation Sample Template S3_Bucket: Sample template showing how to create a publicly accessible S3 bucket. **WARNING** This template creates an S3 bucket. You will be billed for the AWS resources used if you create a stack from this template.", "Tags": [], "Outputs": [ { "Description": "Name of S3 bucket to hold website content", "OutputKey": "BucketName", "OutputValue": "myteststack-s3bucket-jssofi1zie2w" } ], "StackStatusReason": null, "CreationTime": "2013-08-23T01:02:15.422Z", "Capabilities": [], "StackName": "myteststack", "StackStatus": "CREATE_COMPLETE", "DisableRollback": false } ]

次の例は、myteststack スタックイベントを表しています。

$ aws cloudformation describe-stack-events --stack-name myteststack { "StackEvents": [ { "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896", "EventId": "af67ef60-0b8f-11e3-8b8a-500150b352e0", "ResourceStatus": "CREATE_COMPLETE", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2013-08-23T01:02:30.070Z", "StackName": "myteststack", "PhysicalResourceId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/a69442d0-0b8f-11e3-8b8a-500150b352e0", "LogicalResourceId": "myteststack" }, { "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896", "EventId": "S3Bucket-CREATE_COMPLETE-1377219748025", "ResourceStatus": "CREATE_COMPLETE", "ResourceType": "AWS::S3::Bucket", "Timestamp": "2013-08-23T01:02:28.025Z", "StackName": "myteststack", "ResourceProperties": "{\"AccessControl\":\"PublicRead\"}", "PhysicalResourceId": "myteststack-s3bucket-jssofi1zie2w", "LogicalResourceId": "S3Bucket" }, { "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896", "EventId": "S3Bucket-CREATE_IN_PROGRESS-1377219746688", "ResourceStatus": "CREATE_IN_PROGRESS", "ResourceType": "AWS::S3::Bucket", "Timestamp": "2013-08-23T01:02:26.688Z", "ResourceStatusReason": "Resource creation Initiated", "StackName": "myteststack", "ResourceProperties": "{\"AccessControl\":\"PublicRead\"}", "PhysicalResourceId": "myteststack-s3bucket-jssofi1zie2w", "LogicalResourceId": "S3Bucket" }, { "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896", "EventId": "S3Bucket-CREATE_IN_PROGRESS-1377219743862", "ResourceStatus": "CREATE_IN_PROGRESS", "ResourceType": "AWS::S3::Bucket", "Timestamp": "2013-08-23T01:02:23.862Z", "StackName": "myteststack", "ResourceProperties": "{\"AccessControl\":\"PublicRead\"}", "PhysicalResourceId": null, "LogicalResourceId": "S3Bucket" }, { "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896", "EventId": "a69469e0-0b8f-11e3-8b8a-500150b352e0", "ResourceStatus": "CREATE_IN_PROGRESS", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2013-08-23T01:02:15.422Z", "ResourceStatusReason": "User Initiated", "StackName": "myteststack", "PhysicalResourceId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/a69442d0-0b8f-11e3-8b8a-500150b352e0", "LogicalResourceId": "myteststack" } ] }
注記

aws cloudformation describe-stack-events コマンドは、スタックの作成中に実行して、報告されるイベントを表示することができます。

最新のイベントが先頭に表示されます。次の表は、aws cloudformation describe-stack-events コマンドによって返されるフィールドとその説明です。

フィールド 説明
EventId

イベントの識別子

StackName

イベントに対応するスタックの名前

StackId

イベントに対応するスタックの識別子

LogicalResourceId

リソースの論理識別子

PhysicalResourceId

リソースの物理識別子

ResourceProperties

リソースのプロパティ

ResourceType

リソースのタイプ。

Timestamp

イベントが発生した時刻

ResourceStatus

リソースのステータスは、以下のステータスコードのいずれかになります。CREATE_COMPLETE | CREATE_FAILED | CREATE_IN_PROGRESS | DELETE_COMPLETE | DELETE_FAILED | DELETE_IN_PROGRESS | DELETE_SKIPPED | IMPORT_COMPLETE | IMPORT_IN_PROGRESS | IMPORT_ROLLBACK_COMPLETE | IMPORT_ROLLBACK_FAILED | IMPORT_ROLLBACK_IN_PROGRESS | REVIEW_IN_PROGRESS | ROLLBACK_COMPLETE | ROLLBACK_FAILED | ROLLBACK_IN_PROGRESS | UPDATE_COMPLETE | UPDATE_COMPLETE_CLEANUP_IN_PROGRESS | UPDATE_FAILED | UPDATE_IN_PROGRESS | UPDATE_ROLLBACK_COMPLETE | UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS | UPDATE_ROLLBACK_FAILED | UPDATE_ROLLBACK_IN_PROGRESS

DELETE_SKIPPED ステータスは、削除ポリシー属性が保持になっているリソースに適用されます。

DetailedStatus

スタックの詳細ステータス。CONFIGURATION_COMPLETE が存在する場合、スタックリソースの設定フェーズは完了済みで、リソースの安定化が進行中です。

ResourceStatusReason

ステータスの詳細