Skip to content

Commit

Permalink
Create default VPC and subnet
Browse files Browse the repository at this point in the history
Addressed VPCIdNotSpecified error mentioned in sidpalas#7
tzujui authored Aug 21, 2024
1 parent 9949d31 commit feebca5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion 02-overview/main.tf
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
version = "~> 4.0"
}
}
}
@@ -11,6 +11,22 @@ provider "aws" {
region = "us-east-1"
}

resource "aws_default_vpc" "default" {
force_destroy = true
tags = {
Name = "Default VPC"
}
}

resource "aws_default_subnet" "default_az1" {
availability_zone = "us-east-1a"
force_destroy = true

tags = {
Name = "Default subnet for us-east-1a"
}
}

resource "aws_instance" "example" {
ami = "ami-011899242bb902164" # Ubuntu 20.04 LTS // us-east-1
instance_type = "t2.micro"

0 comments on commit feebca5

Please sign in to comment.