EMR on EKS addons try creating service-linked role but it failed if it already exists.
Expected Behavior
Deploy successfully even if the service-linked role already exists.
Current Behavior
If the service-linked role is already created, errors occur as following in an EMR on EKS addon.
Resource handler returned message: "Service role name AWSServiceRoleForAmazonEMRContainers has been taken in this account, please try a different suffix.
Reproduction Steps
After creating the service-linked role by blueprints or other ways, deploy a new blueprint with the EMR on EKS addons.
Possible Solution
Skip creating the service-linked role.
AWS Batch AddOn tries checking if a service-linked role exists before creatring it, but it won't work well because Role.fromName() doesn't check the existance.
Generally, it would be difficult to create only non-existed resources in CDK.
Anyway, service-linked roles are shared resources, so I think it should not be created by blueprints.
@youngjeong46 looks like the SLR is using a unique name and the uniqueness check fails. Please advise if there is a workaround at present and looking for the path forward to address.
Describe the bug
EMR on EKS addons try creating service-linked role but it failed if it already exists.
Expected Behavior
Deploy successfully even if the service-linked role already exists.
Current Behavior
If the service-linked role is already created, errors occur as following in an EMR on EKS addon.
Reproduction Steps
After creating the service-linked role by blueprints or other ways, deploy a new blueprint with the EMR on EKS addons.
Possible Solution
Skip creating the service-linked role.
AWS Batch AddOn tries checking if a service-linked role exists before creatring it, but it won't work well because Role.fromName() doesn't check the existance. Generally, it would be difficult to create only non-existed resources in CDK.
Anyway, service-linked roles are shared resources, so I think it should not be created by blueprints.
Additional Information/Context
No response
CDK CLI Version
2.99.1
EKS Blueprints Version
1.12.0
Node.js Version
v18.16.1
Environment details (OS name and version, etc.)
macOS 12.4
Other information
No response