/terraform-aws-apigw-lambda

Deploys a serverless service to AWS API Gateway and Lambda

Primary LanguageHCLMozilla Public License 2.0MPL-2.0

Terraform AWS API Gateway Lambda Module

Overview

Deploys a serverless service to AWS using API Gateway and Lambda.

Specifications

Requirements

Name Version
terraform >= 1.3
archive ~> 2.2.0
aws ~> 4.0

Providers

Name Version
archive 2.2.0
aws 4.67.0

Modules

Name Source Version
apigateway-v2 terraform-aws-modules/apigateway-v2/aws 2.2.2
lambda_function terraform-aws-modules/lambda/aws ~> 3.0

Resources

Name Type
aws_apigatewayv2_api_mapping.this resource
aws_apigatewayv2_stage.this resource
aws_route53_record.this resource
archive_file.this data source
aws_route53_zone.hosted_zone data source

Inputs

Name Description Type Default Required
description Description of service applied to deployed resources string n/a yes
domain_name_certificate_arn ACM Certificate ARN to use for SSL encryption string n/a yes
existing_filename Relative path to service Lambda function source file string n/a yes
hostname DNS name given to the api gateway domain assigned. Is the rt53 record name$var.hostname.$var.domain_name string n/a yes
create_default_stage Whether or not to create a default stage in the API gateway. Defaults to false, no default stage. bool false no
create_default_stage_api_mapping Whether or not to create a default stage mapping in the API gateway. Defaults to false, no default stage. bool false no
create_package Whether to upload the lambda file to s3. Should be false bool false no
detailed_metrics_enabled Whether or not detailed metrics are enabled for the service Lambda, defaults to false, no detailed metrics. bool false no
disable_execute_api_endpoint Whether or not to disable the Lambda execute API endpoint, defaults to true, no execute endpoint bool true no
enabled Set to false to prevent the module from creating any resources bool true no
environment Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' string null no
function_handler Name of service Lambda function entry point string "index.handler" no
hosted_zone_id Route53 zone ID for creating the API Gateway's record, must provide either zone name or zone ID string null no
hosted_zone_name Route53 zone name for creating the API Gateway's record, must provide either zone name or zone ID string null no
hosted_zone_private Whether or not the Route53 zone is private, defaults to false, public zone bool false no
integration_timeout_milliseconds Number of seconds to wait for a response from Lambda number 30000 no
name Module name, e.g. 'app' or 'jenkins' string null no
namespace Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' string null no
publish Whether or not to publish a version of the service Lambda, defaults to true, publish version bool true no
runtime Service Lambda runtime string "nodejs18.x" no
tags Additional tags (e.g. map('BusinessUnit','XYZ') map(string) {} no
throttling_burst_limit API gateway throttling burst limit number 100 no
throttling_rate_limit API Gateway throttling rate limit number 100 no

Outputs

Name Description
enabled Whether or not the module is enabled
environment Environment of the asset
name Name of the asset
namespace Namespace of the asset
tags Tags for the asset