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

Implement Physical Names throughout the library #2283

Closed
1 task
eladb opened this issue Apr 15, 2019 · 2 comments
Closed
1 task

Implement Physical Names throughout the library #2283

eladb opened this issue Apr 15, 2019 · 2 comments
Assignees
Labels
effort/large Large work item – several weeks of effort package/awscl Cross-cutting issues related to the AWS Construct Library

Comments

@eladb
Copy link
Contributor

eladb commented Apr 15, 2019

Requirements:

  • If a resource is provided a physical name upon creation, its attributes should not be intrinsic functions (should be resolved during synthesis and not during deployment).

  • It should be possible to request that a physical name will be allocated for the resource without explicitly specifying the name (e.g. autoName: true)

  • When we create a sub-resource for a customer implicitly (popular example: IAM Roles), and the parent resource is used in a way that forces the sub-resource to have a physical name (i.e., in a cross-environment manner), we should automatically assign a physical name to that sub-resource.

  • Automatically add a CDK/CFN metadata key “aws:cdk:physical-name” to annotate if physical name is available.

  • This resolved ARN/name version should be returned when invoking XxxArn and maybe we should also include a property that can be used to ensure that the result is static (e.g. “staticFunctionArn”).

Idea: use ResourceName as a the prop type for physical names.

interface BucketProps {
  /**
   * @default byCloudFormation
   */
  bucketName?: ResourceName;
}

new Bucket(this, 'foo', {
  bucketName: ResourceName.byCloudFormation()
  bucketName: ResourceName.byFramework()
  bucketName: ResourceName.userDefined('')
});

Also, see #1829 for initial discussion.


  • Add relevant API to cdk.IResource
@eladb eladb added package/awscl Cross-cutting issues related to the AWS Construct Library effort/large Large work item – several weeks of effort labels Apr 15, 2019
@eladb
Copy link
Contributor Author

eladb commented Apr 18, 2019

@skinny85 can you please add the AWS Construct Library guideline section for this with the finalized solution. This will give us a clear picture of the eventual implications on construct authors?

@eladb eladb added package/awscl Cross-cutting issues related to the AWS Construct Library and removed package/awscl Cross-cutting issues related to the AWS Construct Library labels May 1, 2019
@eladb eladb changed the title Guidelines implementation: Physical Names Implement Physical Names throughout the library May 18, 2019
@skinny85
Copy link
Contributor

Done! 🎉

@skinny85 skinny85 closed this as completed Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/large Large work item – several weeks of effort package/awscl Cross-cutting issues related to the AWS Construct Library
Projects
None yet
Development

No branches or pull requests

2 participants