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,