AWSServiceRoleForAmazonOpenSearchService has been taken in this account

0

Hi, i'm trying to run the next command from Cloud9 env, and it's getting an issue: $ aws iam create-service-linked-role --aws-service-name opensearchservice.amazonaws.com

An error occurred (InvalidInput) when calling the CreateServiceLinkedRole operation: Service role name AWSServiceRoleForAmazonOpenSearchService has been taken in this account, please try a different suffix.

i've tried to unset the credentials variables and export too again, but the issue continues or how to know which services this account has taken? (with some CLI command), thanks

2 Answers
0
Accepted Answer

Looking at the contents of the command, it appears to be an error that occurs when there is already a service linkroll for opensearchservice.amazonaws.com.
Since IAM roles cannot be created with the same name, try adding a custom prefix using the "--custom-suffix" command option.
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/create-service-linked-role.html

profile picture
EXPERT
answered a year ago
0

This error indicates that the role is already there. You may want to look in IAM and look for the role. There can only be one ServiceLinked role with that name per account. You can learn more at https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html

Hope this helps!

profile picture
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions