aws-cloudfront-edge-lambda
Adaptavist/aws-cloudfront-edge-lambda/module
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
| Name | Type | Description | Default |
|---|---|---|---|
| namespace | string | The namespace of the distribution. | required |
| tags | map(any) | Tags applied to the distribution, these should follow what is defined [here](htt | required |
| acm_cert_arn | string | AWS ACM certificate ARN to use for the CloudFront distribution. | required |
| stage | string | The stage of the distribution - (dev, staging etc). | required |
| default_cache_behavior | object({ origin_id = | Default cache behaviour used by the distro, if a backend is static no query stri | required |
| aws_region | string | The region to deploy the lambda into. | required |
| r53_zone_name | string | Name of the public hosted zone, this is used for creating the A record for the C | required |
| domain | string | Domain name to use for the CloudFront distribution. | required |
| name | string | The name of the distribution. | required |
| custom_origin_mappings | map(object({ origin_id = | Custom origin mappings. Can be used in conjunction with S3 origin mappings Defau | {} |
| enable_access_logs | bool | Should accesses to the CloudFront distribution be logged, defaults to false. | false |
| min_ttl | number | Minimum TTL of objects in the cache. Defaults to 0. | 0 |
| hsts_lambda_timeout | string | The lambda time out applied to the hsts edge lambda, this timeout includes the t | "15" |
| viewer_protocol_policy | string | Default viewer_protocol_policy for the CloudFront distribution, this defaults to | "redirect-to-https" |
| log_cookies | bool | If access logs are enabled, are cookies logged. | false |
| geo_restriction_locations | list(string) | The ISO 3166-1-alpha-2 codes for which you want CloudFront either to allow or di | [] |
| enable_custom_lambda | bool | Flag to allow creation of a custom edge lambda. If set to false the following - | true |
| lambda_handler | string | The lambda entry point | "" |
| lambda_cf_event_type | string | When to trigger the Lambda: 'viewer-request', 'origin-request', 'viewer-response | "" |
| aliases | list(string) | Aliases used by the CloudFront distribution. | [] |
| origin_protocol_policy | string | Default origin_protocol_policy for the CloudFront distribution, this defaults to | "https-only" |
| max_ttl | number | Maximum TTL of objects in the cache. Set to 0 if you wish to disable caching. De | 86400 |
| lambda_dist_dir | string | Directory of the lambda distribution which is to be published | "" |
| s3_origin_mappings | map(object({ origin_id | S3 origin mappings. Can be used in conjunction with custom origin mappings Defau | {} |
| access_logs_bucket | string | If access logs are enabled the bucket the logs should go into, defaults to false | "" |
| lambda_memory_size | string | How much memory to give the lambda | "128" |
| lambda_cf_include_body | bool | When set to true it exposes the request body to the lambda function. | false |
| lambda_name_prefix | string | Name prefix to be given to the Lambda. | "" |
| cached_methods | list(string) | HTTP methods the CloudFront distribution will cache, defaults to GET and HEAD. | [
"GET",
"HEAD"
] |
lambda_role_name — IAM role name given to Edge Lambdacf_id — ID of AWS CloudFront distributioncf_arn — ARN of AWS CloudFront distributioncf_status — Current status of the distributioncf_domain_name — Domain name corresponding to the distributioncf_etag — Current version of the distribution's informationcf_hosted_zone_id — CloudFront Route 53 zone ID