{"id":21202517,"url":"https://github.com/infrablocks/terraform-aws-api-gateway-v2","last_synced_at":"2025-07-10T06:33:06.677Z","repository":{"id":38316082,"uuid":"493209936","full_name":"infrablocks/terraform-aws-api-gateway-v2","owner":"infrablocks","description":"Terraform module for deploying an API gateway to AWS using the V2 API","archived":false,"fork":false,"pushed_at":"2024-10-16T06:37:01.000Z","size":245,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-17T23:27:06.475Z","etag":null,"topics":["api-gateway","aws","infrastructure","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/infrablocks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-05-17T10:52:08.000Z","updated_at":"2024-10-16T06:37:03.000Z","dependencies_parsed_at":"2023-11-07T03:04:48.333Z","dependency_job_id":"e0fc7c42-ab53-4474-a715-b9f8f5191e53","html_url":"https://github.com/infrablocks/terraform-aws-api-gateway-v2","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-api-gateway-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-api-gateway-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-api-gateway-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-api-gateway-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infrablocks","download_url":"https://codeload.github.com/infrablocks/terraform-aws-api-gateway-v2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225622825,"owners_count":17498170,"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","infrastructure","terraform","terraform-modules"],"created_at":"2024-11-20T20:16:40.193Z","updated_at":"2024-11-20T20:16:40.829Z","avatar_url":"https://github.com/infrablocks.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Terraform AWS API Gateway V2\n============================\n\n[![Version](https://img.shields.io/github/v/tag/infrablocks/terraform-aws-api-gateway-v2?label=version\u0026sort=semver)](https://github.com/infrablocks/terraform-aws-api-gateway-v2/tags)\n[![Build Pipeline](https://img.shields.io/circleci/build/github/infrablocks/terraform-aws-api-gateway-v2/main?label=build-pipeline)](https://app.circleci.com/pipelines/github/infrablocks/terraform-aws-api-gateway-v2?filter=all)\n[![Maintainer](https://img.shields.io/badge/maintainer-go--atomic.io-red)](https://go-atomic.io)\n\nA Terraform module and associated submodules for building an API Gateway\nusing the V2 API.\n\nThe `infrablocks/api-gateway-v2/aws` root module:\n\n* has no prerequisite requirements\n* consists of:\n    * an API Gateway API\n    * an optional default API Gateway stage for the API\n\nAdditionally, this module includes 3 submodules:\n\n* `infrablocks/api-gateway-v2/aws//modules/stage` for managing an API\n  Gateway stage for the API\n* `infrablocks/api-gateway-v2/aws//modules/vpc_link` for managing a VPC link\n  for the API\n* `infrablocks/api-gateway-v2/aws//modules/log_permissions` for creating and\n  configuring a logging role for API Gateway\n\nThe `infrablocks/api-gateway-v2/aws//modules/stage` module:\n\n* requires an existing API Gateway API as created by the root module\n* consists of:\n    * an API Gateway stage\n    * a Cloudwatch log group for access logging\n    * an optional API Gateway domain name and API mapping\n    * an optional DNS record for the configured domain\n\nThe `infrablocks/api-gateway-v2/aws//modules/vpc_link` module:\n\n* requires:\n    * an existing VPC including subnets\n* consists of:\n    * an API Gateway VPC link\n    * an optional default security group for the VPC link\n\nThe `infrablocks/api-gateway-v2/aws//modules/log_permissions` module:\n\n* has no prerequisite requirements\n* consists of:\n    * an IAM role allowing the API Gateway service to manage Cloudwatch logs\n    * configuration of the IAM role against the API Gateway service\n\nUsage\n-----\n\nTo use the `infrablocks/api-gateway-v2/aws` root module, include something like\nthe following in your Terraform configuration:\n\n```terraform\nmodule \"api_gateway\" {\n  source  = \"infrablocks/api-gateway-v2/aws\"\n  version = \"1.0.0\"\n\n  component             = \"api-gw\"\n  deployment_identifier = \"production\"\n\n  protocol_type = \"HTTP\"\n\n  default_stage_domain_name                 = \"example.com\"\n  default_stage_domain_name_certificate_arn = \"arn:aws:acm:eu-west-2:123456789101:certificate/31bd2209-f35b-4668-b48b-324f44fedc7e\"\n\n  hosted_zone_id = \"Z0901234DIVFOTMNA324\"\n\n  tags = {\n    Role: \"webhooks\"\n  }\n\n  providers = {\n    aws = aws\n    aws.dns = aws\n  }\n}\n```\n\nThen to use the `infrablocks/api-gateway-v2/aws//modules/stage` submodule:\n\n```terraform\nmodule \"stage\" {\n  source  = \"infrablocks/api-gateway-v2/aws//modules/stage\"\n  version = \"1.0.0\"\n\n  component             = \"api-gw\"\n  deployment_identifier = \"production\"\n\n  name   = \"testing\"\n  api_id = module.api_gateway.api_gateway_id\n\n  domain_name                 = \"example.com\"\n  domain_name_certificate_arn = \"arn:aws:acm:eu-west-2:123456789101:certificate/31bd2209-f35b-4668-b48b-324f44fedc7e\"\n\n  hosted_zone_id = \"Z0901234DIVFOTMNA324\"\n\n  tags = {\n    Role: \"webhooks\"\n  }\n\n  providers = {\n    aws = aws\n    aws.dns = aws.dns\n  }\n}\n```\n\nThe `infrablocks/api-gateway-v2/aws//modules/vpc_link` submodule should be used\nonce per VPC with which AWS Gateway needs to communicate:\n\n```terraform\nmodule \"domain\" {\n  source  = \"infrablocks/api-gateway-v2/aws//modules/vpc_link\"\n  version = \"2.0.0\"\n\n  component             = \"api-gw\"\n  deployment_identifier = \"production\"\n\n  vpc_id              = module.base_networking.vpc_id\n  vpc_link_subnet_ids = module.base_networking.private_subnet_ids\n\n  tags = {\n    Service: \"payments\"\n  }\n}\n```\n\nThe `infrablocks/api-gateway-v2/aws//modules/log_permissions` submodule should be\nused once per account, as follows:\n\n```terraform\nmodule \"domain\" {\n  source  = \"infrablocks/api-gateway-v2/aws//modules/log_permissions\"\n  version = \"1.0.0\"\n}\n```\n\nSee the\n[Terraform registry entry](https://registry.terraform.io/modules/infrablocks/api-gateway-v2/aws/latest)\nfor more details.\n\n### Inputs\n\n#### Root Module\n\n| Name                                        | Description                                                                                                                                                                                          | Default  |                                   Required                                    |\n|---------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:|:-----------------------------------------------------------------------------:|\n| `component`                                 | The component for which this API gateway exists.                                                                                                                                                     |    -     |                                      Yes                                      |\n| `deployment_identifier`                     | An identifier for this instantiation.                                                                                                                                                                |    -     |                                      Yes                                      |\n| `protocol_type`                             | The API protocol to use for the API gateway.                                                                                                                                                         | `\"HTTP\"` |                                      No                                       |\n| `hosted_zone_id`                            | The ID of the Route 53 hosted zone in which to create DNS records.                                                                                                                                   |    -     | If `include_default_stage` and `include_default_stage_dns_record` are `true`  |\n| `default_stage_domain_name`                 | The domain name to map to the API gateway's default stage. Required when both the default stage and default stage domain name are included.                                                          |    -     | If `include_default_stage` and `include_default_stage_domain_name` are `true` |\n| `default_stage_domain_name_certificate_arn` | The ARN of an AWS managed certificate to use for the default stage domain name. Required when both the default stage and default stage domain name are included.                                     |    -     | If `include_default_stage` and `include_default_stage_domain_name` are `true` |\n| `tags`                                      | Additional tags to set on created resources.                                                                                                                                                         |   `{}`   |                                      No                                       |\n| `include_default_tags`                      | Whether or not to include default tags on created resources.                                                                                                                                         |  `true`  |                                      No                                       |\n| `include_default_stage`                     | Whether or not to create a default stage for the API gateway.                                                                                                                                        |  `true`  |                                      No                                       |\n| `include_default_stage_domain_name`         | Whether or not to create a domain name for the default stage of the API gateway. Only relevant when the default stage is included.                                                                   |  `true`  |                                      No                                       |\n| `include_default_stage_dns_record`          | Whether or not to create a DNS record in Route 53 for the domain name of the default stage of the API gateway. Only relevant when both the default stage and default stage domain name are included. |  `true`  |                                      No                                       |\n| `enable_execute_api_endpoint`               | Whether or not to enable the execute API endpoint on the API gateway.                                                                                                                                |  `true`  |                                      No                                       |\n| `enable_default_stage_auto_deploy`          | Whether or not to enable auto-deploy for the created default stage. Only relevant when the default stage is included.                                                                                |  `true`  |                                      No                                       |\n\n#### Stage Sub-module\n\n| Name                               | Description                                                                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Default                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                   Required                   |\n|------------------------------------|-------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------:|\n| `component`                        | The component for which this API gateway exists.                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                     Yes                      |\n| `deployment_identifier`            | An identifier for this instantiation.                                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                     Yes                      |\n| `api_id`                           | The ID of the API gateway on which to create the stage.                                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                     Yes                      |\n| `name`                             | The name of the stage to create.                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                     Yes                      |\n| `hosted_zone_id`                   | The ID of the Route 53 hosted zone in which to create DNS records.                                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |      If `include_dns_record` is `true`       |\n| `domain_name`                      | The domain name to map to the stage. Required when a domain name is included.                                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |      If `include_domain_name` is `true`      |\n| `domain_name_certificate_arn`      | The ARN of an AWS managed certificate to use for the stage domain name. Required when a domain name is included.        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |      If `include_domain_name` is `true`      |\n| `access_logging_log_format`        | The log format to use for access logging.                                                                               | `\"{\\\"accountId\\\": \\\"$context.accountId\\\", \\\"apiId\\\": \\\"$context.apiId\\\", \\\"authorizer.claims.property\\\": \\\"$context.authorizer.claims.property\\\", \\\"authorizer.error\\\": \\\"$context.authorizer.error\\\", \\\"authorizer.principalId\\\": \\\"$context.authorizer.principalId\\\", \\\"authorizer.property\\\": \\\"$context.authorizer.property\\\", \\\"awsEndpointRequestId\\\": \\\"$context.awsEndpointRequestId\\\", \\\"awsEndpointRequestId2\\\": \\\"$context.awsEndpointRequestId2\\\", \\\"customDomain.basePathMatched\\\": \\\"$context.customDomain.basePathMatched\\\", \\\"dataProcessed\\\": $context.dataProcessed, \\\"domainName\\\": \\\"$context.domainName\\\", \\\"domainPrefix\\\": \\\"$context.domainPrefix\\\", \\\"error.message\\\": \\\"$context.error.message\\\", \\\"error.messageString\\\": \\\"$context.error.messageString\\\", \\\"error.responseType\\\": \\\"$context.error.responseType\\\", \\\"extendedRequestId\\\": \\\"$context.extendedRequestId\\\", \\\"httpMethod\\\": \\\"$context.httpMethod\\\", \\\"identity.accountId\\\": \\\"$context.identity.accountId\\\", \\\"identity.caller\\\": \\\"$context.identity.caller\\\", \\\"identity.cognitoAuthenticationProvider\\\": \\\"$context.identity.cognitoAuthenticationProvider\\\", \\\"identity.cognitoAuthenticationType\\\": \\\"$context.identity.cognitoAuthenticationType\\\", \\\"identity.cognitoIdentityId\\\": \\\"$context.identity.cognitoIdentityId\\\", \\\"identity.cognitoIdentityPoolId\\\": \\\"$context.identity.cognitoIdentityPoolId\\\", \\\"identity.principalOrgId\\\": \\\"$context.identity.principalOrgId\\\", \\\"identity.clientCert.clientCertPem\\\": \\\"$context.identity.clientCert.clientCertPem\\\", \\\"identity.clientCert.subjectDN\\\": \\\"$context.identity.clientCert.subjectDN\\\", \\\"identity.clientCert.issuerDN\\\": \\\"$context.identity.clientCert.issuerDN\\\", \\\"identity.clientCert.serialNumber\\\": \\\"$context.identity.clientCert.serialNumber\\\", \\\"identity.clientCert.validity.notBefore\\\": \\\"$context.identity.clientCert.validity.notBefore\\\", \\\"identity.clientCert.validity.notAfter\\\": \\\"$context.identity.clientCert.validity.notAfter\\\", \\\"identity.sourceIp\\\": \\\"$context.identity.sourceIp\\\", \\\"identity.user\\\": \\\"$context.identity.user\\\", \\\"identity.userAgent\\\": \\\"$context.identity.userAgent\\\", \\\"identity.userArn\\\": \\\"$context.identity.userArn\\\", \\\"integration.error\\\": \\\"$context.integration.error\\\", \\\"integration.integrationStatus\\\": $context.integration.integrationStatus, \\\"integration.latency\\\": $context.integration.latency, \\\"integration.requestId\\\": \\\"$context.integration.requestId\\\", \\\"integration.status\\\": $context.integration.status, \\\"integrationErrorMessage\\\": \\\"$context.integrationErrorMessage\\\", \\\"integrationLatency\\\": $context.integrationLatency, \\\"integrationStatus\\\": $context.integrationStatus, \\\"path\\\": \\\"$context.path\\\", \\\"protocol\\\": \\\"$context.protocol\\\", \\\"requestId\\\": \\\"$context.requestId\\\", \\\"requestTime\\\": \\\"$context.requestTime\\\", \\\"requestTimeEpoch\\\": \\\"$context.requestTimeEpoch\\\", \\\"responseLatency\\\": $context.responseLatency, \\\"responseLength\\\": $context.responseLength, \\\"routeKey\\\": \\\"$context.routeKey\\\", \\\"stage\\\": \\\"$context.stage\\\", \\\"status\\\": $context.status}\"` |                      No                      |\n| `access_logging_log_group_arn`     | The ARN of the CloudWatch log group to use for access logging. Required when `include_access_log_log_group` is `false`. |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | If `include_access_log_log_group` is `false` |\n| `tags`                             | Additional tags to set on created resources.                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      `{}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                      No                      |\n| `enable_auto_deploy`               | Whether or not to enable auto-deploy for the created stage.                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     `true`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                      No                      |\n| `enable_access_logging`            | Whether or not to enable access logging for the created stage.                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     `true`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                      No                      |\n| `include_default_tags`             | Whether or not to include default tags on created resources.                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     `true`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                      No                      |\n| `include_domain_name`              | Whether or not to create a domain name for the stage.                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     `true`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                      No                      |\n| `include_dns_record`               | Whether or not to create a DNS record in Route 53 for the domain name of the stage.                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     `true`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                      No                      |\n| `include_access_logging_log_group` | Whether or not to create a log group for access logging for the created stage.                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     `true`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                      No                      |\n\n#### VPC Link Sub-module\n\n| Name                                      | Description                                                                                       |     Default     | Required |\n|-------------------------------------------|---------------------------------------------------------------------------------------------------|:---------------:|:--------:|\n| `component`                               | The component for which this VPC link exists.                                                     |        -        |   Yes    |\n| `deployment_identifier`                   | An identifier for this instantiation.                                                             |        -        |   Yes    |\n| `vpc_id`                                  | The ID of the VPC in which to create the VPC link.                                                |        -        |   Yes    |\n| `vpc_link_subnet_ids`                     | The subnet IDs in which to create the VPC link.                                                   |      `[]`       |    No    |\n| `vpc_link_default_ingress_cidrs`          | The CIDRs allowed access to the VPC via the VPC link when using the default ingress rule.         | `[\"0.0.0.0/0\"]` |    No    |\n| `vpc_link_default_egress_cidrs`           | The CIDRs accessible within the VPC via the VPC link when using the default egress rule.          | `[\"0.0.0.0/0\"]` |    No    |\n| `tags`                                    | Additional tags to set on created resources.                                                      |      `{}`       |    No    |\n| `include_default_tags`                    | Whether or not to include default tags on created resources.                                      |     `true`      |    No    |\n| `include_vpc_link_default_security_group` | Whether or not to create a default security group for the VPC link.                               |     `true`      |    No    |\n| `include_vpc_link_default_ingress_rule`   | Whether or not to create the default ingress rule on the security group created for the VPC link. |     `true`      |    No    |\n| `include_vpc_link_default_egress_rule`    | Whether or not to create the default egress rule on the security group created for the VPC link.  |     `true`      |    No    |\n\n#### Log Permissions Sub-module\n\n| Name | Description | Default | Required |\n|------|-------------|:-------:|:--------:|\n\n### Outputs\n\n#### Root Module\n\n| Name                                      | Description                                                                                                                                                                                                            |\n|-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `api_gateway_id`                          | The ID of the managed API Gateway API.                                                                                                                                                                                 |\n| `api_gateway_arn`                         | The ARN of the managed API Gateway API.                                                                                                                                                                                |\n| `api_gateway_name`                        | The name of the managed API Gateway API.                                                                                                                                                                               |\n| `default_stage_id`                        | The ID of the default stage of the managed API Gateway API. This is an empty string when the default stage is not included.                                                                                            |\n| `default_stage_arn`                       | The ARN of the default stage of the managed API Gateway API. This is an empty string when the default stage is not included.                                                                                           |\n| `default_stage_api_mapping_id`            | The ID of the API mapping of the default stage of the managed API Gateway API. This is an empty string when the default stage is not included.                                                                         |\n| `default_stage_domain_name_id`            | The ID of the domain name of the default stage of the managed API Gateway API. This is an empty string when the default stage is not included or the default stage domain name is not included.                        |\n| `default_stage_domain_name_arn`           | The ARN of the domain name of the default stage of the managed API Gateway API. This is an empty string when the default stage is not included or the default stage domain name is not included.                       |\n| `default_stage_domain_name_configuration` | The domain name configuration of the domain name of the default stage of the managed API Gateway API. This is an empty string when the default stage is not included or the default stage domain name is not included. |\n\n#### Stage Sub-module\n\n| Name                            | Description                                                                                                                          |\n|---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `stage_id`                      | The ID of the managed stage.                                                                                                         |\n| `stage_arn`                     | The ARN of the managed stage.                                                                                                        |\n| `api_mapping_id`                | The ID of the API mapping of the managed stage. This is an empty string when the domain name is not included.                        |\n| `domain_name_id`                | The ID of the domain name of the managed stage. This is an empty string when the domain name is not included.                        |\n| `domain_name_arn`               | The ARN of the domain name of the managed stage. This is an empty string when the domain name is not included.                       |\n| `domain_name_configuration`     | The domain name configuration of the domain name of the managed stage. This is an empty string when the domain name is not included. |\n| `access_logging_log_group_arn`  | The ARN of the log group for access logging of the managed stage.                                                                    |\n| `access_logging_log_group_name` | The name of the log group for access logging of the managed stage.                                                                   |\n\n#### VPC Link Sub-module\n\n| Name                                 | Description                                                                                                                             |\n|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| `vpc_link_id`                        | The ID of the managed VPC link.                                                                                                         |\n| `vpc_link_default_security_group_id` | The ID of the default security group for the managed VPC link. This is an empty string when the default security group is not included. |\n\n#### Log Permissions Sub-module\n\n| Name                       | Description                                                      |\n|----------------------------|------------------------------------------------------------------|\n| `logging_role_id`          | The ID of the managed API Gateway logging role.                  |\n| `logging_role_arn`         | The ARN of the managed API Gateway logging role.                 |\n| `logging_role_name`        | The name of the managed API Gateway logging role.                |\n| `logging_role_policy_id`   | The ID of the policy attached to the API Gateway logging role.   |\n| `logging_role_policy_name` | The name of the policy attached to the API Gateway logging role. |\n\n### Compatibility\n\nThis module is compatible with Terraform versions greater than or equal to\nTerraform 1.0 and Terraform AWS provider versions greater than or equal to 4.0.\n\nDevelopment\n-----------\n\n### Machine Requirements\n\nIn order for the build to run correctly, a few tools will need to be installed\non your development machine:\n\n* Ruby (3.1)\n* Bundler\n* git\n* git-crypt\n* gnupg\n* direnv\n* aws-vault\n\n#### Mac OS X Setup\n\nInstalling the required tools is best managed by [homebrew](http://brew.sh).\n\nTo install homebrew:\n\n```shell\nruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n```\n\nThen, to install the required tools:\n\n```shell\n# ruby\nbrew install rbenv\nbrew install ruby-build\necho 'eval \"$(rbenv init - bash)\"' \u003e\u003e ~/.bash_profile\necho 'eval \"$(rbenv init - zsh)\"' \u003e\u003e ~/.zshrc\neval \"$(rbenv init -)\"\nrbenv install 3.1.1\nrbenv rehash\nrbenv local 3.1.1\ngem install bundler\n\n# git, git-crypt, gnupg\nbrew install git\nbrew install git-crypt\nbrew install gnupg\n\n# aws-vault\nbrew cask install\n\n# direnv\nbrew install direnv\necho \"$(direnv hook bash)\" \u003e\u003e ~/.bash_profile\necho \"$(direnv hook zsh)\" \u003e\u003e ~/.zshrc\neval \"$(direnv hook $SHELL)\"\n\ndirenv allow \u003crepository-directory\u003e\n```\n\n### Running the build\n\nRunning the build requires an AWS account and AWS credentials. You are free to\nconfigure credentials however you like as long as an access key ID and secret\naccess key are available. These instructions utilise\n[aws-vault](https://github.com/99designs/aws-vault) which makes credential\nmanagement easy and secure.\n\nTo run the full build, including unit and integration tests, execute:\n\n```shell\naws-vault exec \u003cprofile\u003e -- ./go\n```\n\nTo run the unit tests, execute:\n\n```shell\naws-vault exec \u003cprofile\u003e -- ./go test:unit\n```\n\nTo run the integration tests, execute:\n\n```shell\naws-vault exec \u003cprofile\u003e -- ./go test:integration\n```\n\nTo provision the module prerequisites:\n\n```shell\naws-vault exec \u003cprofile\u003e -- ./go deployment:prerequisites:provision[\u003cdeployment_identifier\u003e]\n```\n\nTo provision the module contents:\n\n```shell\naws-vault exec \u003cprofile\u003e -- ./go deployment:root:provision[\u003cdeployment_identifier\u003e]\n```\n\nTo destroy the module contents:\n\n```shell\naws-vault exec \u003cprofile\u003e -- ./go deployment:root:destroy[\u003cdeployment_identifier\u003e]\n```\n\nTo destroy the module prerequisites:\n\n```shell\naws-vault exec \u003cprofile\u003e -- ./go deployment:prerequisites:destroy[\u003cdeployment_identifier\u003e]\n```\n\nConfiguration parameters can be overridden via environment variables. For\nexample, to run the unit tests with a seed of `\"testing\"`, execute:\n\n```shell\nSEED=testing aws-vault exec \u003cprofile\u003e -- ./go test:unit\n```\n\nWhen a seed is provided via an environment variable, infrastructure will not be\ndestroyed at the end of test execution. This can be useful during development\nto avoid lengthy provision and destroy cycles.\n\nTo subsequently destroy unit test infrastructure for a given seed:\n\n```shell\nFORCE_DESTROY=yes SEED=testing aws-vault exec \u003cprofile\u003e -- ./go test:unit\n```\n\n### Common Tasks\n\n#### Generating an SSH key pair\n\nTo generate an SSH key pair:\n\n```shell\nssh-keygen -m PEM -t rsa -b 4096 -C integration-test@example.com -N '' -f config/secrets/keys/bastion/ssh\n```\n\n#### Generating a self-signed certificate\n\nTo generate a self signed certificate:\n\n```shell\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365\n```\n\nTo decrypt the resulting key:\n\n```shell\nopenssl rsa -in key.pem -out ssl.key\n```\n\n#### Managing CircleCI keys\n\nTo encrypt a GPG key for use by CircleCI:\n\n```shell\nopenssl aes-256-cbc \\\n  -e \\\n  -md sha1 \\\n  -in ./config/secrets/ci/gpg.private \\\n  -out ./.circleci/gpg.private.enc \\\n  -k \"\u003cpassphrase\u003e\"\n```\n\nTo check decryption is working correctly:\n\n```shell\nopenssl aes-256-cbc \\\n  -d \\\n  -md sha1 \\\n  -in ./.circleci/gpg.private.enc \\\n  -k \"\u003cpassphrase\u003e\"\n```\n\nContributing\n------------\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/infrablocks/terraform-aws-api-gateway-v2.\nThis project is intended to be a safe, welcoming space for collaboration, and\ncontributors are expected to adhere to\nthe [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\nLicense\n-------\n\nThe library is available as open source under the terms of the\n[MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfrablocks%2Fterraform-aws-api-gateway-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfrablocks%2Fterraform-aws-api-gateway-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfrablocks%2Fterraform-aws-api-gateway-v2/lists"}