chrisrhyno2003
chrisrhyno2003

Reputation: 4197

CloudFormation vieweing inactive/deleted change sets

I have a cloudFormation stack which is in an active state. I executed a change set on the specific stack. Once executed, the change no longer appears as a value on the CloudFormation console. However if I do a describe-change-set operation with the change set ARN, I get the details of the changeset.

CloudFormation has an list-stacks API which lists deleted and active stacks. Is there any API to list inactive/expired/deleted change sets? Is that even possible?

Upvotes: 2

Views: 1766

Answers (2)

Rodrigue
Rodrigue

Reputation: 3687

If you have Cloudtrail enabled and if the changeset was created and executed in the last 90 days you may be able to find the content of the change set.

First, in Cloudtrail search for CreateChangeSet or ExecuteChangeSet events around the time the change was executed. Once you have found the event you will see that it contains the ARN of the changeset:

  • For CreateChangeSet: in the "responseElements"."id" field.
  • For ExecuteChangeSet: in the "requestParameters"."changeSetName" field.

Once you have the ARN you can use it in the Cloudformation DescribeChangeSet API call to get the content of the changeset. For example, using the AWS CLI:

aws cloudformation describe-change-set --change-set-name <ID_FROM_CLOUDTRAIL_EVENT>

Upvotes: 0

wjordan
wjordan

Reputation: 20390

No, there doesn't appear to be any API that can list inactive (but not deleted) CloudFormation Change Sets.

The ListChangeSets API is described as follows:

Returns the ID and status of each active change set for a stack.

Once a Change Set is executed, it is not deleted, but enters the EXECUTE_COMPLETE state. The Change Set is still referenced by the stack in the Stack.ChangeSetId property returned by the DescribeStacks API, as used by the CloudFormation Console's Change Sets tab, though it no longer appears in the ListChangeSets output.

Beyond that, since Change Sets become unusable as soon as the stack has been updated, there's not really any other use for them. I'm also surprised they are still retained (indefinitely?). I wouldn't be surprised if a more explicit/controllable lifecycle for inactive Change Sets is eventually added, since this feature is still less than a year old.

Upvotes: 2

Related Questions