static-app

DNXLabs/static-app/aws

Terraform Module HCL AWS

This is a module that creates a static application with a OAI Cloudfront.

Install
module "static-app" {
source = "DNXLabs/static-app/aws"
version = "2.5.1"
}
plain text: /constructs/tfmod-dnxlabs-static-app-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

terraform-aws-static-app ![Lint Status](https://github.com/DNXLabs/terraform-aws-static-app/actions) ![LICENSE](https://github.com/DNXLabs/terraform-aws-static-app/blob/master/LICENSE) This is a module that creates a static application with a OAI Cloudfront. The following resources will be created: - A bucket to store logs from app - An Amazon CloudFront origin access identity - Enable an optional web acl (WAF) to attach to CloudFront - A hostname in the hosted zone passed - AWS Identity and Access Management (IAM) policy for the S3 Bucket Error: Variables not allowed: Variables may not be used here. Author Module managed by DNX Solutions. License Apache 2 Licensed. See LICENSE for full details.

Inputs (37)
NameTypeDescriptionDefault
namestringName of static app required
hostnameslist(string)List of hostnames to associate with the CloudFront distribution required
s3_bucket_idstringS3 Bucket ID to serve the static app from required
hosted_zonestringHosted zone ID to create the record in required
certificate_arnstringCertificate ARN in us-east-1 for CloudFront required
cloudfront_web_acl_idstringOptional web acl (WAF) to attach to CloudFront""
dynamic_ordered_cache_behaviorlist(object({ path_patternOrdered Cache Behaviors to be used in dynamic blocknull
default_cache_behavior_forward_headerslist(string)Default cache behavior headers forward[ "Access-Control-Request-Headers",
default_cache_behavior_cookies_forwardstringDefault cache behavior cookies forward"all"
hostname_aliasboolCreate an Alias host in route53 for Cloudfront (instead of CNAME)?false
restriction_locationlist(any)The ISO 3166-1-alpha-2 codes for which you want CloudFront either to distribute []
default_root_objectstringSet the default file for the application"index.html"
wait_for_deploymentboolIf enabled, the resource will wait for the distribution status to change from Infalse
default_cache_behavior_response_headers_idstringThe identifier for a response headers policy""
lambda_edgeanyLambda EDGE configuration[]
alarmsmap(any)The keys of the map are the metric names. This list must be given as a comma-sep{}
hostname_createboolCreate hostname in the hosted zone passed?true
module_enabledboolEnable the module to create resourcestrue
cloudfront_function_arnstringARN of an existing CloudFront Function (use this if create_cloudfront_function=fnull
response_page_pathstringCustom error response page path"/index.html"
default_thresholdnumberThe default threshold for the metric.5
restriction_typestringThe restriction type of your CloudFront distribution geolocation restriction. Op"none"
dynamic_custom_origin_configanyConfiguration for the custom origin config to be used in dynamic block[]
default_cache_behavior_forward_query_stringboolDefault cache behavior forwardtrue
cloudfront_logging_prefixstringLogging prefix""
Outputs (5)
cloudfront_distribution_id — CloudFront Distribution ID
cloudfront_key_group_id — CloudFront Key Group ID
cloudfront_public_key_id — CloudFront Key Group ID
response_headers_policies_ids — Response headers policies for Cloudfront
cf_domain_name — CloudFront Domain Name
Resources (8)
aws_cloudfront_distributionaws_cloudfront_functionaws_cloudfront_key_groupaws_cloudfront_origin_access_identityaws_cloudfront_public_keyaws_cloudwatch_metric_alarmaws_route53_recordaws_s3_bucket_policy
Details
FrameworkTerraform Module
LanguageHCL
Version2.5.1
Cloud AWS
★ Stars1
Forks13
Total downloads6.1k
Inputs37
Outputs5
Resources8
Examples3
LicenseApache-2.0
NamespaceDNXLabs
Updated