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

iam: support Role.fromLookup() method #33602

Open
1 of 2 tasks
go-to-k opened this issue Feb 27, 2025 · 1 comment · May be fixed by #33603
Open
1 of 2 tasks

iam: support Role.fromLookup() method #33602

go-to-k opened this issue Feb 27, 2025 · 1 comment · May be fixed by #33603
Labels
@aws-cdk/aws-iam Related to AWS Identity and Access Management effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@go-to-k
Copy link
Contributor

go-to-k commented Feb 27, 2025

Describe the feature

A generic Context Provider for CloudControl API has been added in aws-cdk-cli.

aws/aws-cdk-cli#138

This allows us to implement new context methods.

Use Case

There will be many cases where IAM roles will be created outside the CFn stack and used.
Importing actual existing roles from AWS accounts is very convenience. It is also useful to be able to make an error if a role does not exist.

Proposed Solution

Add Role.fromLookup method using the new context provider.

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.181.0

Environment details (OS name and version, etc.)

Mac

@go-to-k go-to-k added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 27, 2025
@github-actions github-actions bot added the @aws-cdk/aws-iam Related to AWS Identity and Access Management label Feb 27, 2025
@go-to-k go-to-k changed the title iam: support Role.fromLookup method iam: support Role.fromLookup() method Feb 27, 2025
@go-to-k go-to-k linked a pull request Feb 27, 2025 that will close this issue
1 task
@pahud
Copy link
Contributor

pahud commented Feb 27, 2025

Hello @go-to-k,

Thank you for submitting this feature request. Adding a Role.fromLookup() method to the IAM module would be a valuable addition to the CDK, especially with the new CloudControl API context provider now available.

This type of lookup functionality has proven to be very useful in other CDK modules when working with existing resources, and it makes sense to extend this pattern to IAM roles as well. It aligns well with the CDK's philosophy of making it easier to work with existing AWS resources.

Since you've indicated you may be able to implement this feature, we'd be happy to help guide you through the process.

Thanks again for your contribution to making the CDK better.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-iam Related to AWS Identity and Access Management effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants