-
-
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.
Added fix for issue when no private subnets are defined (#47)
* Added fix for issue when no private subnets are defined * Minor readme
- Loading branch information
1 parent
d19812d
commit 3a32881
Showing
9 changed files
with
157 additions
and
26 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Issue 44 - VPC | ||
============== | ||
|
||
Configuration in this directory creates set of VPC resources to cover issues reported on GitHub: | ||
|
||
* https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/44 | ||
|
||
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. |
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,27 @@ | ||
# List of AZs and private subnets are not of equal length | ||
# | ||
# This example creates resources which are not present in all AZs. | ||
# This should be seldomly needed from architectural point of view, | ||
# and it can also lead this module to some edge cases. | ||
# | ||
# Github issue: https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/44 | ||
module "vpc" { | ||
source = "../../" | ||
|
||
name = "asymmetrical" | ||
|
||
cidr = "10.0.0.0/16" | ||
|
||
azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] | ||
private_subnets = ["10.0.1.0/24"] | ||
public_subnets = ["10.0.101.0/24", "10.0.102.0/24"] | ||
database_subnets = ["10.0.21.0/24", "10.0.22.0/24", "10.0.23.0/24"] | ||
|
||
create_database_subnet_group = true | ||
enable_nat_gateway = true | ||
|
||
tags = { | ||
Issue = "44" | ||
Name = "asymmetrical" | ||
} | ||
} |
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,32 @@ | ||
# VPC | ||
output "vpc_id" { | ||
description = "The ID of the VPC" | ||
value = "${module.vpc.vpc_id}" | ||
} | ||
|
||
# Subnets | ||
output "private_subnets" { | ||
description = "List of IDs of private subnets" | ||
value = ["${module.vpc.private_subnets}"] | ||
} | ||
|
||
output "public_subnets" { | ||
description = "List of IDs of public subnets" | ||
value = ["${module.vpc.public_subnets}"] | ||
} | ||
|
||
output "database_subnets" { | ||
description = "List of IDs of database subnets" | ||
value = ["${module.vpc.database_subnets}"] | ||
} | ||
|
||
output "elasticache_subnets" { | ||
description = "List of IDs of elasticache subnets" | ||
value = ["${module.vpc.elasticache_subnets}"] | ||
} | ||
|
||
# NAT gateways | ||
output "nat_public_ips" { | ||
description = "List of public Elastic IPs created for AWS NAT Gateway" | ||
value = ["${module.vpc.nat_public_ips}"] | ||
} |
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,19 @@ | ||
Issue 46 - VPC | ||
============== | ||
|
||
Configuration in this directory creates set of VPC resources to cover issues reported on GitHub: | ||
|
||
* https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/46 | ||
|
||
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. |
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,25 @@ | ||
# There are no private subnets in this VPC setup. | ||
# | ||
# Github issue: https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/46 | ||
module "vpc" { | ||
source = "../../" | ||
|
||
name = "no-private-subnets" | ||
|
||
cidr = "10.0.0.0/16" | ||
|
||
azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] | ||
public_subnets = ["10.0.0.0/22", "10.0.4.0/22", "10.0.8.0/22"] | ||
private_subnets = [] | ||
database_subnets = ["10.0.128.0/24", "10.0.129.0/24"] | ||
elasticache_subnets = ["10.0.131.0/24", "10.0.132.0/24", "10.0.133.0/24"] | ||
|
||
enable_dns_support = true | ||
enable_dns_hostnames = true | ||
enable_nat_gateway = false | ||
|
||
tags = { | ||
Issue = "46" | ||
Name = "no-private-subnets" | ||
} | ||
} |
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,32 @@ | ||
# VPC | ||
output "vpc_id" { | ||
description = "The ID of the VPC" | ||
value = "${module.vpc.vpc_id}" | ||
} | ||
|
||
# Subnets | ||
output "private_subnets" { | ||
description = "List of IDs of private subnets" | ||
value = ["${module.vpc.private_subnets}"] | ||
} | ||
|
||
output "public_subnets" { | ||
description = "List of IDs of public subnets" | ||
value = ["${module.vpc.public_subnets}"] | ||
} | ||
|
||
output "database_subnets" { | ||
description = "List of IDs of database subnets" | ||
value = ["${module.vpc.database_subnets}"] | ||
} | ||
|
||
output "elasticache_subnets" { | ||
description = "List of IDs of elasticache subnets" | ||
value = ["${module.vpc.elasticache_subnets}"] | ||
} | ||
|
||
# NAT gateways | ||
output "nat_public_ips" { | ||
description = "List of public Elastic IPs created for AWS NAT Gateway" | ||
value = ["${module.vpc.nat_public_ips}"] | ||
} |
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