AWS re:Post을(를) 사용하면 다음에 동의하게 됩니다. AWS re:Post 이용 약관

Getting error in adding role policy to service linked role

0

resource "aws_iam_service_linked_role" "AWSServiceRoleForLexV2" { aws_service_name = "lexv2.amazonaws.com" tags = local.common_tags }

resource "aws_iam_role_policy" "lex2_policy" { name = "backend_bot_lex2_policy" role = aws_iam_service_linked_role.AWSServiceRoleForLexV2.id policy = jsonencode({ "Version" : "2012-10-17", "Statement" : [ { "Effect" : "Allow", "Action" : "logs:CreateLogGroup", "Resource" : "arn:aws:logs:eu-west-2:${var.aws_accountId}:" }, { "Effect" : "Allow", "Action" : [ "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource" : [ "arn:aws:logs:eu-west-2:${var.aws_accountId}:log-group:" ] } ] }) }

Error Error putting IAM role policy backend_bot_lex2_policy: ValidationError: The specified value for roleName is invalid. It must contain only alphanumeric characters and/or the following: +=,.@_- │ status code: 400,

질문됨 3년 전1.7천회 조회
1개 답변
0

In resource "aws_iam_role_policy", you should place .name instead of .id for the role: aws_iam_service_linked_role.AWSServiceRoleForLexV2**.name**.

However, note that you can't modify an Amazon Lex V2 service-linked role (only the description can be updated). Check this document for more info: https://docs.aws.amazon.com/lexv2/latest/dg/using-service-linked-roles.html

profile picture
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠