{"id":21957058,"url":"https://github.com/trussworks/terraform-aws-lambda","last_synced_at":"2025-04-23T15:52:20.941Z","repository":{"id":40495258,"uuid":"186450005","full_name":"trussworks/terraform-aws-lambda","owner":"trussworks","description":"Terraform module for creating AWS Lambda jobs with appropriate log configurations.","archived":false,"fork":false,"pushed_at":"2023-08-07T20:24:18.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":13,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-30T01:11:43.989Z","etag":null,"topics":["aws","aws-lambda","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/trussworks/lambda","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trussworks.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-13T15:44:25.000Z","updated_at":"2024-10-03T14:17:55.000Z","dependencies_parsed_at":"2024-11-29T08:49:21.817Z","dependency_job_id":"e0e008c4-aeaf-44bc-a162-699708e5baef","html_url":"https://github.com/trussworks/terraform-aws-lambda","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussworks%2Fterraform-aws-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussworks%2Fterraform-aws-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussworks%2Fterraform-aws-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussworks%2Fterraform-aws-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trussworks","download_url":"https://codeload.github.com/trussworks/terraform-aws-lambda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250467015,"owners_count":21435441,"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","aws-lambda","terraform","terraform-modules"],"created_at":"2024-11-29T08:49:10.396Z","updated_at":"2025-04-23T15:52:20.923Z","avatar_url":"https://github.com/trussworks.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"Creates a lambda function with associated role and policies, which\nwill log to Cloudwatch Logs.\n\nCreates the following resources:\n\n* Lambda function\n* IAM role with policy to allow logging to Cloudwatch Logs\n* Cloudwatch Logs group\n\n## Usage\n\n```hcl\nmodule \"my_lambda_function\" {\n  source                 = \"trussworks/lambda/aws\"\n  name                   = \"my_app\"\n  job_identifier         = \"instance_alpha\"\n  runtime                = \"go1.x\"\n  role_policy_arns_count = 1\n  role_policy_arns       = [aws_iam_policy.my_app_lambda_policy.arn]\n  s3_bucket              = \"my_s3_bucket\"\n  s3_key                 = \"my_app/1.0/my_app.zip\"\n\n  subnet_ids             = [\"subnet-0123456789abcdef0\"]\n  security_group_ids     = [\"sg-0123456789abcdef0\"]\n\n  source_types           = [\"events\"]\n  source_arns            = [aws_cloudwatch_event_rule.trigger.arn]\n\n  env_vars = {\n    VARNAME = \"value\"\n  }\n\n  tags = {\n    \"Service\" = \"big_app\"\n  }\n\n}\n```\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.0 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | \u003e= 3.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e= 3.0 |\n| \u003ca name=\"provider_null\"\u003e\u003c/a\u003e [null](#provider\\_null) | n/a |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_cloudwatch_log_group.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |\n| [aws_iam_role.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_iam_role_policy.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |\n| [aws_iam_role_policy_attachment.user_policy_attach](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n| [aws_lambda_function.main_from_gh](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource |\n| [aws_lambda_function.main_from_s3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource |\n| [aws_lambda_permission.allow_source_gh](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |\n| [aws_lambda_permission.allow_source_s3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |\n| [null_resource.get_github_release_artifact](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |\n| [null_resource.verify_policy_list_count](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |\n| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |\n| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_iam_policy_document.logs_policy_doc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |\n| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_cloudwatch_encryption_key_arn\"\u003e\u003c/a\u003e [cloudwatch\\_encryption\\_key\\_arn](#input\\_cloudwatch\\_encryption\\_key\\_arn) | The arn of the encryption key to be used for the cloudwatch logs | `string` | `\"\"` | no |\n| \u003ca name=\"input_cloudwatch_logs_retention_days\"\u003e\u003c/a\u003e [cloudwatch\\_logs\\_retention\\_days](#input\\_cloudwatch\\_logs\\_retention\\_days) | Number of days to retain logs in Cloudwatch Logs | `string` | `30` | no |\n| \u003ca name=\"input_env_vars\"\u003e\u003c/a\u003e [env\\_vars](#input\\_env\\_vars) | Map of environment variables for Lambda function | `map(any)` | `{}` | no |\n| \u003ca name=\"input_ephemeral_storage\"\u003e\u003c/a\u003e [ephemeral\\_storage](#input\\_ephemeral\\_storage) | Size in MB of Lambda function ephemeral storage allocation | `string` | `512` | no |\n| \u003ca name=\"input_github_filename\"\u003e\u003c/a\u003e [github\\_filename](#input\\_github\\_filename) | Name of the file to get when building url to pull. | `string` | `\"deployment.zip\"` | no |\n| \u003ca name=\"input_github_project\"\u003e\u003c/a\u003e [github\\_project](#input\\_github\\_project) | The unique Github project to pull from. Currently, this must be public. Eg. 'trussworks/aws-iam-sleuth' | `string` | `\"\"` | no |\n| \u003ca name=\"input_github_release\"\u003e\u003c/a\u003e [github\\_release](#input\\_github\\_release) | The release tag to download. | `string` | `\"\"` | no |\n| \u003ca name=\"input_handler\"\u003e\u003c/a\u003e [handler](#input\\_handler) | The entrypoint function for the lambda function. | `string` | `\"main.Main\"` | no |\n| \u003ca name=\"input_job_identifier\"\u003e\u003c/a\u003e [job\\_identifier](#input\\_job\\_identifier) | Identifier for specific instance of Lambda function | `string` | n/a | yes |\n| \u003ca name=\"input_memory_size\"\u003e\u003c/a\u003e [memory\\_size](#input\\_memory\\_size) | Size in MB of Lambda function memory allocation | `string` | `128` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | Lambda function name | `string` | n/a | yes |\n| \u003ca name=\"input_publish\"\u003e\u003c/a\u003e [publish](#input\\_publish) | Whether to publish creation/change as new Lambda Function Version. | `bool` | `false` | no |\n| \u003ca name=\"input_role_policy_arns\"\u003e\u003c/a\u003e [role\\_policy\\_arns](#input\\_role\\_policy\\_arns) | List of policy ARNs to attach to Lambda role | `list(any)` | n/a | yes |\n| \u003ca name=\"input_role_policy_arns_count\"\u003e\u003c/a\u003e [role\\_policy\\_arns\\_count](#input\\_role\\_policy\\_arns\\_count) | Count of policy ARNs to attach to Lambda role | `string` | n/a | yes |\n| \u003ca name=\"input_runtime\"\u003e\u003c/a\u003e [runtime](#input\\_runtime) | Lambda runtime type | `string` | n/a | yes |\n| \u003ca name=\"input_s3_bucket\"\u003e\u003c/a\u003e [s3\\_bucket](#input\\_s3\\_bucket) | Name of s3 bucket used for Lambda build | `string` | `\"\"` | no |\n| \u003ca name=\"input_s3_key\"\u003e\u003c/a\u003e [s3\\_key](#input\\_s3\\_key) | Key for s3 object for Lambda function code | `string` | `\"\"` | no |\n| \u003ca name=\"input_security_group_ids\"\u003e\u003c/a\u003e [security\\_group\\_ids](#input\\_security\\_group\\_ids) | List of security group IDs for Lambda VPC config (leave empty if no VPC) | `list(any)` | `[]` | no |\n| \u003ca name=\"input_source_arns\"\u003e\u003c/a\u003e [source\\_arns](#input\\_source\\_arns) | List of arns for Lambda triggers; order must match source\\_types | `list(any)` | `[]` | no |\n| \u003ca name=\"input_source_types\"\u003e\u003c/a\u003e [source\\_types](#input\\_source\\_types) | List of sources for Lambda triggers; order must match source\\_arns | `list(any)` | `[]` | no |\n| \u003ca name=\"input_subnet_ids\"\u003e\u003c/a\u003e [subnet\\_ids](#input\\_subnet\\_ids) | List of subnet IDs for Lambda VPC config (leave empty if no VPC) | `list(any)` | `[]` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | Map of tags for Lambda function | `map(any)` | `{}` | no |\n| \u003ca name=\"input_timeout\"\u003e\u003c/a\u003e [timeout](#input\\_timeout) | Timeout in seconds for Lambda function timeout | `string` | `60` | no |\n| \u003ca name=\"input_validation_sha\"\u003e\u003c/a\u003e [validation\\_sha](#input\\_validation\\_sha) | SHA to validate the file. | `string` | `\"\"` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_function_name\"\u003e\u003c/a\u003e [function\\_name](#output\\_function\\_name) | Name of the AWS Lambda function |\n| \u003ca name=\"output_invoke_arn\"\u003e\u003c/a\u003e [invoke\\_arn](#output\\_invoke\\_arn) | ARN used to invoke Lambda function from API Gateway |\n| \u003ca name=\"output_lambda_arn\"\u003e\u003c/a\u003e [lambda\\_arn](#output\\_lambda\\_arn) | ARN for the Lambda function |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrussworks%2Fterraform-aws-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrussworks%2Fterraform-aws-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrussworks%2Fterraform-aws-lambda/lists"}