fix: ensure the admin role stabilizes for self-managed stacksets#678
fix: ensure the admin role stabilizes for self-managed stacksets#678martinjlowm wants to merge 2 commits into
Conversation
kaizencc
left a comment
There was a problem hiding this comment.
Hi @martinjlowm I agree that this is the correct way to approach the issue. Can you add a unit test to be safe? I can't accept this without some sort of testing change. If you really cannot, I will add this to my list of things to do but that may incur a delay :)
The unit test can be super simple kind of like this:
|
AFAIK, it's not typical for a CDK resource to modify an existing role by adding a policy, which is what the current code does. That's why this proposed fix made it conditional on whether the role is new or existing. |
Head branch was pushed to by a user without write access
|
@kaizencc - a month later and here we go. I hope checking |
|
Any updates on this?
Also in relation to this it would be great if it was also possible to conditionally skip adding a policy to the role if it's a pre-created one. This is due to us preferably wanting to use a predefined role that is used to multiple StackSets which will potentially run into hitting the limit of 10 attached policies. Not sure what the best way to handle this would be but could imagine just having an optional flag sent into Such as |
Looks like #439 tackles the same problem, however, I think
DependsOnis sufficient and is typically what is used inaws-cdk-lib, e.g. https://github.com/aws/aws-cdk/blob/0546ec24c5fa60cae41c6561d7178de7a403a713/packages/%40aws-cdk/aws-kinesisanalytics-flink-alpha/lib/application.ts#L1030For anyone looking for a workaround with the current release, you can add the dependency like so:
fixes #438, supersedes #439