/tf_aws_static_frontend

Creates a static website hosted on S3 distributed through Cloudfront

Primary LanguageHCL

Requirements

Name Version
aws ~> 5

Providers

Name Version
aws ~> 5

Modules

No modules.

Resources

Name Type
aws_cloudfront_distribution.default resource
aws_cloudfront_origin_access_control.default resource
aws_iam_access_key.pipeline resource
aws_iam_policy.bucketAccess resource
aws_iam_policy.cloudfront_invalidation resource
aws_iam_user.pipeline resource
aws_iam_user_policy_attachment.bucketAccess resource
aws_iam_user_policy_attachment.cloudFrontInvalidation resource
aws_route53_record.default resource
aws_s3_bucket.default resource
aws_s3_bucket_policy.oac_policy resource

Inputs

Name Description Type Default Required
applicationName The name of the application string n/a yes
bucket_name The name of the S3 bucket to create string n/a yes
certificate_arn_us_east_1 The ARN of the ACM certificate in us-east-1 string n/a yes
custom_error_responses A list of custom error responses for the CloudFront distribution
list(object({
error_code = number
response_code = number
response_page_path = string
error_caching_min_ttl = number
}))
[
{
"error_caching_min_ttl": 10,
"error_code": 404,
"response_code": 200,
"response_page_path": "/index.html"
},
{
"error_caching_min_ttl": 10,
"error_code": 403,
"response_code": 200,
"response_page_path": "/index.html"
}
]
no
default_root_object The default root object for the CloudFront distribution string "index.html" no
fqdn The FQDN of the CloudFront distribution string n/a yes
hosted_zone_id The Route 53 hosted zone ID string n/a yes

Outputs

Name Description
bucket_name The name of the bucket where the site must be uploaded
cloudfront_distribution_id The ID of the CloudFront distribution
pipeline_access_key_id The ID of the IAM access key for using in a pipeline to deploy the site
pipeline_secret_access_key The secret of the IAM access key for using in a pipeline to deploy the site