|
| 1 | +variable "ecs_cluster" { |
| 2 | + type = string |
| 3 | + description = "The name of the ECS cluster to use" |
| 4 | + nullable = false |
| 5 | +} |
| 6 | + |
| 7 | +variable "vpc_id" { |
| 8 | + type = string |
| 9 | + default = null |
| 10 | +} |
| 11 | + |
| 12 | +variable "fleet_config" { |
| 13 | + type = object({ |
| 14 | + task_mem = optional(number, null) |
| 15 | + task_cpu = optional(number, null) |
| 16 | + mem = optional(number, 4096) |
| 17 | + cpu = optional(number, 512) |
| 18 | + pid_mode = optional(string, null) |
| 19 | + image = optional(string, "fleetdm/fleet:v4.64.2") |
| 20 | + family = optional(string, "fleet") |
| 21 | + sidecars = optional(list(any), []) |
| 22 | + depends_on = optional(list(any), []) |
| 23 | + mount_points = optional(list(any), []) |
| 24 | + volumes = optional(list(any), []) |
| 25 | + extra_environment_variables = optional(map(string), {}) |
| 26 | + extra_iam_policies = optional(list(string), []) |
| 27 | + extra_execution_iam_policies = optional(list(string), []) |
| 28 | + extra_secrets = optional(map(string), {}) |
| 29 | + security_group_name = optional(string, "fleet") |
| 30 | + iam_role_arn = optional(string, null) |
| 31 | + repository_credentials = optional(string, "") |
| 32 | + private_key_secret_name = optional(string, "fleet-server-private-key") |
| 33 | + service = optional(object({ |
| 34 | + name = optional(string, "fleet") |
| 35 | + }), { |
| 36 | + name = "fleet" |
| 37 | + }) |
| 38 | + database = object({ |
| 39 | + password_secret_arn = string |
| 40 | + user = string |
| 41 | + database = string |
| 42 | + address = string |
| 43 | + rr_address = optional(string, null) |
| 44 | + }) |
| 45 | + redis = object({ |
| 46 | + address = string |
| 47 | + use_tls = optional(bool, true) |
| 48 | + }) |
| 49 | + awslogs = optional(object({ |
| 50 | + name = optional(string, null) |
| 51 | + region = optional(string, null) |
| 52 | + create = optional(bool, true) |
| 53 | + prefix = optional(string, "fleet") |
| 54 | + retention = optional(number, 5) |
| 55 | + }), { |
| 56 | + name = null |
| 57 | + region = null |
| 58 | + prefix = "fleet" |
| 59 | + retention = 5 |
| 60 | + }) |
| 61 | + loadbalancer = object({ |
| 62 | + arn = string |
| 63 | + }) |
| 64 | + extra_load_balancers = optional(list(any), []) |
| 65 | + networking = object({ |
| 66 | + subnets = optional(list(string), null) |
| 67 | + security_groups = optional(list(string), null) |
| 68 | + ingress_sources = object({ |
| 69 | + cidr_blocks = optional(list(string), []) |
| 70 | + ipv6_cidr_blocks = optional(list(string), []) |
| 71 | + security_groups = optional(list(string), []) |
| 72 | + prefix_list_ids = optional(list(string), []) |
| 73 | + }) |
| 74 | + }) |
| 75 | + autoscaling = optional(object({ |
| 76 | + max_capacity = optional(number, 5) |
| 77 | + min_capacity = optional(number, 1) |
| 78 | + memory_tracking_target_value = optional(number, 80) |
| 79 | + cpu_tracking_target_value = optional(number, 80) |
| 80 | + }), { |
| 81 | + max_capacity = 5 |
| 82 | + min_capacity = 1 |
| 83 | + memory_tracking_target_value = 80 |
| 84 | + cpu_tracking_target_value = 80 |
| 85 | + }) |
| 86 | + iam = optional(object({ |
| 87 | + role = optional(object({ |
| 88 | + name = optional(string, "fleet-role") |
| 89 | + policy_name = optional(string, "fleet-iam-policy") |
| 90 | + }), { |
| 91 | + name = "fleet-role" |
| 92 | + policy_name = "fleet-iam-policy" |
| 93 | + }) |
| 94 | + execution = optional(object({ |
| 95 | + name = optional(string, "fleet-execution-role") |
| 96 | + policy_name = optional(string, "fleet-execution-role") |
| 97 | + }), { |
| 98 | + name = "fleet-execution-role" |
| 99 | + policy_name = "fleet-iam-policy-execution" |
| 100 | + }) |
| 101 | + }), { |
| 102 | + name = "fleetdm-execution-role" |
| 103 | + }) |
| 104 | + software_installers = optional(object({ |
| 105 | + create_bucket = optional(bool, true) |
| 106 | + bucket_name = optional(string, null) |
| 107 | + bucket_prefix = optional(string, "fleet-software-installers-") |
| 108 | + s3_object_prefix = optional(string, "") |
| 109 | + }), { |
| 110 | + create_bucket = true |
| 111 | + bucket_name = null |
| 112 | + bucket_prefix = "fleet-software-installers-" |
| 113 | + s3_object_prefix = "" |
| 114 | + }) |
| 115 | + }) |
| 116 | + default = { |
| 117 | + task_mem = null |
| 118 | + task_cpu = null |
| 119 | + mem = 512 |
| 120 | + cpu = 256 |
| 121 | + pid_mode = null |
| 122 | + image = "fleetdm/fleet:v4.64.2" |
| 123 | + family = "fleet" |
| 124 | + sidecars = [] |
| 125 | + depends_on = [] |
| 126 | + mount_points = [] |
| 127 | + volumes = [] |
| 128 | + extra_environment_variables = {} |
| 129 | + extra_iam_policies = [] |
| 130 | + extra_execution_iam_policies = [] |
| 131 | + extra_secrets = {} |
| 132 | + security_group_name = "fleet" |
| 133 | + iam_role_arn = null |
| 134 | + repository_credentials = "" |
| 135 | + private_key_secret_name = "fleet-server-private-key" |
| 136 | + service = { |
| 137 | + name = "fleet" |
| 138 | + } |
| 139 | + database = { |
| 140 | + password_secret_arn = null |
| 141 | + user = null |
| 142 | + database = null |
| 143 | + address = null |
| 144 | + rr_address = null |
| 145 | + } |
| 146 | + redis = { |
| 147 | + address = null |
| 148 | + use_tls = true |
| 149 | + } |
| 150 | + awslogs = { |
| 151 | + name = null |
| 152 | + region = null |
| 153 | + create = true |
| 154 | + prefix = "fleet" |
| 155 | + retention = 5 |
| 156 | + } |
| 157 | + loadbalancer = { |
| 158 | + arn = null |
| 159 | + } |
| 160 | + extra_load_balacners = [] |
| 161 | + networking = { |
| 162 | + subnets = null |
| 163 | + security_groups = null |
| 164 | + ingress_sources = { |
| 165 | + cidr_blocks = [] |
| 166 | + ipv6_cidr_blocks = [] |
| 167 | + security_groups = [] |
| 168 | + prefix_list_ids = [] |
| 169 | + } |
| 170 | + } |
| 171 | + autoscaling = { |
| 172 | + max_capacity = 5 |
| 173 | + min_capacity = 1 |
| 174 | + memory_tracking_target_value = 80 |
| 175 | + cpu_tracking_target_value = 80 |
| 176 | + } |
| 177 | + iam = { |
| 178 | + role = { |
| 179 | + name = "fleet-role" |
| 180 | + policy_name = "fleet-iam-policy" |
| 181 | + } |
| 182 | + execution = { |
| 183 | + name = "fleet-execution-role" |
| 184 | + policy_name = "fleet-iam-policy-execution" |
| 185 | + } |
| 186 | + } |
| 187 | + software_installers = { |
| 188 | + create_bucket = true |
| 189 | + bucket_name = null |
| 190 | + bucket_prefix = "fleet-software-installers-" |
| 191 | + s3_object_prefix = "" |
| 192 | + } |
| 193 | + } |
| 194 | + description = "The configuration object for Fleet itself. Fields that default to null will have their respective resources created if not specified." |
| 195 | + nullable = false |
| 196 | +} |
| 197 | + |
| 198 | +variable "migration_config" { |
| 199 | + type = object({ |
| 200 | + mem = number |
| 201 | + cpu = number |
| 202 | + }) |
| 203 | + default = { |
| 204 | + mem = 2048 |
| 205 | + cpu = 1024 |
| 206 | + } |
| 207 | + description = "The configuration object for Fleet's migration task." |
| 208 | + nullable = false |
| 209 | +} |
0 commit comments