Skip to content

GCP-specific edits before apply

GCP needs no edit to complete an installation. Every value resolves at render time, so the flags carry the whole installation and up runs it end to end.

What follows is for the cases where your organisation requires something the install flags do not express. Reach for these once, and prefer the spec for anything it can carry.

Tighten the registry grant

This and the next are IAM-shape changes, which the install surface does not express.

Runtime holds roles/artifactregistry.writer at project scope:

resource "google_project_iam_member" "runtime_artifact_registry_writer" {
  project = "<gcp-project-id>"
  role    = "roles/artifactregistry.writer"
  member  = "serviceAccount:dp-eu-west1-runtime@<gcp-project-id>.iam.gserviceaccount.com"
}

In a project holding repositories beyond this installation, narrow it to the repository the same way the delegate's grant is written:

resource "google_artifact_registry_repository_iam_member" "runtime_repository_writer" {
  project    = "<gcp-project-id>"
  location   = "<region>"
  repository = "<repository>"
  role       = "roles/artifactregistry.writer"
  member     = "serviceAccount:dp-eu-west1-runtime@<gcp-project-id>.iam.gserviceaccount.com"
}

Narrow the bucket grant

roles/storage.objectAdmin is bucket-wide. Where the bucket is shared, an IAM condition on the object prefix restricts it to the installation's own path.

Point impersonation at a private endpoint

On a restricted network, set the endpoint in the spec rather than the rendered file:

provider_config:
  gcp_iamcredentials_endpoint: https://iamcredentials.private.example

See Air-gapped deployment for the endpoint fields each provider requires.

Add organisation labels or naming

Resource naming derives from dp_install. Where your project requires labels or a naming convention Terraform can express, add them to the rendered file.

Where to make each change

Change Put it in
Endpoints, namespaces, images, node count, approved namespaces install.input.yaml
IAM scope, conditions, labels terraform/main.tf
The registry and bucket themselves Your own infrastructure, outside the bundle

Spec changes survive a re-prepare; edits to rendered files are rewritten by it. Keep the bundle in version control so a rendered-file edit is a diff you re-apply. See Editing generated files.

Before you apply

cd install/dp-eu-west1/terraform
terraform init
terraform plan

apply runs Terraform in this directory, so a plan you are happy with is what will run.