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

(cloudfront): (Replace intanceof Role with Role.isRole method) #24447

Closed
1 of 2 tasks
bun913 opened this issue Mar 3, 2023 · 1 comment · Fixed by #24448
Closed
1 of 2 tasks

(cloudfront): (Replace intanceof Role with Role.isRole method) #24447

bun913 opened this issue Mar 3, 2023 · 1 comment · Fixed by #24448
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront @aws-cdk/pipelines CDK Pipelines library feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@bun913
Copy link
Contributor

bun913 commented Mar 3, 2023

Describe the feature

I create Role.isRole() method at #24340 (#24340 (comment))

But below points use instanceof iam.Role.

if (a.lambdaFunction.role && a.lambdaFunction.role instanceof iam.Role && a.lambdaFunction.role.assumeRolePolicy) {

if (role && role instanceof iam.Role && role.assumeRolePolicy) {

if (role instanceof iam.Role && role.assumeRolePolicy) {

if (action.actionProperties.role instanceof iam.Role) {

Use Case

Since instanceOf is not a product to be used for strict type determination, it is better to replace it.

fyi: https://github.com/aws/aws-cdk/pull/20564/files#diff-fe41afc44afd9acb16980754990f93acb596ed37662296575ea2fbe1c5531b50R203-R206

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.67.0

Environment details (OS name and version, etc.)

macOS Big Sur

@bun913 bun913 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 3, 2023
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Mar 3, 2023
@bun913 bun913 changed the title (pipeline): (Replace intanceof Role with Role.isRole method) (cloudfront): (Replace intanceof Role with Role.isRole method) Mar 3, 2023
@github-actions github-actions bot added the @aws-cdk/aws-cloudfront Related to Amazon CloudFront label Mar 3, 2023
@mergify mergify bot closed this as completed in #24448 Mar 3, 2023
mergify bot pushed a commit that referenced this issue Mar 3, 2023
…24448)

Closes #24447 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

homakk pushed a commit to homakk/aws-cdk that referenced this issue Mar 28, 2023
…ws#24448)

Closes aws#24447 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront @aws-cdk/pipelines CDK Pipelines library feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant