Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-route53
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-route53
Commits
c4d01fc7
Unverified
Commit
c4d01fc7
authored
Feb 14, 2021
by
Nicholas Henry
Committed by
GitHub
Feb 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add support for multiple VPCs when creating private hosted zones (#27)
parent
72f4d3a2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
4 deletions
+38
-4
main.tf
examples/complete/main.tf
+15
-3
outputs.tf
examples/complete/outputs.tf
+17
-0
main.tf
modules/zones/main.tf
+1
-1
outputs.tf
modules/zones/outputs.tf
+5
-0
No files found.
examples/complete/main.tf
View file @
c4d01fc7
...
@@ -22,9 +22,14 @@ module "zones" {
...
@@ -22,9 +22,14 @@ module "zones" {
"private-vpc.terraform-aws-modules-example.com"
=
{
"private-vpc.terraform-aws-modules-example.com"
=
{
comment
=
"private-vpc.terraform-aws-modules-example.com"
comment
=
"private-vpc.terraform-aws-modules-example.com"
vpc
=
{
vpc
=
[
vpc_id
=
module
.
vpc
.
vpc_id
{
}
vpc_id
=
module
.
vpc
.
vpc_id
},
{
vpc_id
=
module
.
vpc2
.
vpc_id
},
]
tags
=
{
tags
=
{
Name
=
"private-vpc.terraform-aws-modules-example.com"
Name
=
"private-vpc.terraform-aws-modules-example.com"
}
}
...
@@ -141,3 +146,10 @@ module "vpc" {
...
@@ -141,3 +146,10 @@ module "vpc" {
name
=
"my-vpc-for-private-route53-zone"
name
=
"my-vpc-for-private-route53-zone"
cidr
=
"10.0.0.0/16"
cidr
=
"10.0.0.0/16"
}
}
module
"vpc2"
{
source
=
"terraform-aws-modules/vpc/aws"
name
=
"my-second-vpc-for-private-route53-zone"
cidr
=
"10.1.0.0/16"
}
examples/complete/outputs.tf
View file @
c4d01fc7
# zones
output
"this_route53_zone_zone_id"
{
description
=
"Zone ID of Route53 zone"
value
=
module
.
zones
.
this_route53_zone_zone_id
}
output
"this_route53_zone_name_servers"
{
description
=
"Name servers of Route53 zone"
value
=
module
.
zones
.
this_route53_zone_name_servers
}
output
"this_route53_zone_name"
{
description
=
"Name of Route53 zone"
value
=
module
.
zones
.
this_route53_zone_name
}
# records
output
"this_route53_record_name"
{
output
"this_route53_record_name"
{
description
=
"The name of the record"
description
=
"The name of the record"
value
=
module
.
records
.
this_route53_record_name
value
=
module
.
records
.
this_route53_record_name
...
...
modules/zones/main.tf
View file @
c4d01fc7
...
@@ -6,7 +6,7 @@ resource "aws_route53_zone" "this" {
...
@@ -6,7 +6,7 @@ resource "aws_route53_zone" "this" {
force_destroy
=
lookup
(
each
.
value
,
"force_destroy"
,
false
)
force_destroy
=
lookup
(
each
.
value
,
"force_destroy"
,
false
)
dynamic
"vpc"
{
dynamic
"vpc"
{
for_each
=
length
(
keys
(
lookup
(
each
.
value
,
"vpc"
,
{}
)))
==
0
?
[]
:
[
lookup
(
each
.
value
,
"vpc"
,
{}
)
]
for_each
=
try
(
tolist
(
lookup
(
each
.
value
,
"vpc"
,
[]
)),
[
lookup
(
each
.
value
,
"vpc"
,
{}
)
]
)
content
{
content
{
vpc_id
=
vpc
.
value
.
vpc_id
vpc_id
=
vpc
.
value
.
vpc_id
...
...
modules/zones/outputs.tf
View file @
c4d01fc7
...
@@ -7,3 +7,8 @@ output "this_route53_zone_name_servers" {
...
@@ -7,3 +7,8 @@ output "this_route53_zone_name_servers" {
description
=
"Name servers of Route53 zone"
description
=
"Name servers of Route53 zone"
value
=
{
for
k
,
v
in
aws_route53_zone
.
this
:
k
=
>
v
.
name_servers
}
value
=
{
for
k
,
v
in
aws_route53_zone
.
this
:
k
=
>
v
.
name_servers
}
}
}
output
"this_route53_zone_name"
{
description
=
"Name of Route53 zone"
value
=
{
for
k
,
v
in
aws_route53_zone
.
this
:
k
=
>
v
.
name
}
}
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