The module creates any number of Artifact Registries in Google Cloud with custom image retention, access, and vulnerability scanning policies.

NOTE: To enable vulnerability scanning of artifacts stored in the repository by setting vulnerability_scanning_enabled variable to true, make sure the Container Scanning API is enabled for the project

Log in to Corewide IaC registry

Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:

 shellterraform login solutions.corewide.com
Provision instructions

Initialize mandatory providers:

Copy and paste into your Terraform configuration and insert the variables:

 hclmodule "tf_gcp_gcr" {
  source  = "solutions.corewide.com/google-cloud/tf-gcp-gcr/google"
  version = "~> 1.1.0"

  # specify module inputs here or try one of the examples below
  ...
}

Initialize the setup:

 shellterraform init
Define update strategy

Corewide DevOps team strictly follows Semantic Versioning Specification to provide our clients with products that have predictable upgrades between versions. We recommend pinning patch versions of our modules using pessimistic constraint operator (~>) to prevent breaking changes during upgrades.

To get new features during the upgrades (without breaking compatibility), use ~> 1.1 and run terraform init -upgrade

For the safest setup, use strict pinning with version = "1.1.0"

Artifact Registry in Google Cloud

Artifact Registry management in Google Cloud
$250
BUY
566
v1.1.0 released 1 month ago
New version approx. every 21 weeks

The module creates any number of Artifact Registries in Google Cloud with custom image retention, access, and vulnerability scanning policies.

NOTE: To enable vulnerability scanning of artifacts stored in the repository by setting vulnerability_scanning_enabled variable to true, make sure the Container Scanning API is enabled for the project

Minimal setup with one repository:

 hclmodule "gcr" {
  source  = "solutions.corewide.com/google-cloud/tf-gcp-gcr/google"
  version = "~> 1.1"

  repos = {
    foo = {}
  }
}

Multiple repositories with custom configurations (different locations, access policies and labels, automatic vulnerability scanning settings):

 hclmodule "gcr" {
  source  = "solutions.corewide.com/google-cloud/tf-gcp-gcr/google"
  version = "~> 1.1"

  repos = {
    foo = {
      location = "us-east1"

      rw_accounts = {
        serviceAccount = ["[email protected]"]
      }

      labels = {
        name = "foo"
      }
    }
    bar = {
      location                       = "us-west1"
      description                    = "Custom repository description"
      max_images                     = 100
      vulnerability_scanning_enabled = true

      ro_accounts = {
        user = ["[email protected]"]
      }

      labels = {
        name = "bar"
      }
    }
  }
}
Variable Description Type Default Required Sensitive
repos Map of repositories parameters map(object) yes no
repos[<key>] Repository name string yes no
repos[<key>].description User-provided description of the repository string no no
repos[<key>].labels Labels with user-defined metadata map(string) {} no no
repos[<key>].location Location the repository is located in string no no
repos[<key>].max_images Number of images stored before cleanup starts number 50 no no
repos[<key>].ro_accounts List of members with read only access to the repository map(list(string)) {} no no
repos[<key>].rw_accounts List of members with read/write access to the repository map(list(string)) {} no no
repos[<key>].vulnerability_scanning_enabled Whether vulnerability scanning is automatically performed for artifacts pushed to the repository. Container Scanning API must be enabled on the project level, see NOTES in the module description section bool false no no
Output Description Type Sensitive
repositories Map of repository data computed no
Dependency Version Kind
terraform >= 1.3 CLI
hashicorp/google ~> 6.2 provider

Not sure where to start?
Let's find your perfect match.