This repository creates a VPC, IGW, public and private subnets and route tables.
The following will be created:
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
.
Name | Version |
---|---|
aws | 4.10.0 |
Name | Version |
---|---|
aws | 4.10.0 |
Name | Source | Version |
---|---|---|
remote-state-s3-backend | nozaq/remote-state-s3-backend/aws | 1.2.0 |
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 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
availability_zones | n/a | list(string) |
[ |
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 |
Name | Description |
---|---|
dynamodb_table | n/a |
kms_key | n/a |
state_bucket | n/a |