Skip to content

Add AWS::CloudFormation::StackSet support to cloudformation package - #10655

Open
GarrettBeatty wants to merge 2 commits into
v2from
stackset-package-v2
Open

GarrettBeatty wants to merge 2 commits into
v2from
stackset-package-v2

Conversation

@GarrettBeatty

Copy link
Copy Markdown
Contributor

Summary

Adds support for the AWS::CloudFormation::StackSet resource to the aws cloudformation package command. When a StackSet's TemplateURL property references a local template file, package now uploads it to S3 and rewrites the property to the S3 URL — mirroring the existing behavior for AWS::CloudFormation::Stack.

This ports the long-open v1 PR #5591 to the v2 branch (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: new CloudFormationStackSetResource (subclasses CloudFormationStackResource, TemplateURL property) + registered in RESOURCES_EXPORT_LIST.
  • _package_description.rst: documents the newly supported property.
  • test_artifact_exporter.py: adds test_export_cloudformation_stackset.
  • Changelog entry under .changes/next-release/.

Fixed the original PR's casing (StackSet, not Stackset) to match the CFN resource type.

Testing

  • Unit: test_artifact_exporter.py — 77 passed (incl. the new test).
  • Real AWS end-to-end (personal account, since torn down): package uploaded the child template and rewrote TemplateURL to an https://s3... URL; deploy of the packaged template created a SELF_MANAGED StackSet (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.

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.
@GarrettBeatty
GarrettBeatty marked this pull request as ready for review September 16, 2026 19:31
@GarrettBeatty
GarrettBeatty requested a review from a team as a code owner September 16, 2026 19:31
@GarrettBeatty
GarrettBeatty marked this pull request as draft September 17, 2026 14:06
@GarrettBeatty
GarrettBeatty marked this pull request as ready for review October 26, 2026 14:42

@luigi617 luigi617 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@GarrettBeatty

Copy link
Copy Markdown
Contributor Author

@luigi617 Good catch — agreed this PR is scoped to mirroring AWS::CloudFormation::Stack behavior (single bucket). I've documented the multi-Region limitation in the package description: artifacts inside a StackSet's template go to the single --s3-bucket, so for multi-Region StackSets users should reference Region-accessible S3 locations rather than local paths. Per-Region bucket support could be a follow-up feature.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants