
The module creates any number of Artifact Registries in Google Cloud with custom image retention and access policies.
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
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.0.0"
# specify module inputs here or try one of the examples below
...
}
Initialize the setup:
shellterraform init
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.0
and run
terraform init -upgrade
For the safest setup, use strict pinning with version = "1.0.0"
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
First stable version
Multiple repositories with custom configurations (different locations, access policies and labels):
hclmodule "gcr" {
source = "solutions.corewide.com/google-cloud/tf-gcp-gcr/google"
version = "~> 1.0"
repos = {
foo = {
location = "us-east1"
rw_accounts = {
serviceAccount = ["[email protected]"]
}
labels = {
name = "foo"
}
}
bar = {
location = "us-west1"
description = "Custom repository description"
max_images = 100
ro_accounts = {
user = ["[email protected]"]
}
labels = {
name = "bar"
}
}
}
}
Minimal setup with one repository:
hclmodule "gcr" {
source = "solutions.corewide.com/google-cloud/tf-gcp-gcr/google"
version = "~> 1.0"
repos = {
foo = {}
}
}
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 |
Output | Description | Type | Sensitive |
---|---|---|---|
repositories |
Map of repository data | computed |
no |
Dependency | Version | Kind |
---|---|---|
terraform |
>= 1.3 |
CLI |
hashicorp/google |
~> 6.2 |
provider |