I am trying to lunch EC2 instance by using Terraform and I am getting the following error:
Error launching source instance: UnauthorizedOperation: You are not authorized to perform this operation.
I have applied AdministratorAccess policy to my IAM account so I guess there should not be IAM restriction issue.
Also I have MFA enabled for my account, but I am using STS token and the API calls are being accepted from Amazon so this should not be the issue as well.
The Terraform code that I am using is so simple:
provider "aws"{
region="us-east-1"
}
resource "aws_instance" "web" {
ami = "ami-00d4e9ff62bc40e03"
instance_type = "t2.micro"
tags = {
Name = "HelloWorld"
}
}
Please could you assist me as I tired so many things, but I didn't manage to solve the issue. Thanks ahead in time!