Terraform newbie here.
I am using the Terraform in Action book here. When I run the terraform apply, I get a VPCIdNotSpecified: No default VPC for this user. GroupName is only supported for EC2-Classic and default VPC error. I have installed both the AWS CLI and configured my AWS credentials using aws configure. My AWS credentials are present in %UserProfile%\.aws\credentials file.
What am I missing?
main.tf
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "helloworld" {
ami = "ami-09dd2e08d601bff67"
instance_type = "t2.micro"
tags = {
Name = "HelloWorld"
}
}
Error stackTrace:
aws_instance.helloworld: Creating...
╷
│ Error: Error launching source instance: VPCIdNotSpecified: No default VPC for this user. GroupName is only supported for EC2-Classic and default VPC.
│ status code: 400, request id: 1e0911db-300b-4c00-aea1-dad588bbe40e
│
│ with aws_instance.helloworld,
│ on main.tf line 4, in resource "aws_instance" "helloworld":
│ 4: resource "aws_instance" "helloworld" {
│