The module creates any number of Artifact Registries in Google Cloud with custom image retention, access, and vulnerability scanning 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 = "~> 3.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
~> 3.0 and run
terraform init -upgrade
For the safest setup, use strict pinning with version = "3.0.0"
|
Module
15% off
|
$255
|
| TOTAL | $255 |
The module creates any number of Artifact Registries in Google Cloud with custom image retention, access, and vulnerability scanning policies.
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
8.4(Last version compatible with the GCP Terraform provider version 7.0)
project_id variable7.0(Last version compatible with the GCP Terraform provider version v6.0)
vulnerability_scanning_enabled variable to toggle automatic vulnerability scanning for artifacts pushed to a repositoryFirst stable version
v1.x to v2.xModule from v2.0 has changed GCP Terraform provider version, which isn't compatible with older versions. After the module version is upgraded, re-init the module to upgrade the provider version. Upgrade the GCP provider version at the project level:
hclterraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 7.0"
}
}
}
Upgrade project dependencies:
bashterraform init --upgrade
Update the declaration of the module according to the requirements and examples to match the designed configuration, then the configuration can be applied.
Apply the changes to make sure the state of the resources is up-to-date with the new provider version:
bashterraform apply
v2.x to v3.xModule from v3.0 has changed GCP Terraform provider version, which isn't compatible with older versions. After the module version is upgraded, re-init the module to upgrade the provider version. Upgrade the GCP provider version at the project level:
hclterraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 8.4"
}
}
}
Upgrade project dependencies:
bashterraform init --upgrade
Update the declaration of the module according to the requirements and examples to match the designed configuration, then the configuration can be applied.
Apply the changes to make sure the state of the resources is up-to-date with the new provider version:
bashterraform apply
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 = "~> 3.0"
project_id = "biz"
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"
}
}
}
}
Minimal setup with one repository:
hclmodule "gcr" {
source = "solutions.corewide.com/google-cloud/tf-gcp-gcr/google"
version = "~> 3.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 | |
project_id |
GCP project ID to manage resources in. If it is not provided, the provider project is used | string |
no | 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 |
repositories[<key>] |
Repository name | computed |
no |
repositories[<key>].name |
Name of the repository | computed |
no |
repositories[<key>].url |
URL of the repository | computed |
no |
| Dependency | Version | Kind |
|---|---|---|
terraform |
>= 1.3 |
CLI |
hashicorp/google |
~> 8.4 |
provider |