-
-
Notifications
You must be signed in to change notification settings - Fork 212
feat: Added support for private hosted zone in Route53 #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I need this change for my work. I need the domain name to be created in a private zone. |
Looks good, please run |
Hello! |
Please fix the failing checks. |
I added changes requested in pre-commit workflow. Change in the Terraform module source:
|
Why are there so many files that have been changed? Could you update the master branch to keep changes to just the required files? |
Close this, i won't waste more time in this. |
Description
main.tf
before:
data "aws_route53_zone" "this" {
count = local.create_domain_name && var.create_domain_records ? 1 : 0
name = coalesce(var.hosted_zone_name, local.stripped_domain_name)
}
now:
data "aws_route53_zone" "this" {
count = local.create_domain_name && var.create_domain_records ? 1 : 0
private_zone = var.private_zone
name = coalesce(var.hosted_zone_name, local.stripped_domain_name)
}
variables.tf
added:
line 159: variable "private_zone" {
description = "Whether the hosted zone is private or not"
type = bool
default = false
}
Motivation and Context
This is needed when someone wants to create records in a private hosted zone. The private_zone argument is required when looking up private zones using the aws_route53_zone data source. Without this parameter, Terraform cannot find the private zone, even if the zone name matches.
Breaking Changes
This change introduces a new variable (private_zone) with a default value of false, so it is backward compatible.
However, users must explicitly set private_zone = true when creating records in a private hosted zone. Failing to do so will result in the zone not being found.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request