aws-cloudfront-edge-lambda

Adaptavist/aws-cloudfront-edge-lambda/module

Terraform Module HCL MODULE
Install
module "aws-cloudfront-edge-lambda" {
source = "Adaptavist/aws-cloudfront-edge-lambda/module"
version = "1.8.8"
}
plain text: /constructs/tfmod-adaptavist-aws-cloudfront-edge-lambda-module/install.txt
⭐ Source on GitHub 📦 Registry page
README

module-aws-cloudfront-router A module which creates a CloudFront distribution which has an Edge Lambda attached. Variables | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | access\_logs\_bucket | If access logs are enabled the bucket the logs should go into, defaults to false. | string | "" | no | | acm\_cert\_arn | AWS ACM certificate ARN to use for the CloudFront distribution. | string | n/a | yes | | aliases | Aliases used by the CloudFront distribution. | list(string) | [] | no | | cached\_methods | HTTP methods the CloudFront distribution will cache, defaults to GET and HEAD. | list(string) | [ "GET", "HEAD" ] | no | | custom\_origin\_mappings | Custom origin mappings. Can be used in conjunction with S3 origin mappings Defaults to

Inputs (36)
NameTypeDescriptionDefault
namespacestringThe namespace of the distribution. required
tagsmap(any)Tags applied to the distribution, these should follow what is defined [here](htt required
acm_cert_arnstringAWS ACM certificate ARN to use for the CloudFront distribution. required
stagestringThe stage of the distribution - (dev, staging etc). required
default_cache_behaviorobject({ origin_id =Default cache behaviour used by the distro, if a backend is static no query stri required
aws_regionstringThe region to deploy the lambda into. required
r53_zone_namestringName of the public hosted zone, this is used for creating the A record for the C required
domainstringDomain name to use for the CloudFront distribution. required
namestringThe name of the distribution. required
custom_origin_mappingsmap(object({ origin_id =Custom origin mappings. Can be used in conjunction with S3 origin mappings Defau{}
enable_access_logsboolShould accesses to the CloudFront distribution be logged, defaults to false.false
min_ttlnumberMinimum TTL of objects in the cache. Defaults to 0.0
hsts_lambda_timeoutstringThe lambda time out applied to the hsts edge lambda, this timeout includes the t"15"
viewer_protocol_policystringDefault viewer_protocol_policy for the CloudFront distribution, this defaults to"redirect-to-https"
log_cookiesboolIf access logs are enabled, are cookies logged.false
geo_restriction_locationslist(string)The ISO 3166-1-alpha-2 codes for which you want CloudFront either to allow or di[]
enable_custom_lambdaboolFlag to allow creation of a custom edge lambda. If set to false the following - true
lambda_handlerstringThe lambda entry point""
lambda_cf_event_typestringWhen to trigger the Lambda: 'viewer-request', 'origin-request', 'viewer-response""
aliaseslist(string)Aliases used by the CloudFront distribution.[]
origin_protocol_policystringDefault origin_protocol_policy for the CloudFront distribution, this defaults to"https-only"
max_ttlnumberMaximum TTL of objects in the cache. Set to 0 if you wish to disable caching. De86400
lambda_dist_dirstringDirectory of the lambda distribution which is to be published""
s3_origin_mappingsmap(object({ origin_id S3 origin mappings. Can be used in conjunction with custom origin mappings Defau{}
access_logs_bucketstringIf access logs are enabled the bucket the logs should go into, defaults to false""
lambda_memory_sizestringHow much memory to give the lambda"128"
lambda_cf_include_bodyboolWhen set to true it exposes the request body to the lambda function.false
lambda_name_prefixstringName prefix to be given to the Lambda.""
cached_methodslist(string)HTTP methods the CloudFront distribution will cache, defaults to GET and HEAD.[ "GET", "HEAD" ]
Outputs (7)
lambda_role_name — IAM role name given to Edge Lambda
cf_id — ID of AWS CloudFront distribution
cf_arn — ARN of AWS CloudFront distribution
cf_status — Current status of the distribution
cf_domain_name — Domain name corresponding to the distribution
cf_etag — Current version of the distribution's information
cf_hosted_zone_id — CloudFront Route 53 zone ID
Resources (4)
aws_cloudfront_distributionaws_lambda_permissionaws_route53_recordrandom_string
Details
FrameworkTerraform Module
LanguageHCL
Version1.8.8
Cloud MODULE
★ Stars1
Forks2
Total downloads13.2k
Inputs36
Outputs7
Resources4
LicenseApache-2.0
NamespaceAdaptavist
Updated