awslabs / landing-zone-accelerator-on-aws

Deploy a multi-account cloud foundation to support highly-regulated workloads and complex compliance requirements.
https://aws.amazon.com/solutions/implementations/landing-zone-accelerator-on-aws/
Apache License 2.0
502 stars 397 forks source link

CDK Fails to deploy Customizations using Global Replacements Syntax (v1.7.1) #503

Open joshuahigginson1 opened 6 days ago

joshuahigginson1 commented 6 days ago

Describe the bug It has been observed that when running a build of the Landing Zone Accelerator which uses Global Replacements Syntax in v1.7.1 of the Landing Zone Accelerator,

During the customizations stage, when using a Global Replacement Variable in the NAME value for a CloudFormation Stack, i.e:

    - name: "{{ CustomAcceleratorPrefix }}-ReadOnlyRoleCreation"
      description: "This CloudFormation template is used to create the Read Only role and policy for the infrastructure testers. It must be assumed from an IAM PermissionSet."
      template: ./cloudformation-templates/read-only-role-creation-cfn-template.yaml
      terminationProtection: false
      runOrder: 1

The Landing Zone Accelerator solution will correctly synthesise the stack:

✅  AWSAccelerator-CustomizationsStack-11111111-eu-west-2 (no changes)
--
194 |  
195 | ✨  Deployment time: 1.06s
196 |  
197 | Stack ARN:
198 | arn:aws:cloudformation:eu-west-2:11111111:stack/AWSAccelerator-CustomizationsStack-11111111-eu-west-2/<Changeset ID>
199 |  
200 | ✨  Total time: 1.2s

But the CDK will fail to deploy it after synthesis:

2024-07-01 08:05:39.745 \| error \| toolkit \| No stacks match the name(s) {{CustomAcceleratorPrefix}}-ReadOnlyRoleCreation-11111111-eu-west-2
--
1265 | Deployment failed

To Reproduce

Expected behavior

After synthesis, the CFN template should attempt to deploy.

Please complete the following information about the solution:

v1.7.1

To get the version of the solution, you can look at the description of the created AWS CloudFormation stack used to install the LZA (AWSAccelerator-InstallerStack). For example, "(SO0199) Landing Zone Accelerator on AWS. Version 1.5.1.". If the description does not contain the version information, you can look at the Parameters of the stack for the RepositoryBranchName as that should contain the version number.

Observed in All Regions

No

Yes

Yes, Shown

Screenshots If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).

Additional context Add any other context about the problem here.

vanja-zecevic commented 3 days ago

Can also confirm LZA 1.8.0 fails to deploy customizations when global replacements are used.