2 Answers
- Newest
- Most votes
- Most comments
3
This should do it
resource "aws_iam_role" "role_identifier" {
name = var.role_name
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Sid = ""
Principal = {
Service = "ec2.amazonaws.com"
}
},
]
})
}
0
Hi,
Your policy contains two statements. The first part has Principal but the second part only has the following:
{ Action = "AssumeRole", Effect = "Allow" }
This second part needs to be cleaned up as it looks like it is not required.
answered 6 months ago
Relevant content
- Accepted Answerasked 9 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago