Hi All,
New to terraform ..have been trying to create a EC2 instance that failed with below error message.Would appreciate any guidance
Error: Error applying plan:
1 error(s) occurred:
* aws_instance.GAL_server: 1 error(s) occurred:
* aws_instance.GAL_server: Error launching source instance: VPCIdNotSpecified: No default VPC for this user
status code: 400, request id: 9aa484a8-817f-4c4e-b712-da37097a93f1
The apply command created a new VPC and subnets, but unable to associate the instance.
Tried to add the VPC id but no luck ...
c:\terraform\galinfra>terraform plan
Error: aws_instance.GAL_server: : invalid or unknown key: vpc_id
resource "aws_instance" "GAL_server" {
ami = "ami-08935252a36e25f85"
instance_type = "t2.micro"
vpc_id = "${aws_vpc.My_VPC.id}"
tags = {
Name = "Testinstance"
}
}