» google_artifact_registry_repository

A repository for storing artifacts

To get more information about Repository, see:

» Example Usage - Artifact Registry Repository Basic

resource "google_artifact_registry_repository" "my-repo" {
  provider = google-beta

  location = "us-central1"
  repository_id = "my-repository"
  description = "example docker repository"
  format = "DOCKER"

» Example Usage - Artifact Registry Repository Iam

resource "google_artifact_registry_repository" "my-repo" {
  provider = google-beta

  location = "us-central1"
  repository_id = "my-repository"
  description = "example docker repository with iam"
  format = "DOCKER"

resource "google_service_account" "test-account" {
  provider = google-beta

  account_id   = "my-account"
  display_name = "Test Service Account"

resource "google_artifact_registry_repository_iam_member" "test-iam" {
  provider = google-beta

  location = google_artifact_registry_repository.my-repo.location
  repository = google_artifact_registry_repository.my-repo.name
  role   = "roles/artifactregistry.reader"
  member = "serviceAccount:${google_service_account.test-account.email}"

» Argument Reference

The following arguments are supported:

  • repository_id - (Required) The last part of the repository name, for example: "repo1"

  • format - (Required) The format of packages that are stored in the repoitory.

Possible values are: * DOCKER

  • location - (Optional) The name of the location this repository is located in.

  • description - (Optional) The user-provided description of the repository.

  • labels - (Optional) Labels with user-defined metadata. This field may contain up to 64 entries. Label keys and values may be no longer than 63 characters. Label keys must begin with a lowercase letter and may only contain lowercase letters, numeric characters, underscores, and dashes.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

» Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/repositories/{{repsitory_id}}

  • name - The name of the repository, for example: "projects/p1/locations/us-central1/repositories/repo1"

  • create_time - The time when the repository was created.

  • update_time - The time when the repository was last updated.

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 4 minutes.
  • update - Default is 4 minutes.
  • delete - Default is 4 minutes.

» Import

Repository can be imported using any of these accepted formats:

$ terraform import -provider=google-beta google_artifact_registry_repository.default projects/{{project}}/locations/{{location}}/repositories/{{name}}
$ terraform import -provider=google-beta google_artifact_registry_repository.default {{project}}/{{location}}/{{name}}
$ terraform import -provider=google-beta google_artifact_registry_repository.default {{location}}/{{name}}

» User Project Overrides

This resource supports User Project Overrides.