-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(iam): IEncryptedResource extends IEnvironmentAware instead of IResource
#36787
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
fix(iam): IEncryptedResource extends IEnvironmentAware instead of IResource
#36787
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)
IEncryptedResource extends IEnvironmentAware instead of IResource
IEncryptedResource extends IEnvironmentAware instead of IResourceIEncryptedResource extends IEnvironmentAware instead of IResource
IEncryptedResource extends IEnvironmentAware instead of IResourceIEncryptedResource extends IEnvironmentAware instead of IResource
BREAKING CHANGE: `IEncryptedResource` now extends `IEnvironmentAware` instead of `cdk.IResource`. The `GrantableResources.isEncryptedResource()` method now requires an `IEnvironmentAware` parameter instead of `IConstruct`.
1f0f1eb to
4ef156b
Compare
IEncryptedResource extends IEnvironmentAware instead of IResourceIEncryptedResource extends IEnvironmentAware instead of IResource
IEncryptedResource extends IEnvironmentAware instead of IResourceIEncryptedResource extends IEnvironmentAware instead of IResource
IEncryptedResource extends IEnvironmentAware instead of IResourceIEncryptedResource extends IEnvironmentAware instead of IResource
IEncryptedResource extends IEnvironmentAware instead of IResourceIEncryptedResource extends IEnvironmentAware instead of IResource
✅ 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). |
Merge Queue Status✅ The pull request has been merged at 4ef156b This pull request spent 7 seconds in the queue, with no time running CI. Required conditions to merge
|
|
Comments on closed issues and PRs are hard for our team to see. |
Reason for this change
The
IEncryptedResourceinterface currently extendsIResource, which requires implementations to be full CDK resources. By changing it to extendIEnvironmentAwareinstead, we allow for more flexible implementations that only need environment information to function correctly with encryption grants.This change also aligns the
GrantableResources.isEncryptedResource()type guard to acceptIEnvironmentAwareinstead ofIConstruct, making the API more consistent with the interface it guards.Today, all AWS vended constructs that implement
IEncryptedResourcealready implementIResourcedirectly.Description of changes
IEncryptedResourceto extendIEnvironmentAwareinstead ofcdk.IResourceGrantableResources.isEncryptedResource()parameter type fromIConstructtoIEnvironmentAware[awslint:interface-extends-ref]directive as it's no longer applicableBREAKING CHANGE: Receivers of
IEncryptedResourceobjects now have fewer guarantees about the shape of the object. If you still require anIResource, change the type toIEncryptedResource & IResourceand/or add a type guard check usingResource.isResource(). Implementations ofIEncryptedResourceno longer need to implementIResourcebut must continue to implementIEnvironmentAware. SinceIResourceextendsIEnvironmentAware, there is no change for implementors. Calls toGrantableResources.isEncryptedResource()now require anIEnvironmentAwareargument instead ofIConstruct.Describe any new or updated permissions being added
N/A
Description of how you validated changes
N/A
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license