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
61f7f90a
Unverified
Commit
61f7f90a
authored
Nov 27, 2020
by
Nicholas Hawkes
Committed by
GitHub
Nov 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Adding dynamic vpc block to handle private zones (#13)
parent
28980407
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
4 deletions
+30
-4
main.tf
examples/complete/main.tf
+18
-1
README.md
modules/zones/README.md
+1
-1
main.tf
modules/zones/main.tf
+10
-1
variables.tf
modules/zones/variables.tf
+1
-1
No files found.
examples/complete/main.tf
View file @
61f7f90a
...
...
@@ -7,7 +7,7 @@ module "zones" {
zones
=
{
"terraform-aws-modules-example.com"
=
{
comment
=
"terraform-aws-modules-example
s
.com (production)"
comment
=
"terraform-aws-modules-example.com (production)"
tags
=
{
Name
=
"terraform-aws-modules-example.com"
}
...
...
@@ -19,6 +19,16 @@ module "zones" {
Name
=
"app.terraform-aws-modules-example.com"
}
}
"private-vpc.terraform-aws-modules-example.com"
=
{
comment
=
"private-vpc.terraform-aws-modules-example.com"
vpc
=
{
vpc_id
=
module
.
vpc
.
vpc_id
}
tags
=
{
Name
=
"private-vpc.terraform-aws-modules-example.com"
}
}
}
}
...
...
@@ -97,3 +107,10 @@ module "cloudfront" {
cloudfront_default_certificate
=
true
}
}
module
"vpc"
{
source
=
"terraform-aws-modules/vpc/aws"
name
=
"my-vpc-for-private-route53-zone"
cidr
=
"10.0.0.0/16"
}
modules/zones/README.md
View file @
61f7f90a
...
...
@@ -21,7 +21,7 @@ This module creates Route53 zones.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| create | Whether to create Route53 zone |
`bool`
|
`true`
| no |
| zones | Map of Route53 zone parameters |
`
map(any)
`
|
`{}`
| no |
| zones | Map of Route53 zone parameters |
`
any
`
|
`{}`
| no |
## Outputs
...
...
modules/zones/main.tf
View file @
61f7f90a
resource
"aws_route53_zone"
"this"
{
for_each
=
var
.
create
?
var
.
zones
:
{}
for_each
=
var
.
create
?
var
.
zones
:
tomap
(
{}
)
name
=
each
.
key
comment
=
lookup
(
each
.
value
,
"comment"
,
null
)
force_destroy
=
lookup
(
each
.
value
,
"force_destroy"
,
false
)
dynamic
"vpc"
{
for_each
=
length
(
keys
(
lookup
(
each
.
value
,
"vpc"
,
{}
)))
==
0
?
[]
:
[
lookup
(
each
.
value
,
"vpc"
,
{}
)
]
content
{
vpc_id
=
vpc
.
value
.
vpc_id
vpc_region
=
lookup
(
vpc
.
value
,
"vpc_region"
,
null
)
}
}
tags
=
lookup
(
each
.
value
,
"tags"
,
null
)
}
modules/zones/variables.tf
View file @
61f7f90a
...
...
@@ -6,6 +6,6 @@ variable "create" {
variable
"zones"
{
description
=
"Map of Route53 zone parameters"
type
=
map
(
any
)
type
=
any
default
=
{}
}
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