{"id":15641450,"url":"https://github.com/squidfunk/terraform-aws-api-gateway-enable-cors","last_synced_at":"2025-04-15T18:02:04.383Z","repository":{"id":44574044,"uuid":"136966409","full_name":"squidfunk/terraform-aws-api-gateway-enable-cors","owner":"squidfunk","description":"Easily add an OPTIONS method to an API Gateway resource to enable CORS","archived":false,"fork":false,"pushed_at":"2023-09-21T06:22:51.000Z","size":34,"stargazers_count":75,"open_issues_count":3,"forks_count":28,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T23:11:27.486Z","etag":null,"topics":["api-gateway","aws","cors","terraform"],"latest_commit_sha":null,"homepage":"","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/squidfunk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"squidfunk"}},"created_at":"2018-06-11T18:38:05.000Z","updated_at":"2024-11-23T01:26:27.000Z","dependencies_parsed_at":"2023-01-20T08:30:56.341Z","dependency_job_id":"41be6b16-ca2b-4077-b258-7a33851695e4","html_url":"https://github.com/squidfunk/terraform-aws-api-gateway-enable-cors","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squidfunk%2Fterraform-aws-api-gateway-enable-cors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squidfunk%2Fterraform-aws-api-gateway-enable-cors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squidfunk%2Fterraform-aws-api-gateway-enable-cors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squidfunk%2Fterraform-aws-api-gateway-enable-cors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squidfunk","download_url":"https://codeload.github.com/squidfunk/terraform-aws-api-gateway-enable-cors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249125963,"owners_count":21216705,"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":["api-gateway","aws","cors","terraform"],"created_at":"2024-10-03T11:42:34.348Z","updated_at":"2025-04-15T18:02:04.366Z","avatar_url":"https://github.com/squidfunk.png","language":"HCL","funding_links":["https://github.com/sponsors/squidfunk"],"categories":[],"sub_categories":[],"readme":"# Terraform AWS API Gateway Enable CORS\n\nA Terraform module to add an OPTIONS method to allow Cross-Origin Resource\nSharing (CORS) preflight requests.\n\n## Usage\n\n``` hcl\nmodule \"cors\" {\n  source = \"squidfunk/api-gateway-enable-cors/aws\"\n  version = \"0.3.3\"\n\n  api_id          = \"\u003capi_id\u003e\"\n  api_resource_id = \"\u003capi_resource_id\u003e\"\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## Configuration\n\nThe following variables can be configured:\n\n### Required\n\n#### `api_id`\n\n- **Description**: API identifier\n- **Default**: `none`\n\n#### `api_resource_id`\n\n- **Description**: API resource identifier\n- **Default**: `none`\n\n### Optional\n\n#### `allow_headers`\n\n- **Description**: Allow headers (`Access-Control-Allow-Headers`)\n- **Default**:\n\n    ``` hcl\n    [\n      \"Authorization\",\n      \"Content-Type\",\n      \"X-Amz-Date\",\n      \"X-Amz-Security-Token\",\n      \"X-Api-Key\"\n    ]\n    ```\n\n#### `allow_methods`\n\n- **Description**: Allow methods (`Access-Control-Allow-Methods`)\n- **Default**:\n\n    ``` hcl\n    [\n      \"OPTIONS\",\n      \"HEAD\",\n      \"GET\",\n      \"POST\",\n      \"PUT\",\n      \"PATCH\",\n      \"DELETE\"\n    ]\n    ```\n#### `allow_origin`\n\n- **Description**: Allow origin (`Access-Control-Allow-Origin`)\n- **Default**: `\"*\"`\n\n#### `allow_max_age`\n\n- **Description**: Allow caching time (`Access-Control-Allow-Max-Age`)\n- **Default**: `\"7200\"`\n\n#### `allow_credentials`\n\n- **Description**: Allow credentials (`Access-Control-Allow-Credentials`)\n- **Default**: `none`\n\n### Outputs\n\nNone.\n\n## License\n\n**MIT License**\n\nCopyright (c) 2018-2020 Martin Donath\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquidfunk%2Fterraform-aws-api-gateway-enable-cors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquidfunk%2Fterraform-aws-api-gateway-enable-cors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquidfunk%2Fterraform-aws-api-gateway-enable-cors/lists"}