From 0cfc3644713385cb23f5059e2e8e2cfca21e2a5f Mon Sep 17 00:00:00 2001 From: Piotr Krawiec Date: Fri, 14 Apr 2023 16:16:58 +0200 Subject: [PATCH 1/3] feat: Add invoke_mode input --- README.md | 1 + examples/complete/main.tf | 1 + main.tf | 1 + variables.tf | 6 ++++++ 4 files changed, 9 insertions(+) diff --git a/README.md b/README.md index e6120fd7..9542ebe8 100644 --- a/README.md +++ b/README.md @@ -791,6 +791,7 @@ No modules. | [image\_config\_entry\_point](#input\_image\_config\_entry\_point) | The ENTRYPOINT for the docker image | `list(string)` | `[]` | no | | [image\_config\_working\_directory](#input\_image\_config\_working\_directory) | The working directory for the docker image | `string` | `null` | no | | [image\_uri](#input\_image\_uri) | The ECR image URI containing the function's deployment package. | `string` | `null` | no | +| [invoke\_mode](#input\_invoke\_mode) | Invoke mode of the Lambda Function URL. Valid values are BUFFERED (default) and RESPONSE\_STREAM. | `string` | `"BUFFERED"` | no | | [kms\_key\_arn](#input\_kms\_key\_arn) | The ARN of KMS key to use by your Lambda Function | `string` | `null` | no | | [lambda\_at\_edge](#input\_lambda\_at\_edge) | Set this to true if using Lambda@Edge, to enable publishing, limit the timeout, and allow edgelambda.amazonaws.com to invoke the function | `bool` | `false` | no | | [lambda\_role](#input\_lambda\_role) | IAM role ARN attached to the Lambda Function. This governs both who / what can invoke your Lambda Function, as well as what resources our Lambda Function has access to. See Lambda Permission Model for more details. | `string` | `""` | no | diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 1f05580c..f7a55673 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -78,6 +78,7 @@ module "lambda_function" { expose_headers = ["keep-alive", "date"] max_age = 86400 } + invoke_mode = "RESPONSE_STREAM" ###################### # Additional policies diff --git a/main.tf b/main.tf index 06d2e79b..5dd020e9 100644 --- a/main.tf +++ b/main.tf @@ -349,6 +349,7 @@ resource "aws_lambda_function_url" "this" { # Error: error creating Lambda Function URL: ValidationException qualifier = var.create_unqualified_alias_lambda_function_url ? null : aws_lambda_function.this[0].version authorization_type = var.authorization_type + invoke_mode = var.invoke_mode dynamic "cors" { for_each = length(keys(var.cors)) == 0 ? [] : [var.cors] diff --git a/variables.tf b/variables.tf index 166f98da..d23b1b59 100644 --- a/variables.tf +++ b/variables.tf @@ -257,6 +257,12 @@ variable "cors" { default = {} } +variable "invoke_mode" { + description = "Invoke mode of the Lambda Function URL. Valid values are BUFFERED (default) and RESPONSE_STREAM." + type = string + default = "BUFFERED" +} + ######## # Layer ######## From 9fb4e0eca185d73774ba20fca8c2ddf2777c88dd Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Fri, 14 Apr 2023 12:41:47 -0700 Subject: [PATCH 2/3] Apply suggestions from code review --- README.md | 2 +- variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9542ebe8..92930786 100644 --- a/README.md +++ b/README.md @@ -791,7 +791,7 @@ No modules. | [image\_config\_entry\_point](#input\_image\_config\_entry\_point) | The ENTRYPOINT for the docker image | `list(string)` | `[]` | no | | [image\_config\_working\_directory](#input\_image\_config\_working\_directory) | The working directory for the docker image | `string` | `null` | no | | [image\_uri](#input\_image\_uri) | The ECR image URI containing the function's deployment package. | `string` | `null` | no | -| [invoke\_mode](#input\_invoke\_mode) | Invoke mode of the Lambda Function URL. Valid values are BUFFERED (default) and RESPONSE\_STREAM. | `string` | `"BUFFERED"` | no | +| [invoke\_mode](#input\_invoke\_mode) | Invoke mode of the Lambda Function URL. Valid values are BUFFERED (default) and RESPONSE\_STREAM. | `string` | `null` | no | | [kms\_key\_arn](#input\_kms\_key\_arn) | The ARN of KMS key to use by your Lambda Function | `string` | `null` | no | | [lambda\_at\_edge](#input\_lambda\_at\_edge) | Set this to true if using Lambda@Edge, to enable publishing, limit the timeout, and allow edgelambda.amazonaws.com to invoke the function | `bool` | `false` | no | | [lambda\_role](#input\_lambda\_role) | IAM role ARN attached to the Lambda Function. This governs both who / what can invoke your Lambda Function, as well as what resources our Lambda Function has access to. See Lambda Permission Model for more details. | `string` | `""` | no | diff --git a/variables.tf b/variables.tf index d23b1b59..2a853afc 100644 --- a/variables.tf +++ b/variables.tf @@ -260,7 +260,7 @@ variable "cors" { variable "invoke_mode" { description = "Invoke mode of the Lambda Function URL. Valid values are BUFFERED (default) and RESPONSE_STREAM." type = string - default = "BUFFERED" + default = null } ######## From 6dd4debe68fb192c40ff6f8dfba6988ba6ad45f8 Mon Sep 17 00:00:00 2001 From: Piotr Krawiec Date: Mon, 17 Apr 2023 11:11:06 +0200 Subject: [PATCH 3/3] Bump required AWS provider version invoke_mode was introduced in 4.63.0 https://github.com/hashicorp/terraform-provider-aws/pull/30547 --- README.md | 4 ++-- examples/complete/README.md | 4 ++-- examples/complete/versions.tf | 2 +- versions.tf | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 92930786..b08414ce 100644 --- a/README.md +++ b/README.md @@ -659,7 +659,7 @@ Q4: What does this error mean - `"We currently do not support adding policies fo | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 4.54 | +| [aws](#requirement\_aws) | >= 4.63 | | [external](#requirement\_external) | >= 1.0 | | [local](#requirement\_local) | >= 1.0 | | [null](#requirement\_null) | >= 2.0 | @@ -668,7 +668,7 @@ Q4: What does this error mean - `"We currently do not support adding policies fo | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.54 | +| [aws](#provider\_aws) | >= 4.63 | | [external](#provider\_external) | >= 1.0 | | [local](#provider\_local) | >= 1.0 | | [null](#provider\_null) | >= 2.0 | diff --git a/examples/complete/README.md b/examples/complete/README.md index c242b952..968d88c9 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -21,14 +21,14 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 4.9 | +| [aws](#requirement\_aws) | >= 4.63 | | [random](#requirement\_random) | >= 2.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.9 | +| [aws](#provider\_aws) | >= 4.63 | | [random](#provider\_random) | >= 2.0 | ## Modules diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index 629d346a..f8d3b354 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.9" + version = ">= 4.63" } random = { source = "hashicorp/random" diff --git a/versions.tf b/versions.tf index 524eb312..74502032 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.54" + version = ">= 4.63" } external = { source = "hashicorp/external"