Skip to content

Repository files navigation

aws-cloudfront-s3

This is a compiled terraform module capable of creating:

  • CloudFont
  • S3 bucket
  • Route53 record

Requirements

Name Version
terraform >= 1.5.0
aws >= 5.33.0

Providers

Name Version
aws >= 5.33.0

Modules

Name Source Version
cloudfront git::https://github.com/terraform-aws-modules/terraform-aws-cloudfront.git//. a0f0506106a4c8815c1c32596e327763acbef2c2
records git::https://github.com/terraform-aws-modules/terraform-aws-route53.git//modules/records 385af6e72673f90aa8c835f820067553f905bd17
s3_buckets git::https://github.com/terraform-aws-modules/terraform-aws-s3-bucket.git//. 8a0b697adfbc673e6135c70246cff7f8052ad95a

Resources

Name Type
aws_cloudfront_key_group.selected resource
aws_cloudfront_public_key.selected resource
aws_s3_bucket_policy.buckets_policy resource
aws_iam_policy_document.s3_p data source
aws_secretsmanager_secret.key-by-name data source
aws_secretsmanager_secret_version.secret-version data source

Inputs

Name Description Type Default Required
cloudfront The Cloudfront configuration
object({
domain = optional(string, null)
sub_domain = optional(string, null)
create_distribution = optional(bool, true)
create_origin_access_identity = optional(bool, false)
origin_access_identities = optional(map(string), {})
create_origin_access_control = optional(bool, false)
origin_access_control = optional(map(object({
description = string
origin_type = string
signing_behavior = string
signing_protocol = string
})),
{
s3 = {
description = "",
origin_type = "s3",
signing_behavior = "always",
signing_protocol = "sigv4"
}
}
)
aliases = optional(list(string), null)
comment = optional(string, null)
continuous_deployment_policy_id = optional(string, null)
default_root_object = optional(string, null)
enabled = optional(bool, true)
http_version = optional(string, "http2")
is_ipv6_enabled = optional(bool, null)
price_class = optional(string, null)
retain_on_delete = optional(bool, false)
wait_for_deployment = optional(bool, true)
web_acl_id = optional(string, null)
staging = optional(bool, false)
tags = optional(map(string), null)
#origin = optional(any, {})
origin_group = optional(any, {})
viewer_certificate = optional(any, {
cloudfront_default_certificate = true
minimum_protocol_version = "TLSv1"
})
geo_restriction = optional(any, {})
logging_config = optional(any, {})
custom_error_response = optional(any, {})
default_cache_behavior = optional(any, null)
ordered_cache_behavior = optional(any, [])
create_monitoring_subscription = optional(bool, false)
realtime_metrics_subscription_status = optional(string, "Enabled")
})
n/a yes
cloudfront_keys The Cloudfront keys
object({
name = optional(string, "default")
secrets = optional(map(object({
secret_manager_name = string
secret_manager_key = string
})), {}
)
})
{} no
route53_record The bucket for hosting static
object({
enabled = optional(bool, false)
zone_id = optional(string, "")
tags = optional(map(string), {})
})
{} no
s3_buckets The bucket for hosting static
map(object({
suffix_for_assets = optional(string, "/*")

create_bucket = optional(bool, true)
attach_elb_log_delivery_policy = optional(bool, false)
attach_lb_log_delivery_policy = optional(bool, false)
attach_access_log_delivery_policy = optional(bool, false)
attach_deny_insecure_transport_policy = optional(bool, false)
attach_require_latest_tls_policy = optional(bool, false)
attach_policy = optional(bool, false)
attach_public_policy = optional(bool, true)
attach_inventory_destination_policy = optional(bool, false)
attach_analytics_destination_policy = optional(bool, false)
attach_deny_incorrect_encryption_headers = optional(bool, false)
attach_deny_incorrect_kms_key_sse = optional(bool, false)
allowed_kms_key_arn = optional(string, "")
attach_deny_unencrypted_object_uploads = optional(bool, false)
bucket = optional(string, "")
bucket_prefix = optional(string, null)
acl = optional(string, null)
policy = optional(string, null)
tags = optional(map(string), {})
force_destroy = optional(bool, false)
acceleration_status = optional(string, null)
request_payer = optional(string, null)
website = optional(any, {})
cors_rule = optional(any, [])
versioning = optional(map(string), {})
logging = optional(any, {})
access_log_delivery_policy_source_buckets = optional(list(string), [])
access_log_delivery_policy_source_accounts = optional(list(string), [])
grant = optional(any, [])
owner = optional(map(string), {})
expected_bucket_owner = optional(string, null)
lifecycle_rule = optional(any, [])
replication_configuration = optional(any, {})
server_side_encryption_configuration = optional(any, {})
intelligent_tiering = optional(any, {})
object_lock_configuration = optional(any, {})
metric_configuration = optional(any, {})
inventory_configuration = optional(any, {})
inventory_source_account_id = optional(string, null)
inventory_source_bucket_arn = optional(string, null)
inventory_self_source_destination = optional(bool, false)
analytics_configuration = optional(any, {})
analytics_source_account_id = optional(string, null)
analytics_source_bucket_arn = optional(string, null)
analytics_self_source_destination = optional(bool, false)
object_lock_enabled = optional(bool, false)
block_public_acls = optional(bool, true)
block_public_policy = optional(bool, true)
ignore_public_acls = optional(bool, true)
restrict_public_buckets = optional(bool, true)
control_object_ownership = optional(bool, false)
object_ownership = optional(string, "BucketOwnerEnforced")
putin_khuylo = optional(bool, true)
}))
{} no

Outputs

Name Description
cloudfront_distribution_arn The ARN (Amazon Resource Name) for the distribution.
cloudfront_distribution_caller_reference Internal value used by CloudFront to allow future updates to the distribution configuration.
cloudfront_distribution_domain_name The domain name corresponding to the distribution.
cloudfront_distribution_etag The current version of the distribution's information.
cloudfront_distribution_hosted_zone_id The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to.
cloudfront_distribution_id The identifier for the distribution.
cloudfront_distribution_in_progress_validation_batches The number of invalidation batches currently in progress.
cloudfront_distribution_last_modified_time The date and time the distribution was last modified.
cloudfront_distribution_status The current status of the distribution. Deployed if the distribution's information is fully propagated throughout the Amazon CloudFront system.
cloudfront_distribution_tags Tags of the distribution's
cloudfront_distribution_trusted_signers List of nested attributes for active trusted signers, if the distribution is set up to serve private content with signed URLs
cloudfront_monitoring_subscription_id The ID of the CloudFront monitoring subscription, which corresponds to the distribution_id.
cloudfront_origin_access_controls The origin access controls created
cloudfront_origin_access_controls_ids The IDS of the origin access identities created
cloudfront_origin_access_identities The origin access identities created
cloudfront_origin_access_identity_iam_arns The IAM arns of the origin access identities created
cloudfront_origin_access_identity_ids The IDS of the origin access identities created
s3_buckets The ARN of the bucket. Will be of format arn:aws:s3:::bucketname.
s3_buckets_arns The arns of s3 buckets.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages