Check if Service Linked Role Already Exists #28981
Unanswered
andreprawira
asked this question in
Q&A
Replies: 1 comment
-
This is not mentioned in the AWS CDK documentation as it's not a native component of the CDK or AWS. upsert-slr is a 3rd party construct of the AWS CDK. Since upsert-slr is MIT and publicly available (https://github.com/tmokmss/upsert-slr/), you could take the code from there and implement this logic yourself - no sense in that - but then you have the same logic and no external dependencies. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a CDK project with several stacks, one of them is going to deploy OpenSearch and it needs "AWSServiceRoleForAmazonOpenSearchService" to exists before the actual resource being deployed.
We deploy this project to many fresh accounts and as a multi region deployment (active active in us-east-1 and ap-northeast-2). Below is our code
So far this code works, but in the future we might be deploying it in regions that are not us-east-1 or ap-northeast-2 and this will break our code, or if the stack deployment is ap-northeast-2 first then us-east-1, this will also break the logic because the role will only be deployed us-east-1 but the stack will deploy OS domain in ap-northeast-2.
The best logic is not to check based on the region, but based on role's existance
However, i dont see this mentioned in AWS CDK docs or other posts, is it possible, or is there another alternative method that will work?
Beta Was this translation helpful? Give feedback.
All reactions