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

Make it easier to explicitly control logical IDs #1594

Closed
eladb opened this issue Jan 22, 2019 · 2 comments · Fixed by #1670
Closed

Make it easier to explicitly control logical IDs #1594

eladb opened this issue Jan 22, 2019 · 2 comments · Fixed by #1670
Assignees
Labels
@aws-cdk/core Related to core CDK functionality effort/small Small work item – less than a day of effort feature-request A feature should be added or improved.

Comments

@eladb
Copy link
Contributor

eladb commented Jan 22, 2019

When users migrate over from an existing CloudFormation deployment, they need control over logical IDs of resources. Our current approach based on renames is convoluted and we should improve the ergonomics.

@eladb
Copy link
Contributor Author

eladb commented Jan 22, 2019

We can make resource.logicalId return a lazy string (token) and then add something like resource.overrideLogicalId('xxx').

When #1595 is implemented, the experience will be:

bucket.cfnresource.overrideLogicalId('MyAwesomeBucket');

@rix0rrr rix0rrr added @aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. labels Jan 22, 2019
eladb pushed a commit that referenced this issue Feb 4, 2019
Allow users to explicitly override the logical ID of a CloudFormation
element (such as "Cfn" resources) by invoking `overrideLogicalId`
on the resource object.

For example:

    const bucket = new s3.CfnBucket(this, 'MyBucket');
    bucket.overrideLogicalId('YourBucket');

The resulting template will use `YourBucket` as the logical ID.

NOTE: the `logicalId` property will now return a stringified token
instead of a concrete value.

Fixes #1594
eladb pushed a commit that referenced this issue Feb 6, 2019
Allow users to explicitly override the logical ID of a CloudFormation
element (such as "Cfn" resources) by invoking `overrideLogicalId`
on the resource object.

For example:

    const bucket = new s3.CfnBucket(this, 'MyBucket');
    bucket.overrideLogicalId('YourBucket');

The resulting template will use `YourBucket` as the logical ID.

NOTE: the `logicalId` property will now return a stringified token
instead of a concrete value.

Fixes #1594
@fulghum fulghum added the effort/small Small work item – less than a day of effort label Feb 11, 2019
@peterb154
Copy link
Contributor

Thank you SOO Much for doing this.. just saved our bacon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality effort/small Small work item – less than a day of effort feature-request A feature should be added or improved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants