-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
45 lines (42 loc) · 1.28 KB
/
variables.tf
File metadata and controls
45 lines (42 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
variable "region" {
description = "AWS region where we are creating rules"
type = string
default = "" # If unset we are getting region from the data.aws_region
}
variable "registries" {
description = "List of registries to create rules for"
type = map(object({
registry = string
username = optional(string)
accessToken = optional(string)
repository_read_access_arns = optional(list(string))
image_tag_mutability = optional(string)
lifecycle_policy = optional(object({
rules = list(object({
rulePriority = number
description = string
selection = object({
tagStatus = string
countType = string
countNumber = number
})
action = object({
type = string
})
}))
}))
}))
validation {
condition = alltrue([
for k, v in var.registries : (
(v.username == null && v.accessToken == null) || (v.username != null && v.accessToken != null)
)
])
error_message = "If 'username' is set for a registry, 'accessToken' must also be provided."
}
}
variable "tags" {
description = "Tags that will be assigned to all resources"
type = map(string)
default = {}
}