Skip to content

Commit 46da36c

Browse files
committed
feat: Allows lookup of private hosted zones
1 parent ab6406a commit 46da36c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ module "api_gateway" {
237237
| <a name="input_hosted_zone_name"></a> [hosted\_zone\_name](#input\_hosted\_zone\_name) | Optional domain name of the Hosted Zone where the domain should be created | `string` | `null` | no |
238238
| <a name="input_mutual_tls_authentication"></a> [mutual\_tls\_authentication](#input\_mutual\_tls\_authentication) | The mutual TLS authentication configuration for the domain name | `map(string)` | `{}` | no |
239239
| <a name="input_name"></a> [name](#input\_name) | The name of the API. Must be less than or equal to 128 characters in length | `string` | `""` | no |
240+
| <a name="input_private_zone"></a> [private\_zone](#input\_private\_zone) | Indicates the hosted zone being looked up is private. | `bool` | `false` | no |
240241
| <a name="input_protocol_type"></a> [protocol\_type](#input\_protocol\_type) | The API protocol. Valid values: `HTTP`, `WEBSOCKET` | `string` | `"HTTP"` | no |
241242
| <a name="input_route_key"></a> [route\_key](#input\_route\_key) | Part of quick create. Specifies any route key. Applicable for HTTP APIs | `string` | `null` | no |
242243
| <a name="input_route_selection_expression"></a> [route\_selection\_expression](#input\_route\_selection\_expression) | The route selection expression for the API. Defaults to `$request.method $request.path` | `string` | `null` | no |

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ locals {
134134
data "aws_route53_zone" "this" {
135135
count = local.create_domain_name && var.create_domain_records ? 1 : 0
136136

137-
name = coalesce(var.hosted_zone_name, local.stripped_domain_name)
137+
name = coalesce(var.hosted_zone_name, local.stripped_domain_name)
138+
private_zone = var.private_zone
138139
}
139140

140141
resource "aws_route53_record" "this" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ variable "hosted_zone_name" {
150150
default = null
151151
}
152152

153+
variable "private_zone" {
154+
description = "Indicates the hosted zone being looked up is private."
155+
type = bool
156+
default = false
157+
}
158+
153159
variable "domain_name_certificate_arn" {
154160
description = "The ARN of an AWS-managed certificate that will be used by the endpoint for the domain name. AWS Certificate Manager is the only supported source"
155161
type = string

0 commit comments

Comments
 (0)