diff --git a/README.md b/README.md index eef8457..2f37273 100644 --- a/README.md +++ b/README.md @@ -177,13 +177,13 @@ module "api_gateway" { | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 5.37 | +| [aws](#requirement\_aws) | >= 5.96 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.37 | +| [aws](#provider\_aws) | >= 5.96 | ## Modules @@ -235,6 +235,7 @@ module "api_gateway" { | [domain\_name\_ownership\_verification\_certificate\_arn](#input\_domain\_name\_ownership\_verification\_certificate\_arn) | ARN of the AWS-issued certificate used to validate custom domain ownership (when certificate\_arn is issued via an ACM Private CA or mutual\_tls\_authentication is configured with an ACM-imported certificate.) | `string` | `null` | no | | [fail\_on\_warnings](#input\_fail\_on\_warnings) | Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs | `bool` | `null` | no | | [hosted\_zone\_name](#input\_hosted\_zone\_name) | Optional domain name of the Hosted Zone where the domain should be created | `string` | `null` | no | +| [ip\_address\_type](#input\_ip\_address\_type) | The IP address types that can invoke the API. Valid values: ipv4, dualstack. Use ipv4 to allow only IPv4 addresses to invoke your API, or use dualstack to allow both IPv4 and IPv6 addresses to invoke your API. Defaults to ipv4. | `string` | `null` | no | | [mutual\_tls\_authentication](#input\_mutual\_tls\_authentication) | The mutual TLS authentication configuration for the domain name | `map(string)` | `{}` | no | | [name](#input\_name) | The name of the API. Must be less than or equal to 128 characters in length | `string` | `""` | no | | [protocol\_type](#input\_protocol\_type) | The API protocol. Valid values: `HTTP`, `WEBSOCKET` | `string` | `"HTTP"` | no | diff --git a/examples/complete-http/README.md b/examples/complete-http/README.md index 1d8c86b..082e8f0 100644 --- a/examples/complete-http/README.md +++ b/examples/complete-http/README.md @@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 5.37 | +| [aws](#requirement\_aws) | >= 5.96 | | [local](#requirement\_local) | >= 2.5 | | [null](#requirement\_null) | >= 2.0 | | [tls](#requirement\_tls) | >= 3.1 | @@ -29,7 +29,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.37 | +| [aws](#provider\_aws) | >= 5.96 | | [local](#provider\_local) | >= 2.5 | | [null](#provider\_null) | >= 2.0 | | [tls](#provider\_tls) | >= 3.1 | diff --git a/examples/complete-http/versions.tf b/examples/complete-http/versions.tf index 0985fb3..61e4e49 100644 --- a/examples/complete-http/versions.tf +++ b/examples/complete-http/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.37" + version = ">= 5.96" } local = { source = "hashicorp/local" diff --git a/examples/vpc-link-http/README.md b/examples/vpc-link-http/README.md index 06c7f03..795d199 100644 --- a/examples/vpc-link-http/README.md +++ b/examples/vpc-link-http/README.md @@ -20,14 +20,14 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 5.37 | +| [aws](#requirement\_aws) | >= 5.96 | | [null](#requirement\_null) | >= 2.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.37 | +| [aws](#provider\_aws) | >= 5.96 | | [null](#provider\_null) | >= 2.0 | ## Modules diff --git a/examples/vpc-link-http/versions.tf b/examples/vpc-link-http/versions.tf index 13cb4e5..7082bff 100644 --- a/examples/vpc-link-http/versions.tf +++ b/examples/vpc-link-http/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.37" + version = ">= 5.96" } null = { source = "hashicorp/null" diff --git a/examples/websocket/README.md b/examples/websocket/README.md index 194a91e..a549ee6 100644 --- a/examples/websocket/README.md +++ b/examples/websocket/README.md @@ -51,7 +51,7 @@ connected (press CTRL+C to quit) | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 5.37 | +| [aws](#requirement\_aws) | >= 5.96 | ## Providers diff --git a/examples/websocket/versions.tf b/examples/websocket/versions.tf index 5f6e023..97e1864 100644 --- a/examples/websocket/versions.tf +++ b/examples/websocket/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.37" + version = ">= 5.96" } } } diff --git a/main.tf b/main.tf index e2cc867..add0941 100644 --- a/main.tf +++ b/main.tf @@ -33,6 +33,7 @@ resource "aws_apigatewayv2_api" "this" { # https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-disable-default-endpoint.html disable_execute_api_endpoint = local.is_http && local.create_domain_name ? true : var.disable_execute_api_endpoint fail_on_warnings = local.is_http ? var.fail_on_warnings : null + ip_address_type = var.ip_address_type name = var.name protocol_type = var.protocol_type route_key = local.is_http ? var.route_key : null @@ -91,6 +92,7 @@ resource "aws_apigatewayv2_domain_name" "this" { domain_name_configuration { certificate_arn = local.create_certificate ? module.acm.acm_certificate_arn : var.domain_name_certificate_arn endpoint_type = "REGIONAL" + ip_address_type = var.ip_address_type security_policy = "TLS_1_2" ownership_verification_certificate_arn = var.domain_name_ownership_verification_certificate_arn } diff --git a/variables.tf b/variables.tf index b8ec5a7..3e2219d 100644 --- a/variables.tf +++ b/variables.tf @@ -57,6 +57,12 @@ variable "fail_on_warnings" { default = null } +variable "ip_address_type" { + description = "The IP address types that can invoke the API. Valid values: ipv4, dualstack. Use ipv4 to allow only IPv4 addresses to invoke your API, or use dualstack to allow both IPv4 and IPv6 addresses to invoke your API. Defaults to ipv4." + type = string + default = null +} + variable "name" { description = "The name of the API. Must be less than or equal to 128 characters in length" type = string diff --git a/versions.tf b/versions.tf index 5f6e023..97e1864 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.37" + version = ">= 5.96" } } } diff --git a/wrappers/main.tf b/wrappers/main.tf index ef81c25..879333a 100644 --- a/wrappers/main.tf +++ b/wrappers/main.tf @@ -24,6 +24,7 @@ module "wrapper" { domain_name_ownership_verification_certificate_arn = try(each.value.domain_name_ownership_verification_certificate_arn, var.defaults.domain_name_ownership_verification_certificate_arn, null) fail_on_warnings = try(each.value.fail_on_warnings, var.defaults.fail_on_warnings, null) hosted_zone_name = try(each.value.hosted_zone_name, var.defaults.hosted_zone_name, null) + ip_address_type = try(each.value.ip_address_type, var.defaults.ip_address_type, null) mutual_tls_authentication = try(each.value.mutual_tls_authentication, var.defaults.mutual_tls_authentication, {}) name = try(each.value.name, var.defaults.name, "") protocol_type = try(each.value.protocol_type, var.defaults.protocol_type, "HTTP") diff --git a/wrappers/versions.tf b/wrappers/versions.tf index 5f6e023..97e1864 100644 --- a/wrappers/versions.tf +++ b/wrappers/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.37" + version = ">= 5.96" } } }