cat < vpc.tf provider "aws" { region = "ap-northeast-2" } resource "aws_vpc" "myvpc" { cidr_block = "10.10.0.0/16" enable_dns_support = true enable_dns_hostnames = true tags = { Name = "t101-study" } } resource "aws_subnet" "mysubnet1" { vpc_id = aws_vpc.myvpc.id cidr_block = "10.10.1.0/24" availability_zone = "ap-northeast-2a" tags = { Name = "t101-subnet1" } } resource "aws_subnet" "mysubnet2" { vpc_id = aws_vpc.myvpc.id cidr_block = "10.10.2.0/24" availability_zone = "ap-northeast-2c" tags = { Name = "t101-subnet2" } } resource "aws_internet_gateway" "myigw" { vpc_id = aws_vpc.myvpc.id tags = { Name = "t101-igw" } } resource "aws_route_table" "myrt" { vpc_id = aws_vpc.myvpc.id tags = { Name = "t101-rt" } } resource "aws_route_table_association" "myrtassociation1" { subnet_id = aws_subnet.mysubnet1.id route_table_id = aws_route_table.myrt.id } resource "aws_route_table_association" "myrtassociation2" { subnet_id = aws_subnet.mysubnet2.id route_table_id = aws_route_table.myrt.id } resource "aws_route" "mydefaultroute" { route_table_id = aws_route_table.myrt.id destination_cidr_block = "0.0.0.0/0" gateway_id = aws_internet_gateway.myigw.id } EOT