Skip to content

Commit

Permalink
Merge pull request #497 from battlecode/jerrym-saturn-perms
Browse files Browse the repository at this point in the history
Give saturn permission to access private data
  • Loading branch information
j-mao authored Jan 9, 2023
2 parents d1c4f5f + 5b48d56 commit 473c778
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deploy/galaxy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ module "saturn_compile" {
storage_secure_name = google_storage_bucket.secure.name

artifact_registry_name = var.artifact_registry_name
storage_releases_name = var.storage_releases_name

secret_id = google_secret_manager_secret.saturn.secret_id

Expand Down Expand Up @@ -202,6 +203,7 @@ module "saturn_execute" {
storage_secure_name = google_storage_bucket.secure.name

artifact_registry_name = var.artifact_registry_name
storage_releases_name = var.storage_releases_name

secret_id = google_secret_manager_secret.saturn.secret_id

Expand Down
5 changes: 5 additions & 0 deletions deploy/galaxy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ variable "siarnaq_secrets" {
type = map
}

variable "storage_releases_name" {
description = "Name of Google Cloud Storage bucket resource for game releases"
type = string
}

variable "artifact_registry_name" {
description = "Name of the Artifact Registry where the build image can be found"
type = string
Expand Down
2 changes: 2 additions & 0 deletions deploy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module "production" {
max_compile_instances = 5
max_execute_instances = 50
saturn_secrets = var.saturn_secrets_production
storage_releases_name = module.releases.storage_bucket_name

depends_on = [
google_project_service.artifactregistry,
Expand Down Expand Up @@ -85,6 +86,7 @@ module "staging" {
max_compile_instances = 1
max_execute_instances = 1
saturn_secrets = var.saturn_secrets_staging
storage_releases_name = module.releases.storage_bucket_name

depends_on = [
google_project_service.artifactregistry,
Expand Down
6 changes: 6 additions & 0 deletions deploy/saturn/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ resource "google_storage_bucket_iam_member" "secure" {
member = "serviceAccount:${google_service_account.this.email}"
}

resource "google_storage_bucket_iam_member" "releases" {
bucket = var.storage_releases_name
role = "roles/storage.objectViewer"
member = "serviceAccount:${google_service_account.this.email}"
}

resource "google_artifact_registry_repository_iam_member" "this" {
location = var.gcp_region
repository = var.artifact_registry_name
Expand Down
5 changes: 5 additions & 0 deletions deploy/saturn/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ variable "artifact_registry_name" {
type = string
}

variable "storage_releases_name" {
description = "Name of Google Cloud Storage bucket resource for game releases"
type = string
}

variable "secret_id" {
description = "ID of the Secret resource"
type = string
Expand Down

0 comments on commit 473c778

Please sign in to comment.