diff --git a/docs/reference/modules/terraform-aws-lambda/api-gateway-account-settings/api-gateway-account-settings.md b/docs/reference/modules/terraform-aws-lambda/api-gateway-account-settings/api-gateway-account-settings.md index be06ff466..823f658fa 100644 --- a/docs/reference/modules/terraform-aws-lambda/api-gateway-account-settings/api-gateway-account-settings.md +++ b/docs/reference/modules/terraform-aws-lambda/api-gateway-account-settings/api-gateway-account-settings.md @@ -9,13 +9,13 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # API Gateway Account Settings Module -View Source +View Source -Release Notes +Release Notes This module allows you set the regional settings required to allow API Gateway to write to CloudWatch logs. @@ -34,7 +34,7 @@ The corresponding screen from the AWS Console is shown below: ## Quick start -Check out the [examples](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples) for sample code that demonstrates how to use this module. +Check out the [examples](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples) for sample code that demonstrates how to use this module. ## Sample Usage @@ -49,7 +49,7 @@ Check out the [examples](https://github.com/gruntwork-io/terraform-aws-lambda/tr module "api_gateway_account_settings" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-account-settings?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-account-settings?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # OPTIONAL VARIABLES @@ -91,7 +91,7 @@ module "api_gateway_account_settings" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-account-settings?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-account-settings?ref=v1.3.1" } inputs = { @@ -190,11 +190,11 @@ When true, all IAM policies will be managed as dedicated policies rather than in diff --git a/docs/reference/modules/terraform-aws-lambda/api-gateway-proxy-methods/api-gateway-proxy-methods.md b/docs/reference/modules/terraform-aws-lambda/api-gateway-proxy-methods/api-gateway-proxy-methods.md index ca796fc7f..a10e82ac9 100644 --- a/docs/reference/modules/terraform-aws-lambda/api-gateway-proxy-methods/api-gateway-proxy-methods.md +++ b/docs/reference/modules/terraform-aws-lambda/api-gateway-proxy-methods/api-gateway-proxy-methods.md @@ -9,20 +9,20 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # API Gateway Lambda Function Proxy Methods Module -View Source +View Source Release Notes -This module must be used in conjunction with [the api-gateway-proxy module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy) to configure an API +This module must be used in conjunction with [the api-gateway-proxy module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy) to configure an API Gateway REST API to route all requests from a root path to a lambda function. -Refer to [the module docs](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy/README.md) for the `api-gateway-proxy` module for more details on how to +Refer to [the module docs](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy/README.md) for the `api-gateway-proxy` module for more details on how to use this module. Specifically, see the section [Can I expose additional lambda functions in a decentralized -manner?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy/core-concepts.md#can-i-expose-additional-lambda-functions-in-a-decentralized-manner) +manner?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy/core-concepts.md#can-i-expose-additional-lambda-functions-in-a-decentralized-manner) ## Sample Usage @@ -37,7 +37,7 @@ manner?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/module module "api_gateway_proxy_methods" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-proxy-methods?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-proxy-methods?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -85,7 +85,7 @@ module "api_gateway_proxy_methods" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-proxy-methods?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-proxy-methods?ref=v1.3.1" } inputs = { @@ -292,11 +292,11 @@ ID of the API Gateway method for the root proxy (only created if path_prefix is diff --git a/docs/reference/modules/terraform-aws-lambda/api-gateway-proxy/api-gateway-proxy.md b/docs/reference/modules/terraform-aws-lambda/api-gateway-proxy/api-gateway-proxy.md index 1b8a6b14f..6b45e4d0c 100644 --- a/docs/reference/modules/terraform-aws-lambda/api-gateway-proxy/api-gateway-proxy.md +++ b/docs/reference/modules/terraform-aws-lambda/api-gateway-proxy/api-gateway-proxy.md @@ -9,13 +9,13 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # API Gateway Proxy Module -View Source +View Source -Release Notes +Release Notes This module creates an [API Gateway](https://aws.amazon.com/api-gateway/) that can be used to expose your serverless applications running in [AWS Lambda](https://aws.amazon.com/lambda/). @@ -34,7 +34,7 @@ recommend using a framework like Serverless to avoid the verbose configuration o :::note If you are looking for a module to route different requests and methods to different Lambda functions, refer to the -[lambda-http-api-gateway](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/lambda-http-api-gateway) module. +[lambda-http-api-gateway](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda-http-api-gateway) module. ::: @@ -58,33 +58,33 @@ before, make sure to read [How to use the Gruntwork Infrastructure as Code Libra ### Core concepts -* [What is API Gateway?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy/core-concepts.md#what-is-api-gateway) +* [What is API Gateway?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy/core-concepts.md#what-is-api-gateway) * [What is the difference between the different endpoint - types?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy/core-concepts.md#what-is-the-difference-between-the-different-endpoint-types) + types?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy/core-concepts.md#what-is-the-difference-between-the-different-endpoint-types) * [API Gateway Documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html): Amazon's docs on API Gateway covering core concepts such as security, monitoring, and invoking APIs. ### Repo organization -* [modules](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules): the main implementation code for this repo, broken down into multiple standalone, orthogonal submodules. -* [examples](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples): This folder contains working examples of how to use the submodules. -* [test](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/test): Automated tests for the modules and examples. +* [modules](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules): the main implementation code for this repo, broken down into multiple standalone, orthogonal submodules. +* [examples](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples): This folder contains working examples of how to use the submodules. +* [test](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/test): Automated tests for the modules and examples. ## Deploy If you just want to try this repo out for experimenting and learning, check out the following resources: -* [examples folder](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples): The `examples` folder contains sample code optimized for learning, experimenting, and testing (but not production usage). +* [examples folder](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples): The `examples` folder contains sample code optimized for learning, experimenting, and testing (but not production usage). ## Manage ### Day-to-day operations * [How do I expose AWS Lambda functions using API - Gateway?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy/core-concepts.md#how-do-i-expose-aws-lambda-functions-using-api-gateway) + Gateway?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy/core-concepts.md#how-do-i-expose-aws-lambda-functions-using-api-gateway) * [Can I expose additional lambda functions in a decentralized - manner?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy/core-concepts.md#can-i-expose-additional-lambda-functions-in-a-decentralized-manner) -* [How do I pass in the us_east\_1 aws provider?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy/core-concepts.md#how-do-i-pass-in-the-us_east\_1-aws-provider) + manner?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy/core-concepts.md#can-i-expose-additional-lambda-functions-in-a-decentralized-manner) +* [How do I pass in the us_east\_1 aws provider?](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy/core-concepts.md#how-do-i-pass-in-the-us_east\_1-aws-provider) ## Sample Usage @@ -99,7 +99,7 @@ If you just want to try this repo out for experimenting and learning, check out module "api_gateway_proxy" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-proxy?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-proxy?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -260,7 +260,7 @@ module "api_gateway_proxy" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-proxy?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/api-gateway-proxy?ref=v1.3.1" } inputs = { @@ -771,11 +771,11 @@ The URL of the API Gateway that you can use to invoke it. diff --git a/docs/reference/modules/terraform-aws-lambda/keep-warm/keep-warm.md b/docs/reference/modules/terraform-aws-lambda/keep-warm/keep-warm.md index 01e671e79..022936ada 100644 --- a/docs/reference/modules/terraform-aws-lambda/keep-warm/keep-warm.md +++ b/docs/reference/modules/terraform-aws-lambda/keep-warm/keep-warm.md @@ -9,13 +9,13 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # Keep Warm Module -View Source +View Source -Release Notes +Release Notes This is a Lambda function you can use to invoke your other Lambda functions on a scheduled basis to keep those functions "warm." This is necessary for Lambda functions that require a low response time (e.g., if you're using Lambda API Gateway as a web service), as Lambda functions that have not been executed in a while will be shut down (that is, @@ -47,6 +47,11 @@ kept around, but as of May, 2018, it seems that Lambda functions that are inacti Therefore, you should probably run the `keep-warm` function every 5-10 minutes, with the appropriate [concurrency level](#concurrency) for your functions. +## Background info + +For more information on AWS Lambda, how it works, and how to configure your functions, check out the [lambda module +documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda). + ## Sample Usage @@ -60,7 +65,7 @@ level](#concurrency) for your functions. module "keep_warm" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/keep-warm?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/keep-warm?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -133,7 +138,7 @@ module "keep_warm" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/keep-warm?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/keep-warm?ref=v1.3.1" } inputs = { @@ -339,11 +344,11 @@ When true, all IAM policies will be managed as dedicated policies rather than in diff --git a/docs/reference/modules/terraform-aws-lambda/lambda-alias/lambda-alias.md b/docs/reference/modules/terraform-aws-lambda/lambda-alias/lambda-alias.md new file mode 100644 index 000000000..b552020d2 --- /dev/null +++ b/docs/reference/modules/terraform-aws-lambda/lambda-alias/lambda-alias.md @@ -0,0 +1,249 @@ +--- +title: "Lambda Alias Module" +hide_title: true +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; +import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; +import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; + + + +# Lambda Alias Module + +View Source + +Release Notes + +This module creates an [AWS Lambda alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) that points to a specific version of a Lambda function. An alias is a named pointer to a Lambda function version, allowing you to invoke a specific version using a stable endpoint without needing to know the underlying version number. + +Aliases are useful for: + +* **Stable endpoints**: Invoke a function via an alias name (e.g., `live`, `staging`) rather than a version number. +* **Traffic shifting**: Gradually shift traffic between two versions using weighted routing for canary or blue/green deployments. +* **Function URLs and event source mappings**: Point triggers at an alias so you can update the underlying version without reconfiguring consumers. + +## How do you do weighted traffic shifting? + +You can use the `routing_config` variable to split traffic between two versions of a Lambda function. This is useful for canary deployments where you want to gradually shift traffic to a new version: + +```hcl +module "lambda_alias" { + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-alias?ref=v1.0.0" + + name = "live" + function_name = module.my_lambda_function.function_name + function_version = "2" + + routing_config = { + additional_version_weights = { + "3" = 0.1 # Send 10% of traffic to version 3 + } + } +} +``` + +In this example, 90% of traffic goes to version 2 (the primary version) and 10% goes to version 3. You can adjust the weight from `0.0` to `1.0` as you gain confidence in the new version. + +## Background info + +For more information on AWS Lambda, how it works, and how to configure your functions, check out the [lambda module +documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda). + +## Sample Usage + + + + +```hcl title="main.tf" + +# ------------------------------------------------------------------------------------------------------ +# DEPLOY GRUNTWORK'S LAMBDA-ALIAS MODULE +# ------------------------------------------------------------------------------------------------------ + +module "lambda_alias" { + + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-alias?ref=v1.3.1" + + # ---------------------------------------------------------------------------------------------------- + # REQUIRED VARIABLES + # ---------------------------------------------------------------------------------------------------- + + # The Lambda function name or ARN to associate with the alias + function_name = + + # Lambda function version for which to create the alias + function_version = + + # Name for the alias + name = + + # ---------------------------------------------------------------------------------------------------- + # OPTIONAL VARIABLES + # ---------------------------------------------------------------------------------------------------- + + # Description of the alias + description = "" + + # Lambda alias routing configuration for weighted traffic shifting. Set + # additional_version_weights to a map of version number to weight (0.0 - 1.0). + routing_config = null + +} + + +``` + + + + +```hcl title="terragrunt.hcl" + +# ------------------------------------------------------------------------------------------------------ +# DEPLOY GRUNTWORK'S LAMBDA-ALIAS MODULE +# ------------------------------------------------------------------------------------------------------ + +terraform { + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-alias?ref=v1.3.1" +} + +inputs = { + + # ---------------------------------------------------------------------------------------------------- + # REQUIRED VARIABLES + # ---------------------------------------------------------------------------------------------------- + + # The Lambda function name or ARN to associate with the alias + function_name = + + # Lambda function version for which to create the alias + function_version = + + # Name for the alias + name = + + # ---------------------------------------------------------------------------------------------------- + # OPTIONAL VARIABLES + # ---------------------------------------------------------------------------------------------------- + + # Description of the alias + description = "" + + # Lambda alias routing configuration for weighted traffic shifting. Set + # additional_version_weights to a map of version number to weight (0.0 - 1.0). + routing_config = null + +} + + +``` + + + + + + + +## Reference + + + + +### Required + + + + +The Lambda function name or ARN to associate with the alias + + + + + + + +Lambda function version for which to create the alias + + + + + + + +Name for the alias + + + + +### Optional + + + + +Description of the alias + + + + + + + + +Lambda alias routing configuration for weighted traffic shifting. Set additional_version_weights to a map of version number to weight (0.0 - 1.0). + + + + +```hcl +object({ + additional_version_weights = map(number) + }) +``` + + + + + + + + + + + +The Amazon Resource Name (ARN) identifying the Lambda alias + + + + + + + +The ARN to be used for invoking the Lambda function via the alias + + + + + + + +The name of the Lambda alias + + + + + + + + diff --git a/docs/reference/modules/terraform-aws-lambda/lambda-edge-log-group/lambda-edge-log-group.md b/docs/reference/modules/terraform-aws-lambda/lambda-edge-log-group/lambda-edge-log-group.md index f2c46f408..b831a11a3 100644 --- a/docs/reference/modules/terraform-aws-lambda/lambda-edge-log-group/lambda-edge-log-group.md +++ b/docs/reference/modules/terraform-aws-lambda/lambda-edge-log-group/lambda-edge-log-group.md @@ -9,15 +9,15 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # Log group for Lambda Edge -View Source +View Source -Release Notes +Release Notes -This module creates a Cloudwatch log group to receive Lambda Edge function logs in one single AWS Region. This module is meant to be used as a building block for the [`lambda-edge-multi-region-log-groups` module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/lambda-edge-multi-region-log-groups). +This module creates a Cloudwatch log group to receive Lambda Edge function logs in one single AWS Region. This module is meant to be used as a building block for the [`lambda-edge-multi-region-log-groups` module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda-edge-multi-region-log-groups). ## Why are the resources in this module not created within the Lambda Edge Module? @@ -28,7 +28,7 @@ region that have [Regional Edge Caches](https://aws.amazon.com/blogs/networking- Unfortunately, it is not possible to use a `for_each` on provider blocks and there are multiple issues related to using nested providers. That means that, currently, the only way to create multi-regional modules is by code generating each block and passing down the providers. A full example of creating the providers and using this module can be found at the -[lambda-edge example](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples/lambda-edge). +[lambda-edge example](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples/lambda-edge). ## Which regions have regional edge caches? @@ -68,6 +68,11 @@ More information: * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-cloudwatch-metrics-logging.html * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-edge-permissions.html +## Background info + +For more information on AWS Lambda, how it works, and how to configure your functions, check out the [lambda module +documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda). + ## Sample Usage @@ -81,7 +86,7 @@ More information: module "lambda_edge_log_group" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge-log-group?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge-log-group?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -153,7 +158,7 @@ module "lambda_edge_log_group" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge-log-group?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge-log-group?ref=v1.3.1" } inputs = { @@ -334,11 +339,11 @@ When true, precreate the CloudWatch Log Group to use for log aggregation from th diff --git a/docs/reference/modules/terraform-aws-lambda/lambda-edge-multi-region-log-groups/lambda-edge-multi-region-log-groups.md b/docs/reference/modules/terraform-aws-lambda/lambda-edge-multi-region-log-groups/lambda-edge-multi-region-log-groups.md index 619ffb5ac..25feb15b6 100644 --- a/docs/reference/modules/terraform-aws-lambda/lambda-edge-multi-region-log-groups/lambda-edge-multi-region-log-groups.md +++ b/docs/reference/modules/terraform-aws-lambda/lambda-edge-multi-region-log-groups/lambda-edge-multi-region-log-groups.md @@ -9,15 +9,15 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # Multiregional Log groups for Lambda Edge -View Source +View Source -Release Notes +Release Notes -This module uses the [`lambda-edge-log-group` module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/lambda-edge-log-group) to create a Cloudwatch log group to receive Lambda Edge function logs in multiple AWS Regions. +This module uses the [`lambda-edge-log-group` module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda-edge-log-group) to create a Cloudwatch log group to receive Lambda Edge function logs in multiple AWS Regions. ## Why are the resources in this module not created within the Lambda Edge Module? @@ -27,8 +27,8 @@ region that have [Regional Edge Caches](https://aws.amazon.com/blogs/networking- Unfortunately, it is not possible to use a `for_each` on provider blocks and there are multiple issues related to using nested providers. That means that, currently, the only way to create multi-regional modules is by code generating each -block and passing down the providers using the [`codegen`](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/codegen/) module. A full example of creating the providers and using -this module can be found at the [lambda-edge example](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples/lambda-edge). +block and passing down the providers using the [`codegen`](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/codegen/) module. A full example of creating the providers and using +this module can be found at the [lambda-edge example](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples/lambda-edge). ## Which regions have regional edge caches? @@ -68,6 +68,11 @@ More information: * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-cloudwatch-metrics-logging.html * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-edge-permissions.html +## Background info + +For more information on AWS Lambda, how it works, and how to configure your functions, check out the [lambda module +documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda). + ## Sample Usage @@ -81,7 +86,7 @@ More information: module "lambda_edge_multi_region_log_groups" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge-multi-region-log-groups?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge-multi-region-log-groups?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -146,7 +151,7 @@ module "lambda_edge_multi_region_log_groups" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge-multi-region-log-groups?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge-multi-region-log-groups?ref=v1.3.1" } inputs = { @@ -316,11 +321,11 @@ Map of log group names per region diff --git a/docs/reference/modules/terraform-aws-lambda/lambda-edge/lambda-edge.md b/docs/reference/modules/terraform-aws-lambda/lambda-edge/lambda-edge.md index 0227a5278..7922f8b62 100644 --- a/docs/reference/modules/terraform-aws-lambda/lambda-edge/lambda-edge.md +++ b/docs/reference/modules/terraform-aws-lambda/lambda-edge/lambda-edge.md @@ -9,13 +9,13 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # Lambda@Edge Function Module -View Source +View Source -Release Notes +Release Notes This module makes it easy to deploy and manage an [AWS Lambda@Edge](https://aws.amazon.com/lambda/edge/) function. Lambda@Edge gives you a way to run code on-demand in AWS Edge locations without having to manage servers. @@ -65,7 +65,7 @@ resource "aws_lambda_permission" "with_sns" { Lambda@Edge stores CloudWatch Logs in the AWS Regions closest to the location where the function receives traffic and is executed. That means a log group must be created in every region that have [Regional Edge Caches](https://aws.amazon.com/blogs/networking-and-content-delivery/aggregating-lambdaedge-logs/). -Instructions on how to do this can be found at the [`lambda-edge-multi-region-log-groups` module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/lambda-edge-multi-region-log-groups). To see which regions are receiving traffic, you can find graphs of metrics for the +Instructions on how to do this can be found at the [`lambda-edge-multi-region-log-groups` module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda-edge-multi-region-log-groups). To see which regions are receiving traffic, you can find graphs of metrics for the function on the CloudFront console and choose your region there. ## How to trigger this Lambda function from Cloudfront @@ -81,6 +81,11 @@ triggers: 2. Manually from the AWS Console as described in the [Lambda@Edge documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html#lambda-edge-add-triggers) +## Background info + +For more information on AWS Lambda, how it works, and how to configure your functions, check out the [lambda module +documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda). + ## Sample Usage @@ -94,7 +99,7 @@ triggers: module "lambda_edge" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -286,7 +291,7 @@ module "lambda_edge" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-edge?ref=v1.3.1" } inputs = { @@ -868,11 +873,11 @@ Name of the (optionally) created CloudWatch log groups for the lambda function. diff --git a/docs/reference/modules/terraform-aws-lambda/lambda-function-url/lambda-function-url.md b/docs/reference/modules/terraform-aws-lambda/lambda-function-url/lambda-function-url.md index b458a4614..a00ae3a28 100644 --- a/docs/reference/modules/terraform-aws-lambda/lambda-function-url/lambda-function-url.md +++ b/docs/reference/modules/terraform-aws-lambda/lambda-function-url/lambda-function-url.md @@ -9,17 +9,17 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # Lambda Function URL Module -View Source +View Source -Release Notes +Release Notes -This module used to create a [AWS Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) for existing Lambda function. A function URL is a dedicated HTTP(S) endpoint for a Lambda function. +This module is used to create an [AWS Lambda Function URL](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) for an existing Lambda function, along with a [CloudFront Origin Access Control (OAC)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-lambda.html) for securing access to the function URL via CloudFront. -When you create a function URL, Lambda automatically generates a unique URL endpoint for you. Once you create a function URL, its URL endpoint never changes. Function URLs are dual stack-enabled, supporting IPv4 and IPv6. After you configure a function URL for your function, you can invoke your function through its HTTP(S) endpoint via a web browser, curl, Postman, or any HTTP client. +A function URL is a dedicated HTTP(S) endpoint for a Lambda function. When you create a function URL, Lambda automatically generates a unique URL endpoint for you. Once you create a function URL, its URL endpoint never changes. Function URLs are dual stack-enabled, supporting IPv4 and IPv6. After you configure a function URL for your function, you can invoke your function through its HTTP(S) endpoint via a web browser, curl, Postman, or any HTTP client. Function URL endpoints have the following format: @@ -27,10 +27,97 @@ Function URL endpoints have the following format: https://.lambda-url..on.aws ``` +## What authorization types are available? + +The `authorization_type` variable controls how the function URL authenticates callers. There are two options: + +* **`AWS_IAM`**: Only authenticated IAM principals can invoke the function URL. Use this when you want to restrict access to specific IAM users or roles, or when fronting the function URL with CloudFront using OAC. +* **`NONE`**: The function URL is publicly accessible. Anyone with the URL can invoke the function. If you use this, you may want to add a `aws_lambda_permission` resource to explicitly allow public access: + +```hcl +resource "aws_lambda_permission" "allow_public_access" { + statement_id = "AllowPublicAccess" + action = "lambda:InvokeFunctionUrl" + function_name = module.my_lambda_function.function_name + qualifier = aws_lambda_alias.my_alias.name + principal = "*" + function_url_auth_type = "NONE" +} +``` + +## How do you configure CORS? + +By default, no CORS configuration is applied to the function URL. To enable CORS, pass a `cors_config` object: + +```hcl +module "lambda_function_url" { + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-function-url?ref=v1.0.0" + + lambda_function_name = module.my_lambda_function.function_name + alias = aws_lambda_alias.my_alias.name + authorization_type = "NONE" + + cors_config = { + allow_origins = ["https://example.com"] + allow_methods = ["GET", "POST"] + allow_headers = ["Content-Type", "Authorization"] + expose_headers = ["X-Custom-Header"] + allow_credentials = true + max_age = 86400 + } + + # ... other required variables +} +``` + +Set `cors_config` to `null` (the default) to disable CORS entirely. All fields within `cors_config` are optional. + +## How do you use this with CloudFront? + +This module creates a CloudFront Origin Access Control (OAC) alongside the function URL. The OAC allows you to front the Lambda function URL with a CloudFront distribution, giving you: + +* A custom domain name for your Lambda function +* CloudFront caching and edge locations +* AWS WAF integration for additional security +* Signed requests from CloudFront to your Lambda function + +To use the OAC, create a CloudFront distribution that uses the function URL as an origin and references the OAC: + +```hcl +module "lambda_function_url" { + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-function-url?ref=v1.0.0" + + lambda_function_name = module.my_lambda_function.function_name + alias = aws_lambda_alias.my_alias.name + authorization_type = "AWS_IAM" + cloudfront_oac_name = "my-lambda-oac" + + # ... other required variables +} + +resource "aws_cloudfront_distribution" "lambda_distribution" { + origin { + domain_name = replace(module.lambda_function_url.function_url, "/(^https://|/$)/", "") + origin_id = "lambda" + origin_access_control_id = module.lambda_function_url.oac_id + custom_origin_config { + http_port = 80 + https_port = 443 + origin_protocol_policy = "https-only" + origin_ssl_protocols = ["TLSv1.2"] + } + } + + # ... other CloudFront configuration +} +``` + +When using CloudFront with OAC, set `authorization_type` to `"AWS_IAM"` so that only CloudFront (via signed requests) can invoke the function URL directly. + ## Background info For more information on AWS Lambda, how it works, and how to configure your functions, check out the [lambda module -documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/lambda). +documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda). ## Sample Usage @@ -45,7 +132,7 @@ documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/ module "lambda_function_url" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-function-url?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-function-url?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -63,16 +150,6 @@ module "lambda_function_url" { # Name of the CloudFront Origin Access Control cloudfront_oac_name = - # CORS configuration for the Lambda function URL - cors_config = - # The name of the iam role to be created iam_role_name = @@ -91,6 +168,10 @@ module "lambda_function_url" { # OPTIONAL VARIABLES # ---------------------------------------------------------------------------------------------------- + # CORS configuration for the Lambda function URL. When null, no CORS + # configuration will be applied. + cors_config = null + # The type of origin that this Origin Access Control is for. Valid values are # lambda, mediapackagev2, mediastore, and s3 oac_origin_type = "lambda" @@ -110,7 +191,7 @@ module "lambda_function_url" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-function-url?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-function-url?ref=v1.3.1" } inputs = { @@ -131,16 +212,6 @@ inputs = { # Name of the CloudFront Origin Access Control cloudfront_oac_name = - # CORS configuration for the Lambda function URL - cors_config = - # The name of the iam role to be created iam_role_name = @@ -159,6 +230,10 @@ inputs = { # OPTIONAL VARIABLES # ---------------------------------------------------------------------------------------------------- + # CORS configuration for the Lambda function URL. When null, no CORS + # configuration will be applied. + cors_config = null + # The type of origin that this Origin Access Control is for. Valid values are # lambda, mediapackagev2, mediastore, and s3 oac_origin_type = "lambda" @@ -213,28 +288,6 @@ Name of the CloudFront Origin Access Control - - - -CORS configuration for the Lambda function URL - - - - -```hcl -object({ - allow_credentials = bool - allow_origins = list(string) - allow_methods = list(string) - allow_headers = list(string) - expose_headers = list(string) - max_age = number - }) -``` - - - - @@ -269,6 +322,29 @@ Determines how CloudFront signs (authenticates) requests. The only valid value i ### Optional + + + +CORS configuration for the Lambda function URL. When null, no CORS configuration will be applied. + + + + +```hcl +object({ + allow_credentials = optional(bool) + allow_origins = optional(list(string)) + allow_methods = optional(list(string)) + allow_headers = optional(list(string)) + expose_headers = optional(list(string)) + max_age = optional(number) + }) +``` + + + + + @@ -319,11 +395,11 @@ A generated ID for the endpoint. diff --git a/docs/reference/modules/terraform-aws-lambda/lambda-http-api-gateway/lambda-http-api-gateway.md b/docs/reference/modules/terraform-aws-lambda/lambda-http-api-gateway/lambda-http-api-gateway.md index 20af19be3..effc40702 100644 --- a/docs/reference/modules/terraform-aws-lambda/lambda-http-api-gateway/lambda-http-api-gateway.md +++ b/docs/reference/modules/terraform-aws-lambda/lambda-http-api-gateway/lambda-http-api-gateway.md @@ -9,7 +9,7 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + -View Source +View Source -Release Notes +Release Notes # Lambda Function HTTP API Gateway ## Overview -This module contains [Terraform](https://www.terraform.io) code to deploy [a HTTP (V2) API +This module contains [OpenTofu](https://opentofu.org)/[Terraform](https://www.terraform.io) code to deploy [a HTTP (V2) API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) to front Lambda functions so that they can be invoked on HTTP calls. @@ -39,7 +39,7 @@ they can be invoked on HTTP calls. :::note If you are looking for a simple proxy to route all requests to a Lambda function, refer to the -[api-gateway-proxy](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/api-gateway-proxy) module. +[api-gateway-proxy](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/api-gateway-proxy) module. ::: @@ -70,7 +70,7 @@ If you’ve never used the Gruntwork Modules before, make sure to read If you just want to try this repo out for experimenting and learning, check out the following resources: -* [examples/lambda-http-api-gateway](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples/lambda-http-api-gateway): This example contains sample code that uses +* [examples/lambda-http-api-gateway](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples/lambda-http-api-gateway): This example contains sample code that uses this module to route two different requests to two different Lambda functions. ## Manage @@ -94,7 +94,7 @@ information on route syntax that API Gateway expects. module "lambda_http_api_gateway" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-http-api-gateway?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-http-api-gateway?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -215,7 +215,7 @@ module "lambda_http_api_gateway" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-http-api-gateway?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda-http-api-gateway?ref=v1.3.1" } inputs = { @@ -728,11 +728,11 @@ A map from the route keys to the IDs of the corresponding API Gateway V2 Route r diff --git a/docs/reference/modules/terraform-aws-lambda/lambda/lambda.md b/docs/reference/modules/terraform-aws-lambda/lambda/lambda.md index 21bb3d1a5..a09cfb2fa 100644 --- a/docs/reference/modules/terraform-aws-lambda/lambda/lambda.md +++ b/docs/reference/modules/terraform-aws-lambda/lambda/lambda.md @@ -9,13 +9,13 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # Lambda Function Module -View Source +View Source -Release Notes +Release Notes This module makes it easy to deploy and manage an [AWS Lambda](https://aws.amazon.com/lambda/) function. Lambda gives you a way to run code on-demand in AWS without having to manage servers. @@ -141,7 +141,7 @@ Lambda function are still in use. If necessary, the variable `enable_eni_cleanup of the function from the VPC during `terraform destroy` and unblock the Security Group for destruction. Note: this requires the [`aws` cli tool](https://aws.amazon.com/cli/) to be installed. -Check out the [lambda-vpc example](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples/lambda-vpc) for working sample code. Make sure to note the Known Issues +Check out the [lambda-vpc example](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples/lambda-vpc) for working sample code. Make sure to note the Known Issues section in that example's README. ## How do you share Lambda functions across multiple AWS accounts? @@ -189,7 +189,7 @@ If you want to have a central S3 bucket that you use as a repository for your La module "lambda" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -508,7 +508,7 @@ module "lambda" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda?ref=v1.3.1" } inputs = { @@ -1440,11 +1440,11 @@ Optimization status of Lambda SnapStart. Possible values: 'On' (SnapStart is act diff --git a/docs/reference/modules/terraform-aws-lambda/run-lambda-entrypoint/run-lambda-entrypoint.md b/docs/reference/modules/terraform-aws-lambda/run-lambda-entrypoint/run-lambda-entrypoint.md index 64f1535ef..b1198d3a2 100644 --- a/docs/reference/modules/terraform-aws-lambda/run-lambda-entrypoint/run-lambda-entrypoint.md +++ b/docs/reference/modules/terraform-aws-lambda/run-lambda-entrypoint/run-lambda-entrypoint.md @@ -9,7 +9,7 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + -View Source +View Source -Release Notes +Release Notes # Lambda Container Entrypoint Command @@ -34,7 +34,7 @@ to the lambda runtime. This entrypoint will pull the provided secrets manager en secrets manager entry to environment variables that are injected into the lambda runtime. This module only includes an entrypoint CLI. If you are looking for a module to deploy container based Lambda functions, -refer to the [lambda](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/lambda) module. +refer to the [lambda](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda) module. ## Motivation @@ -66,7 +66,7 @@ application can be configured with environment variables). This repo is a part of the [the Gruntwork Infrastructure as Code Library](https://gruntwork.io/infrastructure-as-code-library/), a collection of reusable, battle-tested, production ready infrastructure code. If you’ve never used the Gruntwork Modules before, make sure to read -[Using Gruntwork Terraform Modules](https://docs.gruntwork.io/guides/working-with-code/using-modules)! +[Using Gruntwork OpenTofu/Terraform Modules](https://docs.gruntwork.io/guides/working-with-code/using-modules)! ::: @@ -78,7 +78,7 @@ If you’ve never used the Gruntwork Modules before, make sure to read If you just want to try this repo out for experimenting and learning, check out the following resources: -* [examples/lambda-docker](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples/lambda-docker): This example contains a sample `Dockerfile` that uses this +* [examples/lambda-docker](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples/lambda-docker): This example contains a sample `Dockerfile` that uses this entrypoint to expose secrets to a python based Lambda function. ## Manage @@ -133,7 +133,7 @@ To support this use case, the `run-lambda-entrypoint` CLI includes the ability t is not running in a Lambda environment. When `run-lambda-entrypoint` is invoked with the arg `--rie-path`, it will wrap the provided entrypoint script with the RIE when running in local mode. -Refer to the [secret-reflector-go](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/examples/lambda-docker/secret-reflector-go) example for an example of how to set +Refer to the [secret-reflector-go](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/examples/lambda-docker/secret-reflector-go) example for an example of how to set this up with a Go based Lambda function. ### How do I pass in Secrets Manager ARNs for environment variable lookup? @@ -183,11 +183,11 @@ will assume it is the name of a Secrets Manager entry in the same region as the diff --git a/docs/reference/modules/terraform-aws-lambda/scheduled-lambda-job/scheduled-lambda-job.md b/docs/reference/modules/terraform-aws-lambda/scheduled-lambda-job/scheduled-lambda-job.md index 5f6c6284c..02c5a75fe 100644 --- a/docs/reference/modules/terraform-aws-lambda/scheduled-lambda-job/scheduled-lambda-job.md +++ b/docs/reference/modules/terraform-aws-lambda/scheduled-lambda-job/scheduled-lambda-job.md @@ -9,22 +9,22 @@ import VersionBadge from '../../../../../src/components/VersionBadge.tsx'; import { HclListItem, HclListItemDescription, HclListItemTypeDetails, HclListItemDefaultValue, HclGeneralListItem } from '../../../../../src/components/HclListItem.tsx'; import { ModuleUsage } from "../../../../../src/components/ModuleUsage"; - + # Scheduled Lambda Job Module -View Source +View Source -Release Notes +Release Notes This module makes it easy to run an [AWS Lambda](https://aws.amazon.com/lambda/) function (such as one created with the -[lambda module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/lambda)) on a scheduled basis. This is useful for periodic background jobs, such as taking a +[lambda module](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda)) on a scheduled basis. This is useful for periodic background jobs, such as taking a daily snapshot of your servers. ## Background info For more information on AWS Lambda, how it works, and how to configure your functions, check out the [lambda module -documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/modules/lambda). +documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.1/modules/lambda). ## Sample Usage @@ -39,7 +39,7 @@ documentation](https://github.com/gruntwork-io/terraform-aws-lambda/tree/v1.3.0/ module "scheduled_lambda_job" { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/scheduled-lambda-job?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/scheduled-lambda-job?ref=v1.3.1" # ---------------------------------------------------------------------------------------------------- # REQUIRED VARIABLES @@ -90,7 +90,7 @@ module "scheduled_lambda_job" { # ------------------------------------------------------------------------------------------------------ terraform { - source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/scheduled-lambda-job?ref=v1.3.0" + source = "git::git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/scheduled-lambda-job?ref=v1.3.1" } inputs = { @@ -234,11 +234,11 @@ Cloudwatch Event Rule schedule expression