Skip to content

rashid4lyf/tf_aws_vpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo VPC, IGW, Public & Private Subnets

This repository creates a VPC, IGW, public and private subnets and route tables.

Architecture

The following will be created:

image

Configuring S3 Backend

This project can be configured to use S3 as a backend to store the state file. In addition a DynamoDB locks table will be created.

To enable S3 first set the varible backend_enabled to true. Then run a terraform innit and terraform apply. Once applied you can now change versions.tf and enable backend support.

terraform {
   backend "s3" {
     bucket         = "ENTER_BUCKET_NAME"
     key            = "terraform_vpc/terraform.tfstate"
     region         = "eu-west-1"
     encrypt        = true
     kms_key_id     = "ENTER_KMS_ID"
     dynamodb_table = "ENTER_DYNAMODB_TABLE_NAME"
   }
   // other terraform configuration
}

These values can be gathered from the outputs from the terraform apply.

Requirements

Name Version
aws 4.10.0

Providers

Name Version
aws 4.10.0

Modules

Name Source Version
remote-state-s3-backend nozaq/remote-state-s3-backend/aws 1.2.0

Resources

Name Type
aws_eip.nat resource
aws_internet_gateway.igw resource
aws_nat_gateway.nat resource
aws_route.private_nat_gateway resource
aws_route.public_internet_gateway resource
aws_route_table.private resource
aws_route_table.public resource
aws_route_table_association.private resource
aws_route_table_association.public resource
aws_security_group.default resource
aws_subnet.private resource
aws_subnet.public resource
aws_vpc.main resource

Inputs

Name Description Type Default Required
availability_zones n/a list(string)
[
"eu-west-1a",
"eu-west-1b",
"eu-west-1c"
]
no
backend_enabled n/a bool false no
cidr_block VPC cidr block. Example: 10.0.0.0/16 string "10.0.0.0/16" no
region AWS Region string "eu-west-1" no
replica_region Region in which S3 bucket to be replicated. string "eu-west-2" no

Outputs

Name Description
dynamodb_table n/a
kms_key n/a
state_bucket n/a

About

Create AWS VPC, IGW, Subnets & Route Tables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages