Skip to content

Commit 269d6e6

Browse files
committed
refactor(modules/capacity-provider): change default value of managed_termination_protection to "DISABLED" and add nullable flags to variables
Update documentation focusing on new changes.
1 parent 4b172a2 commit 269d6e6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

modules/capacity-provider/.header.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This sub-module creates:
99

1010
### ECS Capacity Provider
1111

12-
- The `managed_termination_protection` is enabled by default as recommended (which enables termination protection to container instances), and can be disabled if required.
12+
- The `managed_termination_protection` is disabled by default as recommended (which enables termination protection to container instances), and can be enabled if required. (Note: Enabling this option requires the `protect_from_scale_in` to be enabled on the Autoscaling group.)
1313

1414
### ECS Cluster Capacity Providers
1515

modules/capacity-provider/variables.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ variable "capacity_providers" {
1616
maximum_scaling_step_size = optional(number)
1717
})
1818
)
19-
managed_termination_protection = optional(string, "ENABLED")
19+
managed_termination_protection = optional(string, "DISABLED")
2020
tags = optional(map(string), {})
2121
}))
22-
default = {}
22+
nullable = false
23+
default = {}
2324
}
2425

2526
################################################################################
@@ -29,6 +30,7 @@ variable "capacity_providers" {
2930
variable "ecs_cluster_name" {
3031
description = "(Required) Name of the cluster."
3132
type = string
33+
nullable = false
3234
}
3335

3436
variable "default_capacity_provider_strategies" {
@@ -38,7 +40,8 @@ variable "default_capacity_provider_strategies" {
3840
weight = optional(number, 1)
3941
base = optional(number, 0)
4042
}))
41-
default = []
43+
nullable = false
44+
default = []
4245

4346
validation {
4447
condition = alltrue([for e in var.default_capacity_provider_strategies : e.weight >= 0])
@@ -54,6 +57,7 @@ variable "default_capacity_provider_strategies" {
5457
variable "default_auto_scaling_group_arn" {
5558
description = "ARN for this Auto Scaling Group."
5659
type = string
60+
nullable = false
5761

5862
validation {
5963
condition = startswith(var.default_auto_scaling_group_arn, "arn:")

0 commit comments

Comments
 (0)