2020-05-26 03:03:15 -07:00
|
|
|
/**
|
2023-07-28 02:54:36 -07:00
|
|
|
* Copyright 2023 Google LLC
|
2020-05-26 03:03:15 -07:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-12-01 02:33:02 -08:00
|
|
|
variable "cleanup_policies" {
|
|
|
|
description = "Object containing details about the cleanup policies for an Artifact Registry repository."
|
|
|
|
type = map(object({
|
|
|
|
action = string
|
|
|
|
condition = optional(object({
|
|
|
|
tag_state = optional(string)
|
|
|
|
tag_prefixes = optional(list(string))
|
|
|
|
older_than = optional(string)
|
|
|
|
newer_than = optional(string)
|
|
|
|
package_name_prefixes = optional(list(string))
|
|
|
|
version_name_prefixes = optional(list(string))
|
|
|
|
}))
|
|
|
|
most_recent_versions = optional(object({
|
|
|
|
package_name_prefixes = optional(list(string))
|
|
|
|
keep_count = optional(number)
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
|
|
|
|
default = null
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "cleanup_policy_dry_run" {
|
|
|
|
description = "If true, the cleanup pipeline is prevented from deleting versions in this repository."
|
|
|
|
type = bool
|
|
|
|
default = null
|
|
|
|
}
|
|
|
|
|
2021-10-08 09:26:04 -07:00
|
|
|
variable "description" {
|
2022-01-31 01:45:34 -08:00
|
|
|
description = "An optional description for the repository."
|
2021-10-08 09:26:04 -07:00
|
|
|
type = string
|
|
|
|
default = "Terraform-managed registry"
|
|
|
|
}
|
|
|
|
|
2023-06-20 00:27:15 -07:00
|
|
|
variable "encryption_key" {
|
|
|
|
description = "The KMS key name to use for encryption at rest."
|
|
|
|
type = string
|
|
|
|
default = null
|
|
|
|
}
|
|
|
|
|
2021-10-08 09:26:04 -07:00
|
|
|
variable "format" {
|
2023-07-28 02:54:36 -07:00
|
|
|
description = "Repository format."
|
|
|
|
type = 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({}))
|
|
|
|
})
|
|
|
|
nullable = false
|
|
|
|
default = { docker = {} }
|
|
|
|
validation {
|
|
|
|
condition = (
|
|
|
|
length([for k, v in var.format : k if v != null]) == 1
|
|
|
|
)
|
|
|
|
error_message = "Multiple or zero formats are not supported."
|
|
|
|
}
|
2021-10-08 09:26:04 -07:00
|
|
|
}
|
|
|
|
|
2020-11-04 07:56:57 -08:00
|
|
|
variable "iam" {
|
|
|
|
description = "IAM bindings in {ROLE => [MEMBERS]} format."
|
|
|
|
type = map(list(string))
|
2020-05-26 03:03:15 -07:00
|
|
|
default = {}
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "labels" {
|
|
|
|
description = "Labels to be attached to the registry."
|
|
|
|
type = map(string)
|
|
|
|
default = {}
|
|
|
|
}
|
|
|
|
|
2021-10-08 09:26:04 -07:00
|
|
|
variable "location" {
|
2022-01-31 01:45:34 -08:00
|
|
|
description = "Registry location. Use `gcloud beta artifacts locations list' to get valid values."
|
2020-05-26 03:03:15 -07:00
|
|
|
type = string
|
2023-07-28 02:54:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "mode" {
|
|
|
|
description = "Repository mode."
|
|
|
|
type = object({
|
|
|
|
standard = optional(bool)
|
|
|
|
remote = optional(bool)
|
|
|
|
virtual = optional(map(object({
|
|
|
|
repository = string
|
|
|
|
priority = number
|
|
|
|
})))
|
|
|
|
})
|
|
|
|
nullable = false
|
|
|
|
default = { standard = true }
|
|
|
|
validation {
|
|
|
|
condition = (
|
|
|
|
length([for k, v in var.mode : k if v != null && v != false]) == 1
|
|
|
|
)
|
|
|
|
error_message = "Multiple or zero modes are not supported."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "name" {
|
|
|
|
description = "Registry name."
|
|
|
|
type = string
|
2020-05-26 03:03:15 -07:00
|
|
|
}
|
|
|
|
|
2021-10-08 09:26:04 -07:00
|
|
|
variable "project_id" {
|
|
|
|
description = "Registry project id."
|
2020-05-26 03:03:15 -07:00
|
|
|
type = string
|
|
|
|
}
|