Repository navigation
Add AWS::CloudFormation::StackSet support to cloudformation package - #10655
GarrettBeatty wants to merge 2 commits into
Conversation
Teach the `aws cloudformation package` command to upload local templates referenced by the TemplateURL property of AWS::CloudFormation::StackSet resources, mirroring the existing AWS::CloudFormation::Stack behavior. Ports the change from the long-open v1 PR #5591 to v2. Fixes CLI-1773 / V273201798.
luigi617
left a comment
There was a problem hiding this comment.
There is a gap with multi-region StackSets: CloudFormationStackSetResource reuses the nested-stack logic, so package also packages local files referenced inside the StackSet's template (Lambda Code, CodeUri, etc.) and uploads them to the single --s3-bucket. A StackSet can deploys that same template to other regions and accounts, and Lambda requires its code bucket to be in the function's region. So, if the scope of this PR is only for single-region case, we should at least have the limitation documented.
|
@luigi617 Good catch — agreed this PR is scoped to mirroring |
Summary
Adds support for the
AWS::CloudFormation::StackSetresource to theaws cloudformation packagecommand. When a StackSet'sTemplateURLproperty references a local template file,packagenow uploads it to S3 and rewrites the property to the S3 URL — mirroring the existing behavior forAWS::CloudFormation::Stack.This ports the long-open v1 PR #5591 to the
v2branch (v1 is in maintenance mode). The sibling CodeCommit change (#5568) already shipped in v2; this fills the remaining gap. Tracked by CLI-1773 / V273201798.Changes
artifact_exporter.py: newCloudFormationStackSetResource(subclassesCloudFormationStackResource,TemplateURLproperty) + registered inRESOURCES_EXPORT_LIST._package_description.rst: documents the newly supported property.test_artifact_exporter.py: addstest_export_cloudformation_stackset..changes/next-release/.Fixed the original PR's casing (
StackSet, notStackset) to match the CFN resource type.Testing
test_artifact_exporter.py— 77 passed (incl. the new test).packageuploaded the child template and rewroteTemplateURLto anhttps://s3...URL;deployof the packaged template created aSELF_MANAGEDStackSet (ACTIVE), confirming CFN could consume the generated URL. Stack, StackSet, and bucket were deleted after.Notes
Pre-commit ruff flags pre-existing issues in these files (e.g.
super(__class__, self)at lines 309/469, unused vars in unrelated tests) that are not part of this change; left untouched to keep the diff minimal.