-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
feat: Allow hosted zone name to be passed in separately #119
feat: Allow hosted zone name to be passed in separately #119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost perfect. Minor comments.
Thanks for the quick feedback @antonbabenko and @bryantbiggs! 🙂 |
211a35c
to
26696bd
Compare
## [5.2.0](v5.1.3...v5.2.0) (2024-08-26) ### Features * Allow hosted zone name to be passed in separately ([#119](#119)) ([bcd2fdb](bcd2fdb))
This PR is included in version 5.2.0 🎉 |
@@ -134,7 +134,7 @@ locals { | |||
data "aws_route53_zone" "this" { | |||
count = local.create_domain_name && var.create_domain_records ? 1 : 0 | |||
|
|||
name = local.stripped_domain_name | |||
name = coalesce(var.hosted_zone_name, local.stripped_domain_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesnt allow null in both parameters.. breaks the previous API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's accurate.
1.) A lookup without name doesn't make sense and would fail anyway(I guess?)
2.) local.stripped_domain_name
cannot be null since we would fail a couple lines up already when calling replace
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
Allow users to explicitly pass the name of the hosted zone they would like the domain to be created in.
Motivation and Context
This allows for use cases where the hosted zone is delegated from another account (e.g.
team-abc.acme.com
).Within that hosted zone you might want to create another domain (
api.team-abc.acme.com
). This currently isn't possible because the module expects a hosted zone with the name as passed invar.domain_name
to be present.Breaking Changes
None, if the parameter isn't passed we just look up the hosted zone based on the
stripped_domain_name
as before.How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request