Terraform module for defining and managing an AWS Lambda function.
- AWS Lambda Documentation:
- Terragrunt: view Terragrunt usage exmaple
- Terraform: view vanilla Terraform usage exmaple
| Name | Version |
|---|---|
| terraform | 1.3.2 |
| aws | ~> 4.34.0 |
| Name | Version |
|---|---|
| aws | ~> 4.34.0 |
No modules.
| Name | Type |
|---|---|
| aws_iam_policy.Lambda_ExecRole_Policies_Map | resource |
| aws_iam_role.Lambda_ExecRole | resource |
| aws_iam_role_policy_attachment.Lambda_ExecRole | resource |
| aws_lambda_event_source_mapping.list | resource |
| aws_lambda_function.this | resource |
| aws_lambda_permission.map | resource |
| aws_lambda_provisioned_concurrency_config.this | resource |
| aws_iam_policy_document.Lambda_ExecRole_Policies_Map | data source |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| dead_letter_target_arn | (Optional) ARN of SNS Topic or SQS Queue to notify when a function invocation fails. If this option is used, the function's IAM role must be granted suitable access to write to the target object, which means allowing either the sns:Publish or sqs:SendMessage action on this ARN, depending on which service is targeted. |
string |
null |
no |
| deployment_package_src | The Lambda deployment package source; must be either an absolute path to an executable on the local filesystem, an image URI, or an object configuring retrieval from an S3 bucket. |
object({ |
n/a | yes |
| description | (Optional) The Lambda function description. | string |
null |
no |
| environment_variables | (Optional) Map of env vars to make accessible to the function during execution. | map(string) |
null |
no |
| event_source_mapping | (Optional) Config object to setup an event source mapping for the Lambda function. This allows Lambda functions to get events from Kinesis, DynamoDB, SQS, Amazon MQ and Managed Streaming for Apache Kafka (MSK). Reference documentation for these arguments is available here. |
object({ |
null |
no |
| execution_role | Config object for the Lambda function's execution role. | object({ |
n/a | yes |
| handler | (Optional) The Lambda function handler. | string |
"index.handler" |
no |
| lambda_permissions | (Optional) Map of principal names to Lambda permission config objects. Gives an external source (like an EventBridge Rule, SNS, or S3) permission to access the Lambda function. The principals can be AWS services, like "events.amazonaws.com", or AWS account IDs - any external principal that requires permission to invoke the Lambda function. With "qualifier" you can optionally narrow the permission to just a specific version or function alias. To ensure the permissions granted are not too broad, AWS service principals must be provided with a "source_arn"; for example, if the principal is EventBridge (events.amazonaws.com), the "source_arn" would be that of the EventBridge Rule. "principal_org_id" can be used to provide permissions to all accounts within an Organization. |
map( |
{} |
no |
| name | The Lambda function name. | string |
n/a | yes |
| provisioned_concurrent_executions | (Optional) Amount of capacity to allocate. Must be greater than or equal to 1 (default 1). | number |
1 |
no |
| runtime | (Optional) The Lambda function runtime; see link below for valid runtime values. https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-Runtime |
string |
null |
no |
| should_publish_new_version | (Optional) Whether changes implemented by the module call should result in a new version of the Lambda function; this is applicable to changes made to existing Lambda functions as well as the creation of new ones. |
bool |
true |
no |
| tags | (Optional) The Lambda function tags. | map(string) |
null |
no |
| vpc_config | (Optional) VPC configs for the Lambda function. | object({ |
null |
no |
| Name | Description |
|---|---|
| Lambda_Event_Source_Mappings | Map of Lambda event source mapping resource objects. |
| Lambda_Function | The Lambda function resource object. |
| Lambda_Function_ExecutionRole | The Lambda function execution role resource object. |
| Lambda_Function_Permissions | Map of Lambda function permission resource objects. |
| Lambda_Function_Provisioned_Concurrency_Config | The Lambda function provisoined concurrency config resource object. |
All scripts and source code contained herein are for commercial use only by Nerdware, LLC.
See LICENSE for more information.