question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[core] Same stack names in different accounts

See original GitHub issue

I would like to deploy the same stack name to two different accounts

Use Case

It makes more sense to me than trying to make stack names unique org-wide. Also, I have stacks already deployed to multiple accounts that I would like to move into CDK.

Proposed Solution

I would be ok if the logical name of the stack is unique org wide and still generated separate template files, but the manifest file could define the stack name:

    "my-cross-account-stack-dev": {
      "type": "aws:cloudformation:stack",
      "environment": "aws://dev-account-id/unknown-region",
      "stackName": "my-cross-account-stack",
      "properties": {
        "templateFile": "my-cross-account-stack-dev.template.json"
      },

Other

I read through this issue https://github.com/aws/aws-cdk/issues/3401 and this issue https://github.com/aws/aws-cdk/issues/3322 and ultimately that would be the goal. I would like to be able to seamlessly deploy across multiple accounts with the cli.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
NetaNircommented, Sep 29, 2020

The CDK does support stackName as a stack property:

new MyStack(app, 'StackId', {
  env: {
    account: '',
    region: 'us-west-1'
  },
  stackName: 'CoolStack'
})
0reactions
jonb-ifitcommented, Sep 30, 2020

I added looked up that feature flag and added it to my cdk.json and this does work now. Thank you for pointing me to it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

StackSets concepts - AWS CloudFormation
A stack set ensures consistent deployment of the same stack resources, with the same settings, to all specified target accounts within the Regions...
Read more >
Intro to Pulumi: Stacks
The stack name must be unique within a project. Stack names may only contain alphanumeric characters, hyphens, underscores, or periods. $ pulumi stack...
Read more >
CloudFormation — Boto3 Docs 1.26.36 documentation
CloudFormation creates and deletes all member resources of the stack ... The Amazon Resource Name (ARN) for the configuration, in this account and...
Read more >
Multi-region Deployment with CloudFormation StackSets
From an administrator account, you can define a CloudFormation template and use it to provision stacks in multiple target accounts, across multiple AWS ......
Read more >
Stack - SST docs
It automatically prefixes the stack names with the stage and app name ... they can be deployed to multiple regions in the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found