title: Terraform simple script says "Error: Error launching source instance: VPCIdNotSpecified: No default VPC for this user"
body: <p>Getting started on Terraform. I am trying to provision an EC2 instance using the following .tf file. I have a default VPC already in my account  in the AZ I am trying to provision the EC2 instance.</p>
  <pre><code># Terraform Settings Block
   terraform {
        required_providers {
           aws = {
               source  = &quot;hashicorp/aws&quot;
               #version = &quot;~&gt; 3.21&quot; # Optional but recommended in production
          }
       }
   }
  
    # Provider Block
    provider &quot;aws&quot; {
          profile = &quot;default&quot;
          region  = &quot;us-east-1&quot;
    }
  
    # Resource Block
    resource &quot;aws_instance&quot; &quot;ec2demo&quot; {
             ami           = &quot;ami-c998b6b2&quot; 
             instance_type = &quot;t2.micro&quot;
    }
  </code></pre>
  <p>I do the following Terraform commands.</p>
  <ol>
  <li>terraform init</li>
  <li>terraform plan</li>
  <li>terraform apply</li>
  </ol>
  <p>aws_instance.ec2demo: Creating...</p>
  <p>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: 04274b8c-9fc2-47c0-8d51-5b627e6cf7cc</p>
  <p>on ec2-instance.tf line 18, in resource &quot;aws_instance&quot; &quot;ec2demo&quot;:
  18: resource &quot;aws_instance&quot; &quot;ec2demo&quot; {</p>