Skip to content
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

cli: support CloudFormation simplified resource import #28060

Open
1 of 2 tasks
tmokmss opened this issue Nov 18, 2023 · 1 comment · May be fixed by #29087
Open
1 of 2 tasks

cli: support CloudFormation simplified resource import #28060

tmokmss opened this issue Nov 18, 2023 · 1 comment · May be fixed by #29087
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1 package/tools Related to AWS CDK Tools or CLI

Comments

@tmokmss
Copy link
Contributor

tmokmss commented Nov 18, 2023

Describe the feature

On Nov 17 2023, a new feature was announced: AWS CloudFormation simplifies resource import with a new parameter for ChangeSets.

https://aws.amazon.com/about-aws/whats-new/2023/11/aws-cloudformation-import-parameter-changesets/

Summary:

AWS CloudFormation's new ImportExistingResources parameter for CreateChangeSet API automatically imports existing resources in the template during deployments. It identifies resources using custom names, avoiding errors from naming conflicts. This reduces manual effort as a separate resource name document is no longer needed. ImportExistingResources allows importing existing resources and deploying changes in a single ChangeSet.

Use Case

Automatically import exsting resources with the same physical name, such as S3 bucket, DDB table, etc, during a CFn deployment.

Because resource import is a vital feature for CDK users e.g. to refactor a construct tree, it would benefit many potential users if cdk natively support it.

Proposed Solution

This feature introduced a new request parameter ImportExstingResources to the CreateChangeSet API. So I guess we can add a CLI option like --import-exsting-resources: boolean to cdk deploy command to enable the new feature.

The API is called here:

const changeSet = await this.cfn.createChangeSet({
StackName: this.stackName,
ChangeSetName: changeSetName,
ChangeSetType: this.options.resourcesToImport ? 'IMPORT' : this.update ? 'UPDATE' : 'CREATE',
ResourcesToImport: this.options.resourcesToImport,
Description: `CDK Changeset for execution ${this.uuid}`,
ClientToken: `create${this.uuid}`,
...this.commonPrepareOptions(),
}).promise();

Other Information

No response

Acknowledgements

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

CDK version used

2.110.0

Environment details (OS name and version, etc.)

macOS

@tmokmss tmokmss added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 18, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Nov 18, 2023
@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Nov 21, 2023
@github-actions github-actions bot added p1 and removed p2 labels Jan 21, 2024
Copy link

This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
2 participants