diff --git a/modules/artifact-registry/README.md b/modules/artifact-registry/README.md index bf0a82cc..49fd84c2 100644 --- a/modules/artifact-registry/README.md +++ b/modules/artifact-registry/README.md @@ -13,7 +13,7 @@ module "docker_artifact_registry" { location = "europe-west1" format = "DOCKER" id = "myregistry" - iam_members = { + iam = { "roles/artifactregistry.admin" = ["group:cicd@example.com"] } } @@ -28,7 +28,7 @@ module "docker_artifact_registry" { | project_id | Registry project id. | string | ✓ | | | *description* | An optional description for the repository | string | | Terraform-managed registry | | *format* | Repository format. One of DOCKER or UNSPECIFIED | string | | DOCKER | -| *iam_members* | Map of member lists used to set authoritative bindings, keyed by role. | map(set(string)) | | {} | +| *iam* | IAM bindings in {ROLE => [MEMBERS]} format. | map(list(string)) | | {} | | *labels* | Labels to be attached to the registry. | map(string) | | {} | | *location* | Registry location. Use `gcloud beta artifacts locations list' to get valid values | string | | | diff --git a/modules/artifact-registry/main.tf b/modules/artifact-registry/main.tf index 7a7a07d2..9b687873 100644 --- a/modules/artifact-registry/main.tf +++ b/modules/artifact-registry/main.tf @@ -26,7 +26,7 @@ resource "google_artifact_registry_repository" "registry" { resource "google_artifact_registry_repository_iam_binding" "bindings" { provider = google-beta - for_each = var.iam_members + for_each = var.iam project = var.project_id location = google_artifact_registry_repository.registry.location repository = google_artifact_registry_repository.registry.name diff --git a/modules/artifact-registry/variables.tf b/modules/artifact-registry/variables.tf index 0726053a..b977f6c7 100644 --- a/modules/artifact-registry/variables.tf +++ b/modules/artifact-registry/variables.tf @@ -14,9 +14,9 @@ * limitations under the License. */ -variable "iam_members" { - description = "Map of member lists used to set authoritative bindings, keyed by role." - type = map(set(string)) +variable "iam" { + description = "IAM bindings in {ROLE => [MEMBERS]} format." + type = map(list(string)) default = {} }