terraform apply throws this message
Error: Error launching source instance: MissingInput: No subnets found for the default VPC ‘vpc-bdfd5adb’. Please specify a subnet.
status code: 400, request id: 535462ba-b5d9-4517-a980-357cb07a941a
# Terraform Settings Block
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
#version = "~> 3.21" # Optional but recommended in production
}
}
}
# Provider Block
provider "aws" {
profile = "default" # AWS Credentials Profile configured on your local desktop terminal $HOME/.aws/credentials
region="us-west-1"
}
# Resource Block
resource "aws_instance" "ec2demo" {
ami = "ami-055fb0e8f77b0b6bd" # Amazon Linux in us-east-1, update as per your region
instance_type = "t2.micro"
}