-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudfront.tf
More file actions
34 lines (34 loc) · 898 Bytes
/
cloudfront.tf
File metadata and controls
34 lines (34 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Setup the CloudFront Distribution
resource "aws_cloudfront_distribution" "cloudfront_distribution" {
origin {
domain_name = "${var.bucket_name}.s3.amazonaws.com"
origin_id = "S3-${var.bucket_name}"
s3_origin_config {}
}
enabled = true
price_class = "${var.price_class}"
default_cache_behavior {
allowed_methods = [ "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT" ]
cached_methods = [ "GET", "HEAD" ]
target_origin_id = "S3-${var.bucket_name}"
forwarded_values {
query_string = true
cookies {
forward = "none"
}
}
viewer_protocol_policy = "allow-all"
min_ttl = 0
default_ttl = 3600
max_ttl = 86400
}
retain_on_delete = "${var.retain_on_delete}"
viewer_certificate {
cloudfront_default_certificate = true
}
restrictions {
geo_restriction {
restriction_type = "none"
}
}
}