aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 54 forks source link

AWS::CloudFormation::StackInstance - New Resource #103

Open benbridts opened 5 years ago

benbridts commented 5 years ago
  1. Title -> AWS::CloudFormation::StackInstance
  2. Scope of request -> A StackInstance resource that can be used to add Stacks to a StackSet
  3. Expected behavior -> It takes a !Ref to a StackSet (see #102), an AccountId and a Region. One StackInstance should be exactly one account+region.
  4. Links to existing API doc (optional) -> https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html
  5. Category tag (optional) -> Management & Governance
  6. Any additional context (optional) The API allows creating mulitple stack instances at the same time. This may be a possible way to do it, but I think that having one Resource per Instance makes more sense in a CloudFormation template.
piersf commented 4 years ago

Hi all,

Are there any updates or any estimation when this will be implemented? Having this feature adds massive value to our ability to use StackSets with AWS Organizations for governance at scale.

Thank you!

rafalwrzeszcz commented 4 years ago

In the meantime you may want to check out:

https://rafalwrzeszcz-wrzasqpl.github.io/pl.wrzasq.lambda/lambda-cform/lambda-cform-stackset/guide/usage.html https://rafalwrzeszcz-wrzasqpl.github.io/pl.wrzasq.lambda/lambda-cform/lambda-cform-stackset-instance/guide/usage.html

piersf commented 3 years ago

CloudFormation released support for StackSet 3 days ago - https://aws.amazon.com/about-aws/whats-new/2020/09/aws-cloudformation-now-supports-stacksets-resource-type-in-the-cloudformation-registry/

This is awesome!

benbridts commented 3 years ago

That unfortunately does not allow you to add a stack instance to an existing ~stack~ stack set :(

piersf commented 3 years ago

@ikben what do you mean?

rafalwrzeszcz commented 3 years ago

@ikben It's not stated (probably documentation not updated) but you can import existing stack set. There is however other big limitation: https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudformation/blob/master/aws-cloudformation-stackset/src/main/java/software/amazon/cloudformation/stackset/util/Validator.java#L20 you can not deploy StackSet with nesteed stacks with this solution.

I created an issue for that https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudformation/issues/16

benbridts commented 3 years ago

Sorry, I forgot a word. The current resources do not allow you to create a Stack Instance in an existing Stack Set.

Or in other words: You cannot create the StackSet in one template/stack and have another template/stack create a StackInstance in that StackSet.

You would run into this if you want to deploy from an account-centric standpoint instead of a stack-set-centric one. In the account-centric approach, you could have one stack per account, that registers a Stack Instance in all the relevant Stack Sets (which allows you to determine the order of the StackSets)