Skip to content

Commit 904f6e4

Browse files
committed
chore: add service account to tf script and move script
1 parent 1174481 commit 904f6e4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

terraform/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,12 @@ resource "google_storage_bucket" "bucket" {
3232
name = "${var.openshift_namespace}-${each.value}"
3333
location = local.region
3434
}
35+
36+
# Create GCP service accounts for each GCS bucket
37+
resource "google_service_account" "account" {
38+
for_each = { for v in var.apps : v => v }
39+
account_id = "sa-${var.openshift_namespace}-${each.value}"
40+
display_name = "${var.openshift_namespace}-${each.value} Service Account"
41+
depends_on = [google_storage_bucket.bucket]
42+
}
43+

terraform/tf-migration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SOURCE_STATE_PATH="./temp-state/tfcloud.tfstate"
33
TARGET_STATE_PATH="./temp-state/local.tfstate"
44

55
NAMESPACE="c53ff1-dev"
6-
declare -a PATHS=("google_storage_bucket.bucket")
6+
declare -a PATHS=("google_storage_bucket.bucket" "google_service_account.account")
77
declare -a APPS=("cif-documents" "cif-backups")
88

99
for path in "${PATHS[@]}"; do

0 commit comments

Comments
 (0)