I’m getting an “UnauthorizedOperation” error when launching an EC2 instance using Terraform. I have applied the AdministratorAccess policy to my IAM account and I’m using a STS token with MFA enabled, so I don’t think this is an IAM restriction issue. The Terraform code I’m using is below:
provider "aws"{
region="us-east-1"
}
resource "aws_instance" "web" {
ami = "ami-00d4e9ff62bc40e03"
instance_type = "t2.micro"
tags = {
Name = "HelloWorld"
}
}
Can you please help me troubleshoot this issue?