-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* IPv6 support Add variable "enable_ipv6" to allow enabling IPv6 support (resulting in passing "assign_generated_ipv6_cidr_block" to aws_vpc. Enabling IPv6 support further results in an Egress-only internet gateway being provisioned and routing tables of subnets being adjusted. Additional variables allow to choose the indices out of the /64 subnets based on the assigned /56 range. * Add example for IPv6 usage * Remove redundant parameter assign_generated_ipv6_cidr_block This is needed exactly when var.enable_ipv6 is true. * Set subnet ipv6_cidr_block to null if unused * Be picky about spelling * Revert unrelated change * More IPv6 spelling * Added IPv6 support to VPC module * Added IPv6 support to VPC module
- Loading branch information
1 parent
40821bb
commit be962ae
Showing
10 changed files
with
324 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# VPC with IPv6 enabled | ||
|
||
Configuration in this directory creates set of VPC resources with IPv6 enabled on VPC and subnets. | ||
|
||
## Usage | ||
|
||
To run this example you need to execute: | ||
|
||
```bash | ||
$ terraform init | ||
$ terraform plan | ||
$ terraform apply | ||
``` | ||
|
||
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources. | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| ipv6\_association\_id | The IPv6 CIDR block | | ||
| ipv6\_cidr\_block | The association ID for the IPv6 CIDR block | | ||
| vpc\_id | The ID of the VPC | | ||
|
||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
provider "aws" { | ||
region = "eu-west-1" | ||
} | ||
|
||
data "aws_availability_zones" "available" {} | ||
|
||
module "vpc" { | ||
source = "../.." | ||
|
||
name = "ipv6" | ||
|
||
cidr = "10.0.0.0/16" | ||
|
||
azs = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] | ||
private_subnets = ["10.0.1.0/24", "10.0.2.0/24"] | ||
public_subnets = ["10.0.101.0/24", "10.0.102.0/24"] | ||
database_subnets = ["10.0.103.0/24", "10.0.104.0/24"] | ||
|
||
enable_nat_gateway = false | ||
|
||
create_database_subnet_route_table = true | ||
create_database_internet_gateway_route = true | ||
|
||
enable_ipv6 = true | ||
assign_ipv6_address_on_creation = true | ||
|
||
private_subnet_assign_ipv6_address_on_creation = false | ||
|
||
public_subnet_ipv6_prefixes = [0, 1] | ||
private_subnet_ipv6_prefixes = [2, 3] | ||
database_subnet_ipv6_prefixes = [4, 5] | ||
|
||
tags = { | ||
Owner = "user" | ||
Environment = "dev" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# VPC | ||
output "vpc_id" { | ||
description = "The ID of the VPC" | ||
value = module.vpc.vpc_id | ||
} | ||
|
||
output "ipv6_association_id" { | ||
description = "The IPv6 CIDR block" | ||
value = module.vpc.vpc_ipv6_cidr_block | ||
} | ||
|
||
output "ipv6_cidr_block" { | ||
description = "The association ID for the IPv6 CIDR block" | ||
value = module.vpc.vpc_ipv6_association_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.