-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StackSets Support #66
Comments
Yes, I have global applications that I need to deploy the same infrastructure in multiple regions. Using stacksets the CF templates need to use ${AWS::Region} and ${AWS::AccountId} variables to set the right values for each region/account. Looking at the Synth'd CF templates from CDK there are no variables like this. My suggestion is to use variable everywhere possible so we can support multiple regions and accounts, and StackSets. At this point I don't think I can use CDK for global applications with StackSets because of this limitation. |
I built something like CDK in the past and to get it to work with StackSets I had to copy Lambda code to a bucket in each region. This is because Lambda wants the code in the same region. I'd assume we'll need to do something similar for CDK to support StackSets. |
still relevant |
Currently, I am trying to switch from The issue is as following:
I can get away if I use lower level construct are there any workarounds you guys recommend? at least until it is natively supported. |
I believe that when we implement aws/aws-cdk#3437 and asset locations will be hard-coded (without parameters), this will be enabled. |
Had a customer today ask about stackset support. Is aws/aws-cdk#3437 still the going solution? |
Any update on this ? since aws/aws-cdk#3437 is merged ? |
Any news? |
Any update on this ? |
It would be good to see some progress on this |
@eladb Do you have any update? 🙏 We would love to use AWS CDK in combination with AWS Org. and CloudFormation StackSets. |
Do we know what actually needs to be done to implement this? Would love to be able to deploy multiple instances from a single place. Happy to help however I can to make this happen. |
I would also love to be able to deploy stacksets via CDK. The issue we had is that some teams wanted to use CDK to create their Cloudformation but stacksets are not currently supported. The way we got around this was to make the a cloudformation template via From what issues I saw, CDK needs to be able to do the following:
Maybe there is a better way, I'm open to suggestions :) |
We also have 2 OU and each has its own sandbox. I hope cdk can support stacksets too~~ |
Also critical for my team, anyone using Control Tower for large orgs needs this. |
@dejonghe can you please describe your use case in more detail? In what way do you wish to use stack sets? You can technically define a CDK stack, synth a template and deploy it through StackSets. What additional support would you expect from the CDK for this scenario? |
I guess that routes seems like it would fit. |
👀 |
@eladb I would have to agree with @dejonghe. Between CloudFormation, AWS CDK, and AWS SAM, the ProServe team definitely get a ton of questions from our customers surrounding the variations in tooling and lack of (full) integration. Control Tower and StackSets are the best option we have for easily deploying and maintaining services that need to exist within every account; a common pattern for the enterprise where operational resources are centrally managed. CDK has the potential to be the go-to tool. I know I'm a fan. But, we definitely need to solve for "deployment at scale" whether that means integrating with StackSets or a separate mechanism. Either way, it would be great if we can avoid context switching (different tools) to get the job done. |
Hi @paul-ge , I'm afraid not. These are fundamentally different ideas. The doc you shared provides an example of multiple CDK stacks which makes it easy to modularize code, but still deploys to a single account. What we're discussing is deployment across all accounts by leveraging managed StackSets in CloudFormation. |
Is anyone working on that? I'd like to have a StackSet constructs which accepts a Stack property as input. But I'm running into issues during synth, as the "StackSetStack" requires the output of the other stack which will be written only at the end of the synth. |
I have just stumbled on this with StackSets and the CDK, but I assume one of the bigger issues would be the assets CDK provisions in S3 and lambda for Custom Resources and similar applications? |
As a customer working closely with an AWS ProServ team, I am very interested in more support for StackSets with CDK. We currently manage many StackSets across multiple AWS Control Tower environments using custom tooling wrapped around CDK. I recently used the pattern suggested by @redbaron leveraging CfnStackSet and it got me very excited! I would love to see more CDK support for StackSets, including the ability to import existing StackSets into CfnStackSet or the L2 equivalent. |
This works for resources that don't require assets but not for resources like Lambda which require Asset Parameters to work. Is it possible to deploy the assets along with the |
Same as above. I work deploying CDK (Java version) as an enterprise stack. Having issues with conflicts from StackSet created resources and CDK created resources. Things like AWS Config recorders information, VPC ARN and Stackset deployed IAM roles end up being manually entered into CDK which is not really the point of programatically deploying your stacks. Interested in being kept up to date with any progress. |
This approach seems to be broken since version 1.102.0. It now tries to deploy the staged stack also resulting in unwanted extra resources being deployed. |
UPDATE: Seems to be related to aws/aws-cdk#14379 Was this the intended behavior @otaviomacedo ? |
Yes, I noticed. Thank you. |
@RaeesBhatti it is possible to publish the assets in the account where you deploy the stacksets using cdk-assets: You will have to make sure that the rest of the accounts can access the assets in the S3 bucket by updating the bootstrapping template. |
Thanks for the suggestion @robertjan-b . I'll try that |
The way to create the stackset stack looks a lot cleaner using the following method: aws/aws-cdk#11896 |
@RaeesBhatti, did you manage to make it work with the assets? Looking forward to your findings! |
It seems StackSets is kinda broken in CDKv2. It tries to resolve the
|
@tvb do you mind opening us an issue in the main CDK repository (https://github.com/aws/aws-cdk/issues/new/choose), showing your code, and the exact command you execute, and the full error that you get? |
Using StackSets to deploy CDK stacks across accounts/OUs in an organization would be helpful for customers who need to ensure certain resources are present in every account to meet compliance requirements. For large organizations, it also obviates the need to automate CDK bootstrapping every account as part of a CDK Pipelines deployment. For additional security, I believe CDK should refuse (at least warn) to bootstrap StackSets in the Organizations management account, instead requiring that the bootstrap environment exist in a StackSets delegated administrator. In the meantime, one way my team gets StackSet support from CDK (in addition to previous suggestions) is to write the synthesized template to the CDK assets S3 bucket: const stackTemplateAsset = new assets.Asset(
this,
`${stackClass.name}TemplateAsset`,
{
path: stackTemplatePath,
}
);
|
Is this RFC still moving forward? |
There seems to be some movement for ServiceCatalog Products. They support now assets. I'm working on a similar solution for StackSets here: https://github.com/pgarbe/cdk-stackset |
Do you really need StackSets if you have waves? what is the use case? const subAccountLevelWave = pipeline.addWave('subAccountLevelWave')
subAccountLevelENVs.forEach(env => {
subAccountLevelWave.addStage(new AccountLevelStage(this, `level-${env.region}-in-${env.account}`, {
env
}))
}) |
Use case: ensure that any account added to an organization has a CDK bootstrap template applied so that it can be included in a pipeline wave. Manage that template using CDK. |
As long as you do not use Assets in your ProductStack this works pretty neat:
|
Ayy, awesome to see something semi official! I wonder if the asset work from @pgarbe's repo (https://github.com/pgarbe/cdk-stackset) couldn't be carried over to partially address cdklabs/cdk-stacksets#58 |
Closing this RFC in favor of https://github.com/cdklabs/cdk-stacksets/. Please move the relevant conversation to that repo. |
Are there any plans to move the construct from https://github.com/cdklabs/cdk-stacksets/ to the main AWS CDK repository at https://github.com/aws/aws-cdk? It's not entirely clear to me what the different governance model and lifecycle is for code in these two different GitHub organizations. To me it seems like Could you provide any insights on this? |
Description
Allow users to define a template through AWS CDK constructs and deploy as a Self-Managed CloudFormation StackSet.
cdk deploy
it would create a stack set if it does not exist or update an existing stack set + existing stack set instances.Proposed Scope:
Out of Scope for v1 (May be iteratively added in future):
Roles
Workflow
status/proposed
)#aws-cdk-rfcs if needed)
status/review
)api-approved
applied to pull request)status/final-comments-period
)status/approved
)status/planning
)status/implementing
)status/done
)Related: aws/aws-cdk#11896
The text was updated successfully, but these errors were encountered: