Visualización de historial de eventos de la pila - AWS CloudFormation

Visualización de historial de eventos de la pila

Puede realizar un seguimiento del estado de los recursos que AWS CloudFormation está creando y eliminando con el comando aws cloudformation describe-stack-events. La cantidad de tiempo necesaria para crear o eliminar una pila depende de la complejidad de la pila.

En el siguiente ejemplo, se crea una pila de ejemplo a partir de un archivo de plantilla utilizando el comando aws cloudformation create-stack. Una vez creada la pila, los eventos notificados durante la creación de la pila se muestran mediante el comando aws cloudformation describe-stack-events.

En el siguiente ejemplo se crea una pila con el nombre myteststack utilizando el archivo de plantilla 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 } ]

En el siguiente ejemplo se describen los eventos de la pila 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" } ] }
nota

Puede ejecutar el comando aws cloudformation describe-stack-events mientras se está creando la pila para ver los eventos a medida que se registran.

Los eventos más recientes se informan en primer lugar. La siguiente tabla describe los campos devueltos por el comando aws cloudformation describe-stack-events:

Campo Descripción
EventId

Identificador de eventos.

StackName

Nombre de la pila a la que corresponde el evento.

StackId

Identificador de la pila a la que corresponde el evento.

LogicalResourceId

Identificador lógico del recurso.

PhysicalResourceId

Identificador físico del recurso.

ResourceProperties

Propiedades del recurso.

ResourceType

Tipo del recurso.

Timestamp

Hora en la que se produjo el evento.

ResourceStatus

El estado del recurso, que puede ser uno de los siguientes códigos de estado: 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

El estado DELETE_SKIPPED se aplica a los recursos con un atributo de la política de eliminación de conservación.

DetailedStatus

Estado detallado de la pila. Si CONFIGURATION_COMPLETE está presente, la fase de configuración de los recursos de la pila se ha completado y la estabilización de los recursos está en curso.

ResourceStatusReason

Más información sobre el estado.