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
def53274
Unverified
Commit
def53274
authored
Jun 11, 2021
by
Anton Babenko
Committed by
GitHub
Jun 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Added fix for records with terragrunt (#42)
parent
736dcb71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletion
+36
-1
README.md
examples/complete/README.md
+3
-0
main.tf
examples/complete/main.tf
+28
-0
main.tf
modules/records/main.tf
+5
-1
No files found.
examples/complete/README.md
View file @
def53274
...
...
@@ -2,6 +2,8 @@
Configuration in this directory creates Route53 zones and records for various types of resources - S3 bucket, CloudFront distribution, static records.
Also, there is a solution for Terragrunt users.
## Usage
To run this example you need to execute:
...
...
@@ -35,6 +37,7 @@ Note that this example may create resources which cost money. Run `terraform des
|
<a
name=
"module_cloudfront"
></a>
[
cloudfront
](
#module\_cloudfront
)
| terraform-aws-modules/cloudfront/aws | |
|
<a
name=
"module_disabled_records"
></a>
[
disabled\_records
](
#module\_disabled\_records
)
| ../../modules/records | |
|
<a
name=
"module_records"
></a>
[
records
](
#module\_records
)
| ../../modules/records | |
|
<a
name=
"module_records_with_terragrunt"
></a>
[
records\_with\_terragrunt
](
#module\_records\_with\_terragrunt
)
| ../../modules/records | |
|
<a
name=
"module_s3_bucket"
></a>
[
s3\_bucket
](
#module\_s3\_bucket
)
| terraform-aws-modules/s3-bucket/aws | |
|
<a
name=
"module_vpc"
></a>
[
vpc
](
#module\_vpc
)
| terraform-aws-modules/vpc/aws | |
|
<a
name=
"module_vpc2"
></a>
[
vpc2
](
#module\_vpc2
)
| terraform-aws-modules/vpc/aws | |
...
...
examples/complete/main.tf
View file @
def53274
...
...
@@ -130,6 +130,34 @@ module "records" {
depends_on
=
[
module
.
zones
]
}
module
"records_with_terragrunt"
{
source
=
"../../modules/records"
zone_name
=
keys
(
module
.
zones
.
route53_zone_zone_id
)
[
0
]
# Terragrunt has a bug (https://github.com/gruntwork-io/terragrunt/issues/1211) that requires `records` to be wrapped with `jsonencode()`
records
=
jsonencode
(
[
{
name
=
"new"
type
=
"A"
ttl
=
3600
records
=
[
"10.10.10.10"
,
]
},
{
name
=
"s3-bucket-new"
type
=
"A"
alias
=
{
name
=
module
.
s3_bucket
.
s3_bucket_website_domain
zone_id
=
module
.
s3_bucket
.
s3_bucket_hosted_zone_id
}
}
]
)
depends_on
=
[
module
.
zones
]
}
module
"disabled_records"
{
source
=
"../../modules/records"
...
...
modules/records/main.tf
View file @
def53274
locals
{
# terragrunt users have to provide `records` as jsonencode()'d string.
# See details: https://github.com/gruntwork-io/terragrunt/issues/1211
records
=
try
(
jsondecode
(
var
.
records
),
var
.
records
)
# convert from list to map with unique keys
recordsets
=
{
for
rs
in
var
.
records
:
join
(
" "
,
compact
(
[
"
${
rs
.
name
}
${
rs
.
type
}
"
,
lookup
(
rs
,
"set_identifier"
,
""
)
]
))
=
>
rs
}
recordsets
=
{
for
rs
in
local
.
records
:
join
(
" "
,
compact
(
[
"
${
rs
.
name
}
${
rs
.
type
}
"
,
lookup
(
rs
,
"set_identifier"
,
""
)
]
))
=
>
rs
}
}
data
"aws_route53_zone"
"this"
{
...
...
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