-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws-cdk-lib/aws-route53: Use an existing role for performing DeleteExisting #22607
Comments
I'm looking into this |
Or actually, did you already start working on this @fjinkis ? |
@MrSyn88 No, I just suggested it as a new feature but I didn't start developing anything |
@fjinkis Actually the |
@pahud I find it useful in at least the following two scenarios:
Do these cases make sense to you? |
The request makes sense. All roles should be configurable. |
@fjinkis It makes perfect sense. Looking into the code, the custom resource provider is vended by getOrCreateProvider() which does not support passing existing iam role and it always creates a new role. To make it possible I think we have to first allow getOrCreateProvider() accept a new |
Hi @fjinkis CDK v2.51.0 just introduced a IAM feature that allows you to use existing roles for a CDK stack. check out this doc for more details - https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/aws-iam#customizing-role-creation And check out my sample below: As you can see no new roles will be created by CDK and the existing role will be used instead. I believe this should satisfy your scenario. Please let me know if it works for you. |
Hey @pahud it worked! I'd like to apologize for publishing an issue that was finally supported. Although this request was focus to IAM, if you have a moment and if it's not a big deal, could you share with me some thoughts on any way to use a predefined Lambda to perform the record delation (and not one for each stack)? |
@fjinkis Sounds like you are trying to use a shared predefined lambda function as the single custom resource provider across multiple stacks? I wonder what motivates you for that? To reduce the number of lambda functions? |
Hi @pahud! Yeah, I think that is for a better management and also to reduce the lambda resources which does essentially the same thing |
Gocha! I think current design is pretty optimal as there's only one shared lambda provider per stack. If you define 100 ARecord resources with |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I completely agree with you about that! Probably, since it's a custom resource, we cannot specify what lambda should it use. However, responding to your question, my intention was reducing all those common resources that do the same thing over and over: in this case the lambda provider and IAM role |
|
Describe the feature
When you define a
aws_route53.RecordSet
you can enable the propertydeleteExisting
to remove - or overwrite - a record if it already exists. The "problem" is each stack creates a new IAM Role in order to perform that operation. What I propose is being able to reuse an existing predefined role like we can do with other resources - as Lambda or Launch templates -Lambda snippet
Launch template snippet
Use Case
Proposed Solution
Following the same logic of other resources, it'd be great if we can do something like this:
Other Information
No response
Acknowledgements
CDK version used
2.33.0
Environment details (OS name and version, etc.)
NixOS Porcupine
The text was updated successfully, but these errors were encountered: