Skip to content

chris-qa-org/terraform-aws-publii-hosting

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-publii-hosting

Terraform module to host a static site generated by Publii

Terraform CI

Requirements

Name Version
terraform >= 1.1.7
aws ~> 4.4

Providers

Name Version
aws 4.4.0
aws.useast1 4.4.0
random 3.1.0
template 2.2.0

Resources

Name Type
aws_acm_certificate.cloudfront_frontend resource
aws_acm_certificate_validation.cloudfront_frontend resource
aws_cloudfront_distribution.frontend resource
aws_cloudfront_distribution.frontend_www_redirect resource
aws_cloudfront_function.frontend_viewer_request resource
aws_cloudfront_origin_access_identity.frontend resource
aws_cloudfront_origin_access_identity.frontend_www_redirect resource
aws_iam_policy.publii_s3_frontend resource
aws_iam_user.publii_s3_frontend resource
aws_iam_user_policy_attachment.publii_s3_frontend resource
aws_kms_key.logs resource
aws_kms_key.s3_bucket_frontend_www_redirect resource
aws_lambda_permission.cloudfront_invalidation_frontend_alllow_s3 resource
aws_route53_record.cloudfront_frontend_tls_certificate_dns_validation resource
aws_route53_record.frontend resource
aws_route53_record.frontend_www_redirect resource
aws_s3_bucket.frontend resource
aws_s3_bucket.frontend_www_redirect resource
aws_s3_bucket.logs resource
aws_s3_bucket_acl.frontend resource
aws_s3_bucket_acl.frontend_www_redirect resource
aws_s3_bucket_acl.logs resource
aws_s3_bucket_logging.frontend resource
aws_s3_bucket_logging.frontend_www_redirect resource
aws_s3_bucket_notification.frontend_cloudfront_invalidation resource
aws_s3_bucket_policy.frontend resource
aws_s3_bucket_policy.frontend_www_redirect resource
aws_s3_bucket_policy.logs resource
aws_s3_bucket_public_access_block.frontend resource
aws_s3_bucket_public_access_block.frontend_www_redirect resource
aws_s3_bucket_public_access_block.logs resource
aws_s3_bucket_server_side_encryption_configuration.frontend resource
aws_s3_bucket_server_side_encryption_configuration.frontend_www_redirect resource
aws_s3_bucket_server_side_encryption_configuration.logs resource
aws_s3_bucket_versioning.frontend resource
aws_s3_bucket_versioning.frontend_www_redirect resource
aws_s3_bucket_versioning.logs resource
aws_s3_bucket_website_configuration.frontend resource
aws_s3_bucket_website_configuration.frontend_www_redirect resource
aws_wafv2_web_acl.cloudfront_waf resource
random_id.project resource
aws_route53_zone.default data source
template_file.cloudfront_frontend_viewer_request_function data source
template_file.frontend_bucket_cloudfront_read data source
template_file.frontend_bucket_enforce_tls_statement data source
template_file.frontend_bucket_policy data source
template_file.frontend_www_redirect_bucket_cloudfront_read data source
template_file.frontend_www_redirect_bucket_enforce_tls_statement data source
template_file.frontend_www_redirect_bucket_policy data source
template_file.lambda_cloudfront_invalidation_frontend_policy data source
template_file.logs_bucket_enforce_tls_statement data source
template_file.logs_bucket_policy data source
template_file.publii_s3_frontend_policy data source

Inputs

Name Description Type Default Required
cloudfront_enable_apex_to_www_redirect Enable CloudFront apex to www redirect bool true no
cloudfront_enable_ipv6 Enable IPv6 on CloudFront bool true no
cloudfront_enable_waf Enable CloudFront WAF bool true no
cloudfront_ordered_cache_behaviors List of ordered_cache_behavior objects. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution#cache-behavior-arguments any [] no
cloudfront_tls_certificate_arn CloudFront TLS certificate ARN (must be created in us-east-1 region) string "" no
enable_publii_pretty_urls If you hae enabled 'Pretty URLs' in Publii, set this to true bool false no
route53_hosted_zone_options If you have a Route53 zone, the required DNS records can be created automatically.
object({
id = string
create_certificate_dns_validation_records = bool
create_site_url_dns_records = bool
})
{
"create_certificate_dns_validation_records": false,
"create_site_url_dns_records": false,
"id": ""
}
no
s3_bucket_acl S3 bucket ACL string "private" no
site_url The desired site URL string n/a yes

Outputs

Name Description
aws_acm_certificate_cloudfront_frontend CloudFront frontend's ACM TLS certificate attributes
aws_cloudfront_origin_access_identity_frontend CloudFront frontend's associated origin access identity
iam_user_publii_s3_frontend IAM User attributes for Publii S3 bucket
project_name Project name. Generated from the site_url and project_random_id
project_random_id The random ID generated to ensure unique resource names
s3_bucket_frontend S3 bucket frontend attributes

About

Terraform module to host a static site generated by Publii

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •