Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-vpc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Terraform Modules
terraform-aws-vpc
Commits
d19812dd
Unverified
Commit
d19812dd
authored
Dec 11, 2017
by
Anton Babenko
Committed by
GitHub
Dec 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing edge case when VPC is not symmetrical with few private subnets (#45)
parent
1f0e4fb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
main.tf
examples/complete-vpc/main.tf
+26
-0
main.tf
main.tf
+1
-1
No files found.
examples/complete-vpc/main.tf
View file @
d19812dd
...
...
@@ -26,5 +26,31 @@ module "vpc" {
tags
=
{
Owner
=
"user"
Environment
=
"staging"
Name
=
"complete"
}
}
# 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.
module
"not_symmetrical_vpc"
{
source
=
"../../"
name
=
"not-symmetrical-example"
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
=
{
Terraform
=
"true"
Environment
=
"dev"
Name
=
"not-symmetrical"
}
}
main.tf
View file @
d19812dd
...
...
@@ -186,7 +186,7 @@ resource "aws_nat_gateway" "this" {
}
resource
"aws_route"
"private_nat_gateway"
{
count
=
"
${
var
.
enable_nat_gateway
?
length
(
var
.
az
s
)
:
0
}
"
count
=
"
${
var
.
enable_nat_gateway
?
length
(
var
.
private_subnet
s
)
:
0
}
"
route_table_id
=
"
${
element
(
aws_route_table
.
private
.
*
.
id
,
count
.
index
)
}
"
destination_cidr_block
=
"0.0.0.0/0"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment