/tf-module-aws-s3-cf-acm

Terraform module for static site with SSL

Primary LanguageHCLApache License 2.0Apache-2.0

tf-module-aws-s3-cf-acm

Terraform module for static site with SSL required_version = ">= 0.12"

Usage

module "s3-cf-acm" {
  source = "git@github.com:lean-delivery/tf-module-aws-s3-cf-acm.git"

  namespace        = "test"
  stage            = "test"
  name             = "cf-bucket"
  parent_zone_name = "example.com"
  acm_tags = {
    Name = "Example"
  }
  domain                   = "static.example.com"
  use_regional_s3_endpoint = "true"
  origin_bucket            = "S3-static-files-content"
  origin_force_destroy     = "yes"
  default_root_object      = "index.html"
}

Inputs

Name Description Type Default Required
acm_certificate_arn Existing ACM Certificate ARN string "" no
acm_tags Additional tags (e.g. map(BusinessUnit,XYZ) map <map> no
aliases List of FQDN's - Used to set the Alternate Domain Names (CNAMEs) setting on Cloudfront list <list> no
alternative_names Domian name alternatives for ACM certificate list <list> no
bucket_domain_format Format of bucket domain name string "%s.s3.amazonaws.com" no
default_root_object Object that CloudFront return when requests the root URL string "index.html" no
default_ttl Default amount of time (in seconds) that an object is in a CloudFront cache string "60" no
domain A domain name for which certificate will be created string n/a yes
enabled Select Enabled if you want CloudFront to begin processing requests as soon as the distribution is created, or select Disabled if you do not want CloudFront to begin processing requests after the distribution is created. string "true" no
lambda_function_association A config block that triggers a lambda function with specific actions list <list> no
log_expiration_days Number of days after which to expunge the objects string "90" no
log_glacier_transition_days Number of days after which to move the data to the glacier storage tier string "60" no
log_include_cookies Include cookies in access logs string "false" no
log_prefix Path of logs in S3 bucket string "" no
log_standard_transition_days Number of days to persist in the standard storage tier before moving to the glacier tier string "30" no
max_ttl Maximum amount of time (in seconds) that an object is in a CloudFront cache string "31536000" no
min_ttl Minimum amount of time that you want objects to stay in CloudFront caches string "0" no
name Name of static content (forming bucket name) string n/a yes
namespace Namespace (forming bucket name) string n/a yes
origin_bucket Name of S3 bucket string "" no
origin_force_destroy Delete all objects from the bucket so that the bucket can be destroyed without error (e.g. true or false) string "false" no
parent_zone_id ID of the hosted zone to contain this record (or specify parent_zone_name) string "" no
parent_zone_name Name of the hosted zone to contain this record (or specify parent_zone_id) string n/a yes
price_class Price class for this distribution: PriceClass_All, PriceClass_200, PriceClass_100 string "PriceClass_100" no
stage Stage of environment (e.g. dev or prod) (forming bucket name) string "dev" no
tags Additional tags (e.g. map(BusinessUnit,XYZ) map <map> no
use_regional_s3_endpoint When set to 'true' the s3 origin_bucket will use the regional endpoint address instead of the global endpoint address string "false" no
web_acl_id ID of the AWS WAF web ACL that is associated with the distribution string "" no

Outputs

Name Description
cf_arn ARN of AWS CloudFront 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
cf_id ID of AWS CloudFront distribution
cf_status Current status of the distribution
s3_bucket Name of S3 bucket
s3_bucket_domain_name Domain of S3 bucket