-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(spec2cdk): generate from<Resource>Arn and from<Resource><Prop> in every L1
#35470
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
from<Resource>Arn in every L1from<Resource>Arn and from<Resource><Prop> in every L1
| }); | ||
| }); | ||
|
|
||
| describe('L1 static factory methods', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choosing one representative to test that the generated methods actually return the right thing.
# Conflicts: # tools/@aws-cdk/spec2cdk/lib/cdk/resource-class.ts
- environmentFromArn - storing stackOfScope
# Conflicts: # packages/aws-cdk-lib/package.json # tools/@aws-cdk/spec2cdk/package.json # yarn.lock
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
1 similar comment
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
For every L1 resource, generate a static factory method called
from<Resource>Arn():as well as a
from<Prop>()(where<Prop>is the single field in the primary identifier):Note: If the primary identifier for a given resource type has more than one field, we skip the generation of the factory methods for the corresponding class.
TemplateStringParseris a new class with two static methods (inverses of each other):parse: matches a given ARN template with a concrete ARN string, and returns the values of each variable.interpolate: given an ARN template and a map of variables, returns a string with the variables replaced with their respective values.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license