-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathS3WebsiteObjects.tf
More file actions
37 lines (31 loc) · 1.14 KB
/
S3WebsiteObjects.tf
File metadata and controls
37 lines (31 loc) · 1.14 KB
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
35
36
37
# S3 Bucket is defined in main.tf
# resource "aws_s3_object" "index" {
# bucket = aws_s3_bucket.b.id
# key = "index.html"
# source = "Source/index.html"
# etag = filemd5("Source/index.html")
# content_type = "text/html"
# }
# resource "aws_s3_object" "error" {
# bucket = aws_s3_bucket.b.id
# key = "error.html"
# source = "Source/error.html"
# etag = filemd5("Source/error.html")
# content_type = "text/html"
# }
resource "aws_s3_object" "WichaelMu-EZCV-Website" {
bucket = aws_s3_bucket.b.id
for_each = fileset("${var.WebsitePath}", "**/*.*")
key = each.value
source = "${var.WebsitePath}${each.value}"
// Default to binary/octet-stream if no match found in map.
content_type = lookup(local.MIMETypes, regex("\\.[^.]+$", each.value), "binary/octet-stream")
etag = filemd5("${var.WebsitePath}${each.value}")
}
resource "aws_s3_object" "JavaScript" {
bucket = aws_s3_bucket.b.id
key = "Metrics.js"
source = "Source/JavaScript/Metrics.js"
etag = filemd5("Source/JavaScript/Metrics.js")
content_type = "text/javascript"
}