Skip to content

Commit acc54d1

Browse files
committed
feat: add google storage bucket
1 parent c533408 commit acc54d1

File tree

5 files changed

+54
-5
lines changed

5 files changed

+54
-5
lines changed

main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ module "project_factory_project_services" {
1313
]
1414
}
1515

16+
data "google_client_config" "current" {}
17+
18+
locals {
19+
project_id = data.google_client_config.current.project
20+
}
21+
1622
module "networking" {
1723
source = "./modules/networking"
1824
namespace = var.namespace
@@ -34,6 +40,13 @@ module "database" {
3440
depends_on = [module.networking]
3541
}
3642

43+
module "storage" {
44+
source = "./modules/storage"
45+
namespace = var.namespace
46+
47+
deletion_protection = var.deletion_protection
48+
}
49+
3750
module "redis" {
3851
source = "./modules/redis"
3952
namespace = var.namespace

modules/helm_release/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ locals {
44
}
55

66
image_tags = {
7-
"webservice.image.tag" = "e2b19bd",
8-
"migrations.image.tag" = "e2b19bd",
9-
"event-worker.image.tag" = "e2b19bd",
10-
"job-policy-checker.image.tag" = "e2b19bd",
7+
"webservice.image.tag" = "a324758",
8+
"migrations.image.tag" = "f8372a7",
9+
"event-worker.image.tag" = "a324758",
10+
"job-policy-checker.image.tag" = "a324758",
1111
}
1212

1313
postgres_settings = {

modules/storage/main.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
data "google_client_config" "current" {}
3+
4+
resource "google_storage_bucket" "this" {
5+
name = var.namespace
6+
location = data.google_client_config.current.region
7+
project = data.google_client_config.current.project
8+
9+
uniform_bucket_level_access = true
10+
force_destroy = !var.deletion_protection
11+
12+
labels = var.labels
13+
14+
cors {
15+
origin = ["*"]
16+
method = ["GET", "HEAD", "PUT"]
17+
response_header = ["*"]
18+
max_age_seconds = 3000
19+
}
20+
}

modules/storage/variables.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
variable "namespace" {
2+
description = "The namespace for the Redis instance."
3+
type = string
4+
}
5+
6+
variable "deletion_protection" {
7+
description = "Whether to protect the bucket from deletion."
8+
type = bool
9+
default = false
10+
}
11+
12+
variable "labels" {
13+
description = "Labels for the bucket."
14+
type = map(string)
15+
default = {}
16+
}

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ variable "google_auth" {
5959

6060
variable "chart_version" {
6161
type = string
62-
default = "0.1.29"
62+
default = "0.1.35"
6363
}
6464

6565
variable "github_bot" {

0 commit comments

Comments
 (0)