-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgcr.tf
31 lines (25 loc) · 985 Bytes
/
gcr.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
provider "google-beta" {
project = var.project
region = local.region
}
resource "google_artifact_registry_repository" "domino" {
location = local.region
repository_id = "${var.deploy_id}-domino"
format = "DOCKER"
docker_config {
immutable_tags = true
}
}
resource "google_artifact_registry_repository_iam_member" "gcr" {
repository = google_artifact_registry_repository.domino.name
location = google_artifact_registry_repository.domino.location
role = "roles/artifactregistry.writer"
member = "serviceAccount:${google_service_account.accounts["gcr"].email}"
}
resource "google_artifact_registry_repository_iam_member" "platform" {
count = var.migration_permissions ? 1 : 0
repository = google_artifact_registry_repository.domino.name
location = google_artifact_registry_repository.domino.location
role = "roles/artifactregistry.writer"
member = "serviceAccount:${google_service_account.accounts["platform"].email}"
}