cdk-eks-blueprints icon indicating copy to clipboard operation
cdk-eks-blueprints copied to clipboard

EMR on EKS AddOn: failed to create the service-linked role due to the name conflict

Open sambaiz opened this issue 2 years ago • 1 comments

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.

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.

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

sambaiz avatar Oct 26 '23 07:10 sambaiz

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

shapirov103 avatar Oct 26 '23 13:10 shapirov103