2020-05-26 03:03:15 -07:00
|
|
|
# Google Cloud Artifact Registry Module
|
|
|
|
|
|
|
|
This module simplifies the creation of repositories using Google Cloud Artifact Registry.
|
|
|
|
|
2023-07-28 05:18:28 -07:00
|
|
|
<!-- BEGIN TOC -->
|
|
|
|
- [Standard Repository](#standard-repository)
|
|
|
|
- [Remote and Virtual Repositories](#remote-and-virtual-repositories)
|
2023-07-28 07:38:26 -07:00
|
|
|
- [Additional Docker and Maven Options](#additional-docker-and-maven-options)
|
2023-07-28 05:18:28 -07:00
|
|
|
- [Variables](#variables)
|
|
|
|
- [Outputs](#outputs)
|
|
|
|
<!-- END TOC -->
|
|
|
|
|
2023-07-28 02:54:36 -07:00
|
|
|
## Standard Repository
|
2020-05-26 03:03:15 -07:00
|
|
|
|
|
|
|
```hcl
|
|
|
|
module "docker_artifact_registry" {
|
2022-09-06 08:46:09 -07:00
|
|
|
source = "./fabric/modules/artifact-registry"
|
2020-05-26 03:03:15 -07:00
|
|
|
project_id = "myproject"
|
|
|
|
location = "europe-west1"
|
2023-07-28 02:54:36 -07:00
|
|
|
name = "myregistry"
|
2023-06-19 22:53:37 -07:00
|
|
|
iam = {
|
2020-05-26 03:03:15 -07:00
|
|
|
"roles/artifactregistry.admin" = ["group:cicd@example.com"]
|
|
|
|
}
|
|
|
|
}
|
2022-01-28 11:15:35 -08:00
|
|
|
# tftest modules=1 resources=2
|
2020-05-26 03:03:15 -07:00
|
|
|
```
|
2023-07-28 02:54:36 -07:00
|
|
|
|
|
|
|
## Remote and Virtual Repositories
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
|
|
|
module "registry-local" {
|
|
|
|
source = "./fabric/modules/artifact-registry"
|
|
|
|
project_id = var.project_id
|
|
|
|
location = "europe-west1"
|
|
|
|
name = "local"
|
|
|
|
format = { python = {} }
|
|
|
|
}
|
|
|
|
|
|
|
|
module "registry-remote" {
|
|
|
|
source = "./fabric/modules/artifact-registry"
|
|
|
|
project_id = var.project_id
|
|
|
|
location = "europe-west1"
|
|
|
|
name = "remote"
|
|
|
|
format = { python = {} }
|
|
|
|
mode = { remote = true }
|
|
|
|
}
|
|
|
|
|
|
|
|
module "registry-virtual" {
|
|
|
|
source = "./fabric/modules/artifact-registry"
|
|
|
|
project_id = var.project_id
|
|
|
|
location = "europe-west1"
|
|
|
|
name = "virtual"
|
|
|
|
format = { python = {} }
|
|
|
|
mode = {
|
|
|
|
virtual = {
|
|
|
|
remote = {
|
|
|
|
repository = module.registry-remote.id
|
|
|
|
priority = 1
|
|
|
|
}
|
|
|
|
local = {
|
|
|
|
repository = module.registry-local.id
|
|
|
|
priority = 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-28 07:38:26 -07:00
|
|
|
# tftest modules=3 resources=3 inventory=remote-virtual.yaml
|
2023-07-28 02:54:36 -07:00
|
|
|
```
|
|
|
|
|
2023-07-28 07:38:26 -07:00
|
|
|
## Additional Docker and Maven Options
|
2023-07-28 02:54:36 -07:00
|
|
|
|
2023-07-28 07:38:26 -07:00
|
|
|
```hcl
|
2023-07-28 02:54:36 -07:00
|
|
|
|
|
|
|
module "registry-docker" {
|
|
|
|
source = "./fabric/modules/artifact-registry"
|
|
|
|
project_id = var.project_id
|
|
|
|
location = "europe-west1"
|
|
|
|
name = "docker"
|
|
|
|
format = {
|
|
|
|
docker = {
|
|
|
|
immutable_tags = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module "registry-maven" {
|
|
|
|
source = "./fabric/modules/artifact-registry"
|
|
|
|
project_id = var.project_id
|
|
|
|
location = "europe-west1"
|
|
|
|
name = "maven"
|
|
|
|
format = {
|
|
|
|
maven = {
|
|
|
|
allow_snapshot_overwrites = true
|
|
|
|
version_policy = "RELEASE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# tftest modules=2 resources=2
|
|
|
|
```
|
2020-05-26 03:03:15 -07:00
|
|
|
<!-- BEGIN TFDOC -->
|
|
|
|
## Variables
|
|
|
|
|
|
|
|
| name | description | type | required | default |
|
2021-12-20 23:51:51 -08:00
|
|
|
|---|---|:---:|:---:|:---:|
|
2023-07-28 02:54:36 -07:00
|
|
|
| [location](variables.tf#L68) | Registry location. Use `gcloud beta artifacts locations list' to get valid values. | <code>string</code> | ✓ | |
|
|
|
|
| [name](variables.tf#L93) | Registry name. | <code>string</code> | ✓ | |
|
|
|
|
| [project_id](variables.tf#L98) | Registry project id. | <code>string</code> | ✓ | |
|
2022-01-31 01:45:34 -08:00
|
|
|
| [description](variables.tf#L17) | An optional description for the repository. | <code>string</code> | | <code>"Terraform-managed registry"</code> |
|
2023-06-20 00:27:15 -07:00
|
|
|
| [encryption_key](variables.tf#L23) | The KMS key name to use for encryption at rest. | <code>string</code> | | <code>null</code> |
|
2023-07-28 02:54:36 -07:00
|
|
|
| [format](variables.tf#L29) | Repository format. | <code title="object({ apt = optional(object({})) docker = optional(object({ immutable_tags = optional(bool) })) kfp = optional(object({})) go = optional(object({})) maven = optional(object({ allow_snapshot_overwrites = optional(bool) version_policy = optional(string) })) npm = optional(object({})) python = optional(object({})) yum = optional(object({})) })">object({…})</code> | | <code>{ docker = {} }</code> |
|
|
|
|
| [iam](variables.tf#L56) | IAM bindings in {ROLE => [MEMBERS]} format. | <code>map(list(string))</code> | | <code>{}</code> |
|
|
|
|
| [labels](variables.tf#L62) | Labels to be attached to the registry. | <code>map(string)</code> | | <code>{}</code> |
|
|
|
|
| [mode](variables.tf#L73) | Repository mode. | <code title="object({ standard = optional(bool) remote = optional(bool) virtual = optional(map(object({ repository = string priority = number }))) })">object({…})</code> | | <code>{ standard = true }</code> |
|
2020-05-26 03:03:15 -07:00
|
|
|
|
|
|
|
## Outputs
|
|
|
|
|
|
|
|
| name | description | sensitive |
|
|
|
|
|---|---|:---:|
|
2023-06-02 07:07:22 -07:00
|
|
|
| [id](outputs.tf#L17) | Fully qualified repository id. | |
|
2023-07-31 02:34:01 -07:00
|
|
|
| [image_path](outputs.tf#L22) | Repository path for images. | |
|
|
|
|
| [name](outputs.tf#L32) | Repository name. | |
|
2020-05-26 03:03:15 -07:00
|
|
|
<!-- END TFDOC -->
|