IMPORTANT: We do not pin modules to versions in our examples because of the difficulty of keeping the versions in the documentation in sync with the latest released versions. We highly recommend that in your code you pin the version to the exact version you are using so that your infrastructure remains stable, and update versions in a systematic way so that they do not catch you by surprise.
module "website" {
source = "dashdevs/static-website/aws"
bucket_name = var.bucket_name
domain = var.domain
domain_zone_name = var.domain_zone_name
create_dns_records = true
}
Name | Version |
---|---|
terraform | >= 1.5.2 |
aws | >= 3.34 |
Name | Version |
---|---|
aws | >= 3.34 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
domain | Domain name for the site | string |
n/a |
yes |
bucket_name | The name for the S3 bucket | string |
n/a |
yes |
domain_zone_name | The name of the domain zone in the route53 service for which DNS records will be created. Must be set if create_dns_records is true |
string |
null |
no |
create_dns_records | If true, then DNS records are created in route53 for this site and connected to the cloudfront distribution | bool |
true |
no |
cors_allowed_origins | Used to declare domains from which the site will be accessed as a storage of static resources | list(string) |
null |
no |
cors_allowed_methods_additional | Additional HTTP methods to be allowed in the CORS configuration for the S3 bucket (e.g., POST, PUT). | list(string) |
[] |
no |
s3_policy_statements_additional | Additional policy statments that need to be attached to the S3 bucket. | list(object({ |
[] |
no |
cloudfront_allowed_bucket_resources | List of resources that the Cloudfront is allowed to access. | list(string) |
["*"] |
no |
redirect_to | Target domain for redirecting all requests, enforced with HTTPS. | string |
null |
no |
Name | Description |
---|---|
bucket_id | The S3 bucket identifier |
cloudfront_distribution_id | The cloudfront distribution identifier assigned to the S3 bucket |
ssl_certificate_validation_dns_records | List of text expressions of the certificate validation DNS records to create this records manually. Required if create_dns_records is false |
resource_domain_record | Text expressions of the website DNS record to create this records manually. Required if create_dns_records is false |