{"id":19580409,"url":"https://github.com/dod-iac/terraform-aws-lambda-edge-function","last_synced_at":"2025-04-27T08:32:17.609Z","repository":{"id":53828433,"uuid":"255458961","full_name":"dod-iac/terraform-aws-lambda-edge-function","owner":"dod-iac","description":"AWS Lambda Function for use with Lambda@Edge","archived":false,"fork":false,"pushed_at":"2021-03-12T00:30:29.000Z","size":8,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T23:32:19.087Z","etag":null,"topics":["aws","lambda","terraform"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/dod-iac/lambda-edge-function/aws","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dod-iac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-13T22:55:47.000Z","updated_at":"2021-11-11T22:11:04.000Z","dependencies_parsed_at":"2022-08-22T04:20:59.002Z","dependency_job_id":null,"html_url":"https://github.com/dod-iac/terraform-aws-lambda-edge-function","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dod-iac%2Fterraform-aws-lambda-edge-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dod-iac%2Fterraform-aws-lambda-edge-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dod-iac%2Fterraform-aws-lambda-edge-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dod-iac%2Fterraform-aws-lambda-edge-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dod-iac","download_url":"https://codeload.github.com/dod-iac/terraform-aws-lambda-edge-function/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251112549,"owners_count":21538162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","lambda","terraform"],"created_at":"2024-11-11T07:25:32.427Z","updated_at":"2025-04-27T08:32:14.559Z","avatar_url":"https://github.com/dod-iac.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Usage\n\nCreates an AWS Lambda Function for use with Lambda@Edge, which runs AWS Lambda Functions at CloudFront edge locations.\n\nThere are a variety of [restrictions for functions used with Lambda@Edge](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-requirements-limits.html#lambda-requirements-lambda-function-configuration).\n\n```hcl\nmodule \"lambda_function\" {\n  source = \"dod-iac/lambda-edge-function/aws\"\n\n  execution_role_name = format(\n    \"app-%s-redirect-lambda-execution-role-%s\",\n    var.application,\n    var.environment\n  )\n\n  function_name = format(\n    \"app-%s-redirect-%s-%s\",\n    var.application,\n    var.environment,\n    data.aws_region.current.name\n  )\n\n  function_description = \"Function used to redirect requests.\"\n\n  filename = format(\"../../lambda/%s-redirect.zip\", var.application)\n\n  handler = \"index.handler\"\n\n  runtime = \"nodejs12.x\"\n\n  environment_variables = var.environment_variables\n\n  tags = {\n    Application = var.application\n    Environment = var.environment\n    Automation  = \"Terraform\"\n  }\n}\n```\n\nUse the `execution_role_policy_document` variable to override the IAM policy document for the IAM role.\n\nSince you can only use Lambda function in the US East (us-east-1) data center with Lambda@Edge, you may need to pass an aliased provider to this module.  An example is below.\n\n```hcl\nmodule \"lambda_function\" {\n  source = \"dod-iac/lambda-edge-function/aws\"\n\n  providers = {\n    aws = aws.us-east-1\n  }\n\n}\n```\n\n## Terraform Version\n\nTerraform 0.12. Pin module version to ~\u003e 1.0.0 . Submit pull-requests to master branch.\n\nTerraform 0.11 is not supported.\n\n## License\n\nThis project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105.  However, because the project utilizes code licensed from contributors and other third parties, it therefore is licensed under the MIT License.  See LICENSE file for more information.\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| terraform | \u003e= 0.13 |\n| aws | ~\u003e 3.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| aws | ~\u003e 3.0 |\n\n## Modules\n\nNo Modules.\n\n## Resources\n\n| Name |\n|------|\n| [aws_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) |\n| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) |\n| [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) |\n| [aws_iam_role_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) |\n| [aws_lambda_function](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) |\n| [aws_partition](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| execution\\_role\\_name | n/a | `string` | n/a | yes |\n| execution\\_role\\_policy\\_document | The contents of the IAM policy attached to the IAM Execution role used by the Lambda.  If not defined, then creates the policy with permissions to log to CloudWatch Logs. | `string` | `\"\"` | no |\n| execution\\_role\\_policy\\_name | The name of the IAM policy attached to the IAM Execution role used by the Lambda.  If not defined, then uses the value of \"execution\\_role\\_name\". | `string` | `\"\"` | no |\n| filename | The path to the function's deployment package within the local filesystem.  If defined, the s3\\_-prefixed options cannot be used. | `string` | n/a | yes |\n| function\\_description | Description of what your Lambda Function does. | `string` | `\"\"` | no |\n| function\\_name | A unique name for your Lambda Function. | `string` | n/a | yes |\n| handler | The function entrypoint in your code. | `string` | n/a | yes |\n| memory\\_size | Amount of memory in MB your Lambda Function can use at runtime.  Maximum value for Viewer Request or Response events is 128. | `number` | `128` | no |\n| runtime | The identifier of the function's runtime. | `string` | n/a | yes |\n| tags | A mapping of tags to assign to the Lambda Function. | `map(string)` | \u003cpre\u003e{\u003cbr\u003e  \"Automation\": \"Terraform\"\u003cbr\u003e}\u003c/pre\u003e | no |\n| timeout | The amount of time your Lambda Function has to run in seconds.  Maximum value is 5 seconds. | `number` | `3` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| lambda\\_execution\\_role\\_arn | The  Amazon Resource Name (ARN) identifying the IAM Role used to execute this Lambda. |\n| lambda\\_function\\_arn | The Amazon Resource Name (ARN) identifying your Lambda Function. |\n| lambda\\_function\\_name | A unique name for your Lambda Function. |\n| lambda\\_function\\_qualified\\_arn | The Amazon Resource Name (ARN) identifying your Lambda Function Version. |\n| lambda\\_invoke\\_arn | The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws\\_api\\_gateway\\_integration's uri. |\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdod-iac%2Fterraform-aws-lambda-edge-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdod-iac%2Fterraform-aws-lambda-edge-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdod-iac%2Fterraform-aws-lambda-edge-function/lists"}