Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

comtravo/terraform-aws-api-gateway-v2

Repository files navigation

Terraform AWS module for AWS API gateway V2 with OpenAPI spec

Introduction

This is a minimal Terraform module which accepts a AWS + OpenAPI spec and deploys an AWS API Gateway V2

Usage

Check examples on how to use this module

Authors

Module managed by Comtravo.

License

MIT Licensed. See LICENSE for full details.

Requirements

Name Version
terraform >= 0.13
aws ~> 3.0

Providers

Name Version
aws ~> 3.0

Inputs

Name Description Type Default Required
access_log_settings https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html#apigateway-cloudwatch-log-formats
object({
format = string
retention_in_days = number
})
{
"format": "{ "requestId":"$context.requestId", "ip": "$context.identity.sourceIp", "requestTime":"$context.requestTime", "httpMethod":"$context.httpMethod","routeKey":"$context.routeKey", "status":"$context.status","protocol":"$context.protocol", "responseLength":"$context.responseLength" }",
"retention_in_days": 90
}
no
body Definition of the API Gateway string n/a yes
cors_configuration https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_api#cors_configuration
list(object({
allow_credentials = bool
allow_headers = list(string)
allow_methods = list(string)
allow_origins = list(string)
expose_headers = list(string)
max_age = number
}))
[] no
domain_settings https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_domain_name
object({
enable = bool
domain_name = string
zone_id = string
certificate_arn = string
endpoint_type = string
security_policy = string
})
{
"certificate_arn": "",
"domain_name": "",
"enable": false,
"endpoint_type": "",
"security_policy": "",
"zone_id": ""
}
no
name Name of the API gateway deployment string n/a yes
protocol_type https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_api#protocol_type string n/a yes
stage Name of the stage to which deployed string n/a yes
tags Tags for resources map {} no

Outputs

Name Description
aws_apigatewayv2_api aws_apigatewayv2_api outputs
aws_apigatewayv2_api_mapping aws_apigatewayv2_api_mapping outputs
aws_apigatewayv2_deployment aws_apigatewayv2_deployment outputs
aws_apigatewayv2_domain_name aws_apigatewayv2_domain_name outputs
aws_apigatewayv2_stage aws_apigatewayv2_stage outputs
aws_cloudwatch_log_group aws_cloudwatch_log_group outputs
aws_route53_record aws_route53_record outputs