-
Notifications
You must be signed in to change notification settings - Fork 623
/
variables.ami-housekeepr.tf
70 lines (62 loc) · 2.35 KB
/
variables.ami-housekeepr.tf
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
variable "enable_ami_housekeeper" {
description = "Option to disable the lambda to clean up old AMIs."
type = bool
default = false
}
variable "ami_housekeeper_lambda_zip" {
description = "File location of the lambda zip file."
type = string
default = null
}
variable "ami_housekeeper_lambda_timeout" {
description = "Time out of the lambda in seconds."
type = number
default = 300
}
variable "ami_housekeeper_lambda_s3_key" {
description = "S3 key for syncer lambda function. Required if using S3 bucket to specify lambdas."
type = string
default = null
}
variable "ami_housekeeper_lambda_s3_object_version" {
description = "S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket."
type = string
default = null
}
variable "ami_housekeeper_lambda_schedule_expression" {
description = "Scheduler expression for action runner binary syncer."
type = string
default = "rate(1 day)"
}
variable "ami_housekeeper_cleanup_config" {
description = <<EOF
Configuration for AMI cleanup.
`amiFilters` - Filters to use when searching for AMIs to cleanup. Default filter for images owned by the account and that are available.
`dryRun` - If true, no AMIs will be deregistered. Default false.
`launchTemplateNames` - Launch template names to use when searching for AMIs to cleanup. Default no launch templates.
`maxItems` - The maximum numer of AMI's tha will be queried for cleanup. Default no maximum.
`minimumDaysOld` - Minimum number of days old an AMI must be to be considered for cleanup. Default 30.
`ssmParameterNames` - SSM parameter names to use when searching for AMIs to cleanup. This parameter should be set when using SSM to configure the AMI to use. Default no SSM parameters.
EOF
type = object({
amiFilters = optional(list(object({
Name = string
Values = list(string)
})),
[{
Name : "state",
Values : ["available"],
},
{
Name : "image-type",
Values : ["machine"],
}]
)
dryRun = optional(bool, false)
launchTemplateNames = optional(list(string))
maxItems = optional(number)
minimumDaysOld = optional(number, 30)
ssmParameterNames = optional(list(string))
})
default = {}
}