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

Return concrete values for physical names and ARNs if explicitly stated #4093

Closed
eladb opened this issue Sep 16, 2019 · 2 comments
Closed

Return concrete values for physical names and ARNs if explicitly stated #4093

eladb opened this issue Sep 16, 2019 · 2 comments
Assignees
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. package/awscl Cross-cutting issues related to the AWS Construct Library

Comments

@eladb
Copy link
Contributor

eladb commented Sep 16, 2019

🚀 Feature Request

Description

When a user specified an explicit physical name for an AWS resource, the corresponding attributes should also return a concrete name.

For example, if I define a bucket with a bucketName:

const bucket = new s3.Bucket(this, 'MyBucket', { bucketName: 'hello' });

Then, I would expect bucket.bucketName to return hello and not a token that resolves to { "Fn::GetAtt": [ ... ] }

❗️There is a problem: CloudFormation references implicitly indicate that there is a dependency between the consuming resource and the referenced resource. If we return a concrete name (string), this dependency will now be lost forever. Is there anything we can do about it? (@rix0rrr?)

@eladb eladb added package/awscl Cross-cutting issues related to the AWS Construct Library feature-request A feature should be added or improved. labels Sep 16, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 16, 2019

Doesn't/shouldn't this already work today by means of the PhysicalName machinery? As in, if you specify a physicalName, then bucket.bucketName already returns the configured value?

If it doesn't work for some particular resource, it's a bug in the implementation of that resource, rather than the system.

Re: recording the implicit reference: tokens can easily be made to do this, with a little extension on what CfnReference does today. They have all the required information. However, we'd lose the property that bucket.bucketName === "hello", we'd be back to bucket.bucketName === "${Token[Bucket.Ref.123]}", with the difference that in the template that Token would resolve to a literal instead instead of an intrinsic.

Seems good enough to me, but YMMV?

@skinny85
Copy link
Contributor

This is a duplicate of #928 . Same reasons posted there apply here as well.

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. package/awscl Cross-cutting issues related to the AWS Construct Library
Projects
None yet
Development

No branches or pull requests

3 participants