feat(cloudformation): exports, deletion policies and DELETE_FAILED (CFN-5) - #1376
Merged
Merged
Conversation
NitinKumar004
marked this pull request as ready for review
September 27, 2026 15:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CFN-5: stack exports and imports, DeletionPolicy and UpdateReplacePolicy, DELETE_FAILED with RetainResources, termination protection, CreateStack failure options, and the account operations. It builds on the CFN-4 converge and change set engine.
Exports and Fn::ImportValue
Fn::ImportValueresolves exports in long and short form. An import of a missing export fails the stack with "No export named X found." and follows the failure mode.ListExportsandListImports, both paged. ListImports of an export nothing imports is "Export 'X' is not imported by any stack.".DeletionPolicy and UpdateReplacePolicy
RetainExceptOnCreateflag on CreateStack, UpdateStack and ExecuteChangeSet also deletes new Retain resources on that rollback (the UpdateStack part of CFN-X9).DELETE_FAILED and RetainResources
RetainResourcesis accepted only from DELETE_FAILED, with the real "Invalid operation on stack" error otherwise.DeletionMode FORCE_DELETE_STACKkeeps whatever still fails to delete.Termination protection and CreateStack failure options
EnableTerminationProtectionon CreateStack, the newUpdateTerminationProtection, and the DeleteStack refusal "Stack [X] cannot be deleted while TerminationProtection is enabled".OnFailureROLLBACK, DO_NOTHING and DELETE andDisableRollback(CFN-X11). The two together are refused.Account operations
DescribeAccountLimitsreturns StackLimit 2000, StackOutputsLimit 200 and ConcurrentResourcesLimit 2500. CreateStack past the stack limit is LimitExceededException, and a template with more than 200 outputs is a template format error.EstimateTemplateCostchecks the template and returns a calculator link whose id is a hash of the input.DescribeStacks now reports EnableTerminationProtection, RetainExceptOnCreate, DeletionMode and DeletionTime.
API.DeleteStacktakes aDeleteStackInput.Not in this PR
Testing
cloudemu serve: exporter plus importer, blocked update and delete of the exporter, duplicate export, list-imports, a Retain DynamoDB table whose item survives the stack delete, a non-empty bucket ending DELETE_FAILED then deleted with--retain-resources, termination protection, and--on-failure DO_NOTHINGandDELETEand--disable-rollback.aws_cloudformation_stackexporter plus importer: apply, plan clean, update both, plan clean, destroy in dependency order.