Reuse Logical IDs of existing serverless framework resources for the L2 Constructs #32957
Labels
@aws-cdk/aws-s3
Related to Amazon S3
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Hoping to prevent CFN from creating a resource that an existing serverless framework stack had already created allowing us to reuse the Logical IDs for new L2 Constructs. This prevents the deletion of the stacks created by Serverless Framework (preventing data loss etc) and prevents CDK having to recreate these stacks.
Use Case
Currently CFN has an issue with the Logical IDs that AWS CDK is generating (the adding of a "8-digit hash"). Allowing CDK to recreate the stacks do work but trying to avoid that as it would be preferred to NOT delete each stack created by Serverless Framework since some stacks create S3 buckets and DynamoDB tables which have data.
Instead, looking for a way to use L2 constructs, similar to what is happening in the below link but without relying on the template JSON file as I am looking to reuse the existing logical ids for new L2 constructs natively:
https://docs.aws.amazon.com/cdk/v1/guide/use_cfn_template.html
Proposed Solution
It is noted that for a workaround I can use an excape hatch to access the node default child in order to interfact with its L1 interface, then use the L1 method overrideLogicalId to change the logical ID, but putting in this feature request for a more native way of being able to reuse the logical IDs.
Other Information
No response
Acknowledgements
CDK version used
v2.175.0
Environment details (OS name and version, etc.)
n/a
The text was updated successfully, but these errors were encountered: