{"id":19580486,"url":"https://github.com/dod-iac/terraform-aws-api-gateway-cors-lambda-proxy","last_synced_at":"2025-02-26T12:15:10.020Z","repository":{"id":113970833,"uuid":"376147332","full_name":"dod-iac/terraform-aws-api-gateway-cors-lambda-proxy","owner":"dod-iac","description":"A Terraform module to create a Cross-Origin Resource Sharing (CORS) Lambda Proxy","archived":false,"fork":false,"pushed_at":"2021-06-14T21:10:16.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-09T05:18:01.357Z","etag":null,"topics":["cors","lambda","proxy","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/dod-iac/api-gateway-cors-lambda-proxy/aws/latest","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,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-11T21:36:57.000Z","updated_at":"2021-08-04T17:46:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"18dfa880-05ff-40d1-9c38-6659bd0f663e","html_url":"https://github.com/dod-iac/terraform-aws-api-gateway-cors-lambda-proxy","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-api-gateway-cors-lambda-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dod-iac%2Fterraform-aws-api-gateway-cors-lambda-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dod-iac%2Fterraform-aws-api-gateway-cors-lambda-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dod-iac%2Fterraform-aws-api-gateway-cors-lambda-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dod-iac","download_url":"https://codeload.github.com/dod-iac/terraform-aws-api-gateway-cors-lambda-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240849053,"owners_count":19867617,"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":["cors","lambda","proxy","terraform","terraform-module"],"created_at":"2024-11-11T07:26:49.107Z","updated_at":"2025-02-26T12:15:09.700Z","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# Terraform AWS API Gateway CORS Lambda Proxy\n\n## Description\n\nA Terraform module to create a Cross-Origin Resource Sharing (CORS) Lambda Proxy.\n\nOrignal code forked from [squidfunk/terraform-aws-api-gateway-enable-cors](https://github.com/squidfunk/terraform-aws-api-gateway-enable-cors)\n\n## Usage\n\n``` hcl\nmodule \"cors_lambda\" {\n  source = \"dod-iac/api-gateway-cors-lambda-proxy/aws\"\n  version = \"1.0.0\"\n\n  api_id            = aws_api_gateway_rest_api.main_api.id\n  api_resource_id   = aws_api_gateway_resource.main_api_streams_resource.id\n  http_method       = \"GET\"\n  invoke_arn        = aws_lambda_function.stream_lambda.invoke_arn\n  invoke_policy_arn = aws_iam_role.api_role.arn\n  allow_methods = [\n    \"OPTIONS\",\n    \"GET\"\n  ]\n  allow_headers = [\n    \"Authorization\",\n    \"Content-Type\",\n    \"X-Amz-Date\",\n    \"X-Amz-Security-Token\",\n    \"X-Api-Key\",\n    \"next-query\",\n  ]\n}\n```\n\nBy default, this will create a new `MOCK` endpoint on the provided API Gateway\nresource allowing CORS preflight requests for **all methods** and\n**all origins** by default. Of course this can be customized using variables\nas stated in the next section.\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 0.13 |\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\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_api_gateway_integration._](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_integration) | resource |\n| [aws_api_gateway_integration_response._](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_integration_response) | resource |\n| [aws_api_gateway_method._](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method) | resource |\n| [aws_api_gateway_method_response._](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method_response) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_allow_credentials\"\u003e\u003c/a\u003e [allow\\_credentials](#input\\_allow\\_credentials) | Allow credentials (`Access-Control-Allow-Credentials`) | `bool` | `false` | no |\n| \u003ca name=\"input_allow_headers\"\u003e\u003c/a\u003e [allow\\_headers](#input\\_allow\\_headers) | Allow headers (`Access-Control-Allow-Headers`) | `list(string)` | \u003cpre\u003e[\u003cbr\u003e  \"Authorization\",\u003cbr\u003e  \"Content-Type\",\u003cbr\u003e  \"X-Amz-Date\",\u003cbr\u003e  \"X-Amz-Security-Token\",\u003cbr\u003e  \"X-Api-Key\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_allow_max_age\"\u003e\u003c/a\u003e [allow\\_max\\_age](#input\\_allow\\_max\\_age) | Allow response caching time (`Access-Control-Allow-Max-Age`) | `string` | `\"7200\"` | no |\n| \u003ca name=\"input_allow_methods\"\u003e\u003c/a\u003e [allow\\_methods](#input\\_allow\\_methods) | Allow methods (`Access-Control-Allow-Methods`) | `list(string)` | \u003cpre\u003e[\u003cbr\u003e  \"OPTIONS\",\u003cbr\u003e  \"HEAD\",\u003cbr\u003e  \"GET\",\u003cbr\u003e  \"POST\",\u003cbr\u003e  \"PUT\",\u003cbr\u003e  \"PATCH\",\u003cbr\u003e  \"DELETE\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_allow_origin\"\u003e\u003c/a\u003e [allow\\_origin](#input\\_allow\\_origin) | Allow origin (`Access-Control-Allow-Origin`) | `string` | `\"*\"` | no |\n| \u003ca name=\"input_api_id\"\u003e\u003c/a\u003e [api\\_id](#input\\_api\\_id) | API identifier | `any` | n/a | yes |\n| \u003ca name=\"input_api_resource_id\"\u003e\u003c/a\u003e [api\\_resource\\_id](#input\\_api\\_resource\\_id) | API resource identifier | `any` | n/a | yes |\n| \u003ca name=\"input_http_method\"\u003e\u003c/a\u003e [http\\_method](#input\\_http\\_method) | API http method | `any` | n/a | yes |\n| \u003ca name=\"input_invoke_arn\"\u003e\u003c/a\u003e [invoke\\_arn](#input\\_invoke\\_arn) | API Lambda Invoke ARN | `any` | n/a | yes |\n| \u003ca name=\"input_invoke_policy_arn\"\u003e\u003c/a\u003e [invoke\\_policy\\_arn](#input\\_invoke\\_policy\\_arn) | IAM Policy to allow Lambda invoke | `any` | n/a | yes |\n\n## Outputs\n\nNo outputs.\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-api-gateway-cors-lambda-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdod-iac%2Fterraform-aws-api-gateway-cors-lambda-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdod-iac%2Fterraform-aws-api-gateway-cors-lambda-proxy/lists"}