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
426d1dc5
Unverified
Commit
426d1dc5
authored
Aug 13, 2021
by
Anna
Committed by
GitHub
Aug 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add geo routing policy and multivalue answer routing policy (#52)
parent
de95912e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
11 deletions
+32
-11
main.tf
examples/complete/main.tf
+14
-4
main.tf
modules/records/main.tf
+18
-7
No files found.
examples/complete/main.tf
View file @
426d1dc5
...
@@ -64,6 +64,16 @@ module "records" {
...
@@ -64,6 +64,16 @@ module "records" {
zone_id
=
module
.
s3_bucket
.
s3_bucket_hosted_zone_id
zone_id
=
module
.
s3_bucket
.
s3_bucket_hosted_zone_id
}
}
},
},
{
name
=
"geo"
type
=
"CNAME"
ttl
=
5
records
=
[
"europe.test.example.com."
]
set_identifier
=
"europe"
geolocation_routing_policy
=
{
continent
=
"EU"
}
},
{
{
name
=
"cloudfront"
name
=
"cloudfront"
type
=
"A"
type
=
"A"
...
@@ -118,11 +128,11 @@ module "records" {
...
@@ -118,11 +128,11 @@ module "records" {
}
}
},
},
{
{
name
=
"alternative-resource-name"
name
=
"alternative-resource-name"
type
=
"A"
type
=
"A"
set_identifier
=
"alternative-resource-name"
alias
=
{
alias
=
{
name
=
module
.
s3_bucket
.
s3_bucket_website_domain
name
=
module
.
s3_bucket
.
s3_bucket_website_domain
zone_id
=
module
.
s3_bucket
.
s3_bucket_hosted_zone_id
}
}
}
}
]
]
...
...
modules/records/main.tf
View file @
426d1dc5
...
@@ -20,13 +20,14 @@ resource "aws_route53_record" "this" {
...
@@ -20,13 +20,14 @@ resource "aws_route53_record" "this" {
zone_id
=
data
.
aws_route53_zone
.
this
[
0
]
.
zone_id
zone_id
=
data
.
aws_route53_zone
.
this
[
0
]
.
zone_id
name
=
each
.
value
.
name
!
=
""
?
"
${
each
.
value
.
name
}
.
${data
.
aws_route53_zone
.
this
[
0
].
name
}
"
:
data
.
aws_route53_zone
.
this
[
0
]
.
name
name
=
each
.
value
.
name
!
=
""
?
"
${
each
.
value
.
name
}
.
${data
.
aws_route53_zone
.
this
[
0
].
name
}
"
:
data
.
aws_route53_zone
.
this
[
0
]
.
name
type
=
each
.
value
.
type
type
=
each
.
value
.
type
allow_overwrite
=
lookup
(
each
.
value
,
"allow_overwrite"
,
false
)
ttl
=
lookup
(
each
.
value
,
"ttl"
,
null
)
ttl
=
lookup
(
each
.
value
,
"ttl"
,
null
)
records
=
lookup
(
each
.
value
,
"records"
,
null
)
records
=
lookup
(
each
.
value
,
"records"
,
null
)
set_identifier
=
lookup
(
each
.
value
,
"set_identifier"
,
null
)
set_identifier
=
lookup
(
each
.
value
,
"set_identifier"
,
null
)
health_check_id
=
lookup
(
each
.
value
,
"health_check_id"
,
null
)
health_check_id
=
lookup
(
each
.
value
,
"health_check_id"
,
null
)
multivalue_answer_routing_policy
=
lookup
(
each
.
value
,
"multivalue_answer_routing_policy"
,
null
)
allow_overwrite
=
lookup
(
each
.
value
,
"allow_overwrite"
,
false
)
dynamic
"alias"
{
dynamic
"alias"
{
for_each
=
length
(
keys
(
lookup
(
each
.
value
,
"alias"
,
{}
)))
==
0
?
[]
:
[
true
]
for_each
=
length
(
keys
(
lookup
(
each
.
value
,
"alias"
,
{}
)))
==
0
?
[]
:
[
true
]
...
@@ -53,4 +54,14 @@ resource "aws_route53_record" "this" {
...
@@ -53,4 +54,14 @@ resource "aws_route53_record" "this" {
weight
=
each
.
value
.
weighted_routing_policy
.
weight
weight
=
each
.
value
.
weighted_routing_policy
.
weight
}
}
}
}
dynamic
"geolocation_routing_policy"
{
for_each
=
length
(
keys
(
lookup
(
each
.
value
,
"geolocation_routing_policy"
,
{}
)))
==
0
?
[]
:
[
true
]
content
{
continent
=
lookup
(
each
.
value
.
geolocation_routing_policy
,
"continent"
,
null
)
country
=
lookup
(
each
.
value
.
geolocation_routing_policy
,
"country"
,
null
)
subdivision
=
lookup
(
each
.
value
.
geolocation_routing_policy
,
"subdivision"
,
null
)
}
}
}
}
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