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 回答
0
已接受的回答

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
专家
已回答 1 年前
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
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则