-
Notifications
You must be signed in to change notification settings - Fork 0
/
bucket.tf
46 lines (41 loc) · 1.29 KB
/
bucket.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# CDN backend bucket
resource "google_storage_bucket" "poc" {
name = var.bucket_name
location = var.bucket_location
uniform_bucket_level_access = true
// delete bucket and contents on destroy.
force_destroy = true
// Assign specialty files
website {
main_page_suffix = "index.html"
not_found_page = "404.html"
}
}
# Make bucket public
resource "google_storage_bucket_iam_member" "poc" {
bucket = google_storage_bucket.poc.name
role = "roles/storage.objectViewer"
member = "allUsers"
}
resource "google_storage_bucket_object" "index_html" {
name = "index.html"
source = "./website/index.html"
bucket = google_storage_bucket.poc.name
}
resource "google_storage_bucket_object" "four_zero_four_html" {
name = "404.html"
source = "./website/404.html"
bucket = google_storage_bucket.poc.name
}
resource "google_storage_bucket_object" "design_svg" {
name = "content/design.svg"
source = "./website/content/design_cdn.svg"
content_type = "image/svg+xml"
bucket = google_storage_bucket.poc.name
}
resource "google_storage_bucket_object" "style_css" {
name = "css/style.css"
source = "./website/css/style.css"
content_type = "text/css"
bucket = google_storage_bucket.poc.name
}