https://github.com/sparkfabrik/terraform-google-gcp-artifact-registry
Terraform Google GCP Artifact Registry
https://github.com/sparkfabrik/terraform-google-gcp-artifact-registry
Last synced: 4 months ago
JSON representation
Terraform Google GCP Artifact Registry
- Host: GitHub
- URL: https://github.com/sparkfabrik/terraform-google-gcp-artifact-registry
- Owner: sparkfabrik
- License: gpl-3.0
- Created: 2023-04-11T08:46:39.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-11T17:05:08.000Z (5 months ago)
- Last Synced: 2025-02-15T10:04:00.902Z (5 months ago)
- Language: HCL
- Size: 52.7 KB
- Stars: 0
- Watchers: 7
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform GCP Artifact Registry

This module enable Artifact Registry api in the GCP (Google Cloud Platform) project, create repositories and assign read and write IAM permissions.
You MUST configure the required "google" provider inside your root module.
This module is provided without any kind of warranty and is GPL3 licensed.
## Providers
| Name | Version |
|------|---------|
| [google](#provider\_google) | >= 5.26.0 |## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.3 |
| [google](#requirement\_google) | >= 5.26.0 |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [additional\_labels](#input\_additional\_labels) | Additional labels to apply to all Artifact Registry resources. This variable will be merged with the default\_labels variable and the labels defined in the repositories variable. | `map(string)` | `{}` | no |
| [artifact\_registry\_listers](#input\_artifact\_registry\_listers) | List of principals that can list Artifact Registry repositories. | `list(string)` | `[]` | no |
| [artifact\_registry\_listers\_custom\_role\_name](#input\_artifact\_registry\_listers\_custom\_role\_name) | Name of the custom role for Artifact Registry listers. | `string` | `"custom.artifactRegistryLister"` | no |
| [default\_labels](#input\_default\_labels) | Default labels to apply to all Artifact Registry resources. | `map(string)` |{| no |
"managed-by": "terraform"
}
| [default\_location](#input\_default\_location) | The default location for the Artifact Registry repositories. | `string` | `"europe-west1"` | no |
| [enable\_api](#input\_enable\_api) | Enable the Artifact Registry API. | `bool` | `true` | no |
| [project\_id](#input\_project\_id) | The GCP project ID that hosts the Artifact Registry. | `string` | n/a | yes |
| [repositories](#input\_repositories) | List of Artifact Registry repositories to create. |map(object({| n/a | yes |
description = string
format = optional(string, "DOCKER")
mode = optional(string, "STANDARD_REPOSITORY")
cleanup_policy_dry_run = optional(bool, true)
cleanup_policies = optional(map(object({
action = optional(string, ""),
condition = optional(object({
tag_state = optional(string),
tag_prefixes = optional(list(string), []),
version_name_prefixes = optional(list(string), []),
package_name_prefixes = optional(list(string), []),
older_than = optional(string),
newer_than = optional(string),
}), {}),
most_recent_versions = optional(object({
package_name_prefixes = optional(list(string), []),
keep_count = optional(number, 0)
}), {})
})), {})
docker_immutable_tags = optional(bool, false)
virtual_repository_config = optional(map(object({
repository = string
priority = optional(number, 0)
})), null)
remote_repository_config_docker = optional(object({
description = optional(string, "")
custom_repository_uri = string
disable_upstream_validation = optional(bool, false)
username_password_credentials_username = optional(string, "")
username_password_credentials_password_secret_name = optional(string, "")
username_password_credentials_password_secret_version = optional(string, "")
}), null)
readers = optional(list(string), [])
writers = optional(list(string), [])
location = optional(string, "")
labels = optional(map(string), {})
}))## Outputs
| Name | Description |
|------|-------------|
| [custom\_role\_artifact\_registry\_lister\_id](#output\_custom\_role\_artifact\_registry\_lister\_id) | The ID of the custom role for Artifact Registry listers. The role is created only if the list of Artifact Registry listers is not empty. |
| [repositories](#output\_repositories) | The created Artifact Repository repositories. |## Resources
| Name | Type |
|------|------|
| [google_artifact_registry_repository.repositories](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/artifact_registry_repository) | resource |
| [google_artifact_registry_repository_iam_member.member](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/artifact_registry_repository_iam_member) | resource |
| [google_project_iam_binding.artifact_registry_lister](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_iam_binding) | resource |
| [google_project_iam_custom_role.artifact_registry_lister](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_iam_custom_role) | resource |
| [google_project_service.project](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_service) | resource |
| [google_secret_manager_secret_version.remote_repository_secrets](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/secret_manager_secret_version) | data source |## Modules
No modules.