-
Notifications
You must be signed in to change notification settings - Fork 0
/
bucket-contents.tf
30 lines (30 loc) · 1.12 KB
/
bucket-contents.tf
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
variable "web" {
description = "all files to be copied"
type = "list"
default = [
"deutschland_heidelberg_header.jpg#image/jpeg",
"error.html#text/html",
"index.html#text/html",
"impressum.html#text/html",
"datenschutz.html#text/html",
"logo_bad.png#image/png",
"logo_bad_inv.png#image/png",
"kesselring.css#text/css",
"pic2.jpg#image/jpeg"]
}
resource "aws_s3_bucket_object" "webcontent" {
count = "${length(var.web)}"
bucket = "${aws_s3_bucket.b.bucket}"
key = "${element(split("#",element(var.web, count.index)),0)}"
source = "site/src/main/web/${element(split("#",element(var.web, count.index)),0)}"
content_type = "${element(split("#",element(var.web, count.index)),1)}"
etag = "${md5(file(format("%s%s","site/src/main/web/",element(split("#",element(var.web, count.index)),0))))}"
}
//// the bundle is missing
resource "aws_s3_bucket_object" "bundle" {
bucket = "${aws_s3_bucket.b.bucket}"
key = "kesselringio.bundle.js"
source = "site/build/bundle/kesselringio.bundle.js"
content_type = "application/javascript"
etag = "${md5(file("site/build/bundle/kesselringio.bundle.js"))}"
}