Skip to content

perxhealth/terraform-aws-static-app

Repository files navigation

terraform-aws-static-app

Lint Status 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

Requirements

Name Version
terraform >= 0.12.0

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
alarms The keys of the map are the metric names. This list must be given as a comma-separated string.
The following arguments are supported:
- comparison_operator: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
- evaluation_periods: The number of periods over which data is compared to the specified threshold.
- period: The period in seconds over which the specified statistic is applied.
- statistic: The statistic to apply to the alarm's associated metric.
- threshold: The number of occurances over a given period.
- actions: The actions to execute when the alarm transitions into an ALARM state (ARN).
- ok_actions: The list of actions to execute when this alarm transitions into an OK state from any other state (ARN).
map(any) {} no
certificate_arn n/a any n/a yes
cloudfront_forward_headers Headers to forward to origin from CloudFront list
[
"*"
]
no
cloudfront_logging_bucket Bucket to store logs from app string "" no
cloudfront_logging_prefix Logging prefix string "" no
cloudfront_origin_keepalive_timeout The amount of time, in seconds, that CloudFront maintains an idle connection with a custom origin server before closing the connection. Valid values are from 1 to 60 seconds. number 5 no
cloudfront_origin_read_timeout The amount of time, in seconds, that CloudFront waits for a response from a custom origin. The value applies both to the time that CloudFront waits for an initial response and the time that CloudFront waits for each subsequent packet. Valid values are from 4 to 60 seconds. number 30 no
cloudfront_web_acl_id Optional web acl (WAF) to attach to CloudFront string "" no
default_cache_behavior_allowed_methods Methods allowed for default origin cache behavior list
[
"DELETE",
"GET",
"HEAD",
"OPTIONS",
"PATCH",
"POST",
"PUT"
]
no
default_cache_behavior_cookies_forward Default cache behavior cookies forward string "all" no
default_cache_behavior_forward_headers Default cache behavior headers forward list
[
"Access-Control-Request-Headers",
"Access-Control-Request-Method",
"Origin"
]
no
default_cache_behavior_forward_query_string Default cache behavior forward bool true no
default_comparison_operator The default comparison operator. string "GreaterThanOrEqualToThreshold" no
default_evaluation_periods The default amount of evaluation periods. number 2 no
default_period The default evaluation period. number 60 no
default_root_object Set the default file for the application string "index.html" no
default_statistic The default statistic. string "Average" no
default_threshold The default threshold for the metric. number 5 no
dynamic_custom_origin_config Configuration for the custom origin config to be used in dynamic block any [] no
dynamic_ordered_cache_behavior Ordered Cache Behaviors to be used in dynamic block any [] no
hosted_zone n/a any n/a yes
hostname_alias Create an Alias host in route53 for Cloudfront (instead of CNAME)? bool false no
hostname_create Create hostname in the hosted zone passed? bool true no
hostnames n/a list(string) n/a yes
lambda_edge Lambda EDGE configuration list [] no
minimum_protocol_version The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.
Can only be set if cloudfront_default_certificate = false. One of SSLv3, TLSv1, TLSv1_2016,
TLSv1.1_2016, TLSv1.2_2018 or TLSv1.2_2019. Default: TLSv1. NOTE: If you are using a custom
certificate (specified with acm_certificate_arn or iam_certificate_id), and have specified
sni-only in ssl_support_method, TLSv1 or later must be specified. If you have specified vip
in ssl_support_method, only SSLv3 or TLSv1 can be specified. If you have specified
cloudfront_default_certificate, TLSv1 must be specified.
string "TLSv1.2_2019" no
module_enabled Enable the module to create resources bool true no
name n/a any n/a yes
response_page_path Custom error response page path string "/index.html" no
restriction_location The ISO 3166-1-alpha-2 codes for which you want CloudFront either to distribute your content (whitelist) or not distribute your content (blacklist) list(any) [] no
restriction_type The restriction type of your CloudFront distribution geolocation restriction. Options include none, whitelist, blacklist string "none" no
s3_bucket_id n/a any n/a yes
wait_for_deployment If enabled, the resource will wait for the distribution status to change from InProgress to Deployed bool false no

Outputs

Name Description
cf_domain_name CloudFront Domain Name

Author

Module managed by DNX Solutions.

License

Apache 2 Licensed. See LICENSE for full details.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages