Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Penglihatan riwayat acara tumpukan
Anda dapat melacak status sumber daya yang AWS CloudFormation dibuat dan dihapus dengan aws cloudformation describe-stack-events
perintah. Jumlah waktu untuk membuat atau menghapus tumpukan tergantung dari kompleksitas tumpukan Anda.
Dalam contoh berikut, sampel tumpukan dibuat dari file templat dengan menggunakan perintah aws cloudformation create-stack
. Setelah tumpukan dibuat, acara yang dilaporkan selama pembuatan tumpukan ditampilkan dengan menggunakan perintah aws cloudformation describe-stack-events
.
Contoh berikut membuat tumpukan dengan nama myteststack
menggunakan file templat 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 } ]
Contoh berikut menjelaskan acara tumpukan 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" } ] }
catatan
Anda dapat menjalankan perintah aws cloudformation describe-stack-events
selagi tumpukan sedang dibuat untuk melihat acara yang dilaporkan.
Acara terbaru dilaporkan terlebih dahulu. Tabel berikut menjelaskan bidang yang dikembalikan oleh perintah aws cloudformation describe-stack-events
:
Bidang | Deskripsi |
---|---|
EventId |
Pengidentifikasi acara. |
StackName |
Nama tumpukan yang sesuai dengan acara tersebut. |
StackId |
Pengidentifikasi tumpukan yang sesuai dengan acara tersebut. |
LogicalResourceId |
Pengidentifikasi logis sumber daya. |
PhysicalResourceId |
Pengidentifikasi fisik sumber daya. |
ResourceProperties |
Properti sumber daya. |
ResourceType |
Jenis sumber daya. |
Timestamp |
Waktu ketika peristiwa itu terjadi. |
ResourceStatus |
Status sumber daya, yang dapat menjadi salah satu kode status berikut:
|
DetailedStatus |
Status rinci tumpukan. Jika |
ResourceStatusReason |
Informasi lebih lanjut tentang status. |