Closed
Conversation
Generates something that looks like this for all resources:
```ts
interface ICfnResource {
readonly attrName: string; // { Ref }, i.e. the primaryIdentifier
readonly attrArn: string; // { Fn::GetAtt }, if applicable
}
```
In a separate PR, we will update all `CfnResource`s to extend
`ICfnResource`, and then later on, update some `Resource`s to extend
`ICfnResource` as well.
**This PR targets `conroy/generate` as a horribly named branch off of
`main` which will house all pieces of this puzzle before unleashing onto
`main`.**
----
*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*
---------
Co-authored-by: Momo Kornher <kornherm@amazon.co.uk>
We've decided that `ICfnResource` should extend `IConstruct`. In addition, I've changed the linter error to correctly reference where `IConstruct` is coming from. I'll keep it a mystery as to whether I realized beforehand or tried to extend `core.IConstruct` first. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Introducing two new rules, and immediately accepting all current violations. - `resource-interface-extends-resource-ref` - all resources interfaces like `IBucket` must also implement the reference interface, e.g. `ICfnBucket` - `ref-via-ref-interface` - all APIs should accept the reference interface `ICfnBucket` over the resource interface `IBucket` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR implements the following:
- If all `primaryIdentifiers` are `attributes`, there is nothing to do;
`ICfnResource` is already implemented by `Resource`
- if all `primaryIdentifiers` are `properties`, then
- if there is 1 `primaryIdentifier` initialize it as `this.attrId =
this.ref;`
- if there are multiple `primaryIdentifiers` initialize each as
`this.attrId = cdk.Fn.select(0, cdk.Fn.split('|', this.ref));` and so on
----
*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*
---------
Co-authored-by: Momo Kornher <kornherm@amazon.co.uk>
…28179) They should all be required. Anything returned from `ref` will exist, even if the property itself is not required. For example, `CfnBucket.attrBucketName` is not required in the resource spec because you can either specify a bucket name or have one generated for you. However, when accessing it via `ref`, the bucket name will certainly exist, so it is not optional. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
aws-cdk-automation
previously requested changes
Nov 29, 2023
Collaborator
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
This is a best-effort migration of `IBucket` usage in aws-cdk-lib to `ICfnBucket`. In places where we rely on a property specific to `IBucket`, we use `Bucket.fromCfnBucket(iCfnBucket)` to generate an `IBucket` to use. ---- <img width="285" alt="image" src="https://github.com/aws/aws-cdk/assets/36202692/7a86396b-8193-4df6-a145-c5d5126dc8f1"> ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Migrate inputs of `IQueue` to `ICfnQueue` wherever possible. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This was referenced Jul 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft PR to run PR build.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license