Skip to content

Conversation

@simonrw
Copy link
Contributor

@simonrw simonrw commented Jul 15, 2025

Motivation

The new provider does not support the GetTemplate operation. This PR implements an initial version.

Changes

  • Store a copy of the original (parsed but not transformed) template on the stack
  • Implement the provider method basically copying the v1 implementation
  • Unskip 3 tests

@simonrw simonrw added the semver: patch Non-breaking changes which can be included in patch releases label Jul 15, 2025
@github-actions
Copy link

github-actions bot commented Jul 15, 2025

Test Results - Preflight, Unit

21 983 tests  ±0   20 249 ✅ ±0   6m 20s ⏱️ -8s
     1 suites ±0    1 734 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit b5b2b09. ± Comparison against base commit 7d9827e.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jul 15, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 18s ⏱️ +10s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit b5b2b09. ± Comparison against base commit 7d9827e.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jul 15, 2025

LocalStack Community integration with Pro

  2 files    2 suites   23m 41s ⏱️
898 tests 334 ✅ 564 💤 0 ❌
900 runs  334 ✅ 566 💤 0 ❌

Results for commit b5b2b09.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jul 15, 2025

Test Results (amd64) - Integration, Bootstrap

  5 files    5 suites   34m 30s ⏱️
922 tests 359 ✅ 563 💤 0 ❌
928 runs  359 ✅ 569 💤 0 ❌

Results for commit b5b2b09.

♻️ This comment has been updated with latest results.

@simonrw simonrw force-pushed the cfn/v2/get-template branch from 757ff16 to 96caa53 Compare July 17, 2025 13:15
@simonrw simonrw marked this pull request as ready for review July 17, 2025 15:34
Comment on lines 613 to 629
if template_stage == TemplateStage.Processed and "Transform" in stack.template_body:
copy_template = copy.deepcopy(stack.template_original)
for key in [
"ChangeSetName",
"StackName",
"StackId",
"Transform",
"Conditions",
"Mappings",
]:
copy_template.pop(key, None)
for key in ["Parameters", "Outputs"]:
if key in copy_template and not copy_template[key]:
copy_template.pop(key)
for resource in copy_template.get("Resources", {}).values():
resource.pop("LogicalResourceId", None)
template_body = json.dumps(copy_template)
Copy link
Member

Choose a reason for hiding this comment

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

comment: Not a fan of this. I believe this is one of the points we discussed in the CFn syncs long ago where we wanted to have an actual attribute of stack that stores the processed template and not version of stack state converted into a template.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You have a fair point. I will see about storing the transformed template after we have performed the transform. Thanks


return GetTemplateOutput(
TemplateBody=template_body,
StagesAvailable=[TemplateStage.Original, TemplateStage.Processed],
Copy link
Member

Choose a reason for hiding this comment

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

question: Are stages: Original and Processed always available?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is in parity with the old provider, but I will check. Thanks for flagging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems both options are always available and there are no other options so I think we are good here.

@simonrw simonrw modified the milestones: Playground, 4.8 Jul 24, 2025
@simonrw simonrw force-pushed the cfn/v2/get-template branch from 25a0b71 to e19ca94 Compare July 24, 2025 15:14
Copy link
Member

@pinzon pinzon left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my comments. 👍

@simonrw simonrw merged commit 00b8882 into main Jul 24, 2025
39 checks passed
@simonrw simonrw deleted the cfn/v2/get-template branch July 24, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants