Skip to content

takenorio/terraform-aws-cloudfront-s3-website

Repository files navigation

AWS simple website Terraform module

Overview

This Terraform module efficiently deploys a static website using AWS infrastructure, ideal for straightforward and quick website setups. It assumes that your domain is managed with Amazon Route 53, which simplifies DNS and domain configuration.

Prerequisites

Domain managed by AWS Route 53.

Usage

module "cloudfront_s3_website" {
  source              = "takenorio/cloudfront-s3-website/aws"
  domain_name         = "example.com"
}

Requirements

Name Version
terraform >= 1.6.0
aws >= 5.31.0
random >= 3.6.0
template >= 2.2.0

Providers

Name Version
random >= 3.6.0

Modules

Name Source Version
domain_certificate ./modules/domain-certificate n/a
logging_bucket ./modules/logging-bucket n/a
redirection_bucket ./modules/redirection-bucket n/a
redirection_cdn_distribution ./modules/redirection-cdn-distribution n/a
website_bucket ./modules/website-bucket n/a
website_cdn_distribution ./modules/website-cdn-distribution n/a

Resources

Name Type
random_string.this resource

Inputs

Name Description Type Default Required
domain_name The domain name to be managed by Route53. string n/a yes

Outputs

Name Description
acm_certificate_arn ARN of the certificate.
acm_certificate_domain_name ARN of the certificate.
acm_certificate_domain_validation_options Set of domain validation objects which can be used to complete certificate validation.
acm_certificate_not_after Expiration date and time of the certificate.
acm_certificate_not_before Start of the validity period of the certificate.
acm_certificate_pending_renewal true if a Private certificate eligible for managed renewal is within the early_renewal_duration period.
acm_certificate_renewal_eligibility Whether the certificate is eligible for managed renewal.
acm_certificate_renewal_summary Contains information about the status of ACM's managed renewal for the certificate.
acm_certificate_status Status of the certificate.
acm_certificate_tags_all Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
acm_certificate_type Source of the certificate.
acm_certificate_validation_id Time at which the certificate was issued
cloudfront_distribution_arn_redirection ARN for the distribution (redirection).
cloudfront_distribution_arn_website ARN for the distribution (website).
cloudfront_distribution_caller_reference_redirection Internal value used by CloudFront to allow future updates to the distribution configuration (redirection).
cloudfront_distribution_caller_reference_website Internal value used by CloudFront to allow future updates to the distribution configuration (website).
cloudfront_distribution_domain_name_redirection Domain name corresponding to the distribution (redirection).
cloudfront_distribution_domain_name_website Domain name corresponding to the distribution (website).
cloudfront_distribution_etag_redirection Current version of the distribution's information (redirection).
cloudfront_distribution_etag_website Current version of the distribution's information (website).
cloudfront_distribution_hosted_zone_id_redirection CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to (redirection).
cloudfront_distribution_hosted_zone_id_website CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to (website).
cloudfront_distribution_id_redirection Identifier for the distribution (redirection).
cloudfront_distribution_id_website Identifier for the distribution (website).
cloudfront_distribution_in_progress_validation_batches_redirection Number of invalidation batches currently in progress (redirection).
cloudfront_distribution_in_progress_validation_batches_website Number of invalidation batches currently in progress (website).
cloudfront_distribution_last_modified_time_redirection Date and time the distribution was last modified (redirection).
cloudfront_distribution_last_modified_time_website Date and time the distribution was last modified (website).
cloudfront_distribution_status_redirection Current status of the distribution. Deployed if the distribution's information is fully propagated throughout the Amazon CloudFront system (redirection).
cloudfront_distribution_status_website Current status of the distribution. Deployed if the distribution's information is fully propagated throughout the Amazon CloudFront system (website).
cloudfront_distribution_tags_all_redirection Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block (redirection).
cloudfront_distribution_tags_all_website Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block (website).
cloudfront_distribution_trusted_signers_redirection List of nested attributes for active trusted signers, if the distribution is set up to serve private content with signed URLs (redirection).
cloudfront_distribution_trusted_signers_website List of nested attributes for active trusted signers, if the distribution is set up to serve private content with signed URLs (website).
cloudfront_function_arn_redirection Amazon Resource Name (ARN) identifying your CloudFront Function (redirection).
cloudfront_function_arn_website Amazon Resource Name (ARN) identifying your CloudFront Function (website).
cloudfront_function_etag_redirection ETag hash of the function. This is the value for the DEVELOPMENT stage of the function (redirection).
cloudfront_function_etag_website ETag hash of the function. This is the value for the DEVELOPMENT stage of the function (website).
cloudfront_function_live_stage_etag_redirection ETag hash of any LIVE stage of the function.
cloudfront_function_live_stage_etag_website ETag hash of any LIVE stage of the function (website).
cloudfront_function_status_redirection Status of the function. Can be UNPUBLISHED, UNASSOCIATED or ASSOCIATED (redirection).
cloudfront_function_status_website Status of the function. Can be UNPUBLISHED, UNASSOCIATED or ASSOCIATED (website).
cloudfront_monitoring_subscription_id_redirection The ID of the CloudFront monitoring subscription, which corresponds to the distribution_id (redirection).
cloudfront_monitoring_subscription_id_website The ID of the CloudFront monitoring subscription, which corresponds to the distribution_id (website).
cloudfront_origin_access_control_etag_redirection The current version of this Origin Access Control (redirection).
cloudfront_origin_access_control_etag_website The current version of this Origin Access Control (website).
cloudfront_origin_access_control_id_redirection The unique identifier of this Origin Access Control (redirection).
cloudfront_origin_access_control_id_website The unique identifier of this Origin Access Control (website).
route53_record_fqdn_certificate FQDN built using the zone domain and name (certificate).
route53_record_fqdn_redirection FQDN built using the zone domain and name (redirection).
route53_record_fqdn_website FQDN built using the zone domain and name (website).
route53_record_name_certificate The name of the record (certificate).
route53_record_name_redirection The name of the record (redirection).
route53_record_name_website The name of the record (website).
s3_bucket_acl_id_logging The bucket, expected_bucket_owner (if configured), and acl (if configured) separated by commas (,) (logging).
s3_bucket_arn_logging ARN of the bucket (logging).
s3_bucket_arn_redirection ARN of the bucket (redirection).
s3_bucket_arn_website ARN of the bucket (website).
s3_bucket_domain_name_logging Bucket domain name (logging).
s3_bucket_domain_name_redirection Bucket domain name (redirection).
s3_bucket_domain_name_website Bucket domain name (website).
s3_bucket_hosted_zone_id_logging Route 53 Hosted Zone ID for this bucket's region (logging).
s3_bucket_hosted_zone_id_redirection Route 53 Hosted Zone ID for this bucket's region (redirection).
s3_bucket_hosted_zone_id_website Route 53 Hosted Zone ID for this bucket's region (website).
s3_bucket_id_logging Name of the bucket (logging).
s3_bucket_id_redirection Name of the bucket (redirection).
s3_bucket_id_website Name of the bucket (website).
s3_bucket_logging_id_website The bucket or bucket and expected_bucket_owner separated by a comma (,) if the latter is provided (website).
s3_bucket_ownership_controls_id_logging S3 Bucket name (logging).
s3_bucket_ownership_controls_id_redirection S3 Bucket name (redirection).
s3_bucket_ownership_controls_id_website S3 Bucket name (website).
s3_bucket_public_access_block_id_logging Name of the S3 bucket the configuration is attached to (logging).
s3_bucket_public_access_block_id_redirection Name of the S3 bucket the configuration is attached to (redirection).
s3_bucket_public_access_block_id_website Name of the S3 bucket the configuration is attached to (website).
s3_bucket_region_logging AWS region this bucket resides in (logging).
s3_bucket_region_redirection AWS region this bucket resides in (redirection).
s3_bucket_region_website AWS region this bucket resides in (website).
s3_bucket_regional_domain_name_logging The bucket region-specific domain name (logging).
s3_bucket_regional_domain_name_redirection The bucket region-specific domain name (redirection).
s3_bucket_regional_domain_name_website The bucket region-specific domain name (website).
s3_bucket_server_side_encryption_configuration_id_logging The bucket or bucket and expected_bucket_owner separated by a comma (,) if the latter is provided (logging).
s3_bucket_server_side_encryption_configuration_id_website The bucket or bucket and expected_bucket_owner separated by a comma (,) if the latter is provided (website).
s3_bucket_tags_all_logging Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block (logging).
s3_bucket_tags_all_redirection Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block (redirection).
s3_bucket_tags_all_website Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block (website).
s3_bucket_versioning_id_logging The bucket or bucket and expected_bucket_owner separated by a comma (,) if the latter is provided (logging).
s3_bucket_versioning_id_website The bucket or bucket and expected_bucket_owner separated by a comma (,) if the latter is provided (website).