google_container_registry

Ensures that the Google Cloud Storage bucket that backs Google Container Registry exists. Creating this resource will create the backing bucket if it does not exist, or do nothing if the bucket already exists. Destroying this resource does NOT destroy the backing bucket. For more information see the official documentation

This resource can be used to ensure that the GCS bucket exists prior to assigning permissions. For more information see the access control page for GCR.

Example Usage

resource "google_container_registry" "registry" {
  project  = "my-project"
  location = "EU"
}

The id field of the google_container_registry is the identifier of the storage bucket that backs GCR and can be used to assign permissions to the bucket.

resource "google_container_registry" "registry" {
  project  = "my-project"
  location = "EU"
}

resource "google_storage_bucket_iam_member" "viewer" {
  bucket = google_container_registry.registry.id
  role = "roles/storage.objectViewer"
  member = "user:jane@example.com"
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Import

This resource does not support import.