Skip to content

Commit 7fb90f3

Browse files
feat: Support managed_draining argument at aws_ecs_capacity_provider (#158)
* feat: Support manged_draining argument for aws_ecs_capacity_provider * bump required AWS provider version to 5.34 * align AWS provider version across the project * feat: Update MSTV to 1.3 to support state migrations, align provider version on minor version --------- Co-authored-by: Bryant Biggs <[email protected]>
1 parent 048acce commit 7fb90f3

File tree

16 files changed

+39
-34
lines changed

16 files changed

+39
-34
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ module "ecs" {
159159

160160
| Name | Version |
161161
|------|---------|
162-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
163-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66.1 |
162+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
163+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
164164

165165
## Providers
166166

examples/complete/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Note that this example may create resources which will incur monetary charges on
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
30-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66.1 |
29+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
30+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
3131

3232
## Providers
3333

3434
| Name | Version |
3535
|------|---------|
36-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66.1 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
3737

3838
## Modules
3939

examples/complete/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.3"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.66.1"
7+
version = ">= 5.34"
88
}
99
}
1010
}

examples/ec2-autoscaling/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Note that this example may create resources which will incur monetary charges on
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
30-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66.1 |
29+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
30+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
3131

3232
## Providers
3333

3434
| Name | Version |
3535
|------|---------|
36-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66.1 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
3737

3838
## Modules
3939

examples/ec2-autoscaling/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module "ecs_cluster" {
3636
# On-demand instances
3737
ex_1 = {
3838
auto_scaling_group_arn = module.autoscaling["ex_1"].autoscaling_group_arn
39+
managed_draining = "ENABLED"
3940
managed_termination_protection = "ENABLED"
4041

4142
managed_scaling = {
@@ -53,6 +54,7 @@ module "ecs_cluster" {
5354
# Spot instances
5455
ex_2 = {
5556
auto_scaling_group_arn = module.autoscaling["ex_2"].autoscaling_group_arn
57+
managed_draining = "ENABLED"
5658
managed_termination_protection = "ENABLED"
5759

5860
managed_scaling = {

examples/ec2-autoscaling/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.3"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.66.1"
7+
version = ">= 5.34"
88
}
99
}
1010
}

examples/fargate/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Note that this example may create resources which will incur monetary charges on
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
30-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66.1 |
29+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
30+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
3131

3232
## Providers
3333

3434
| Name | Version |
3535
|------|---------|
36-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66.1 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
3737

3838
## Modules
3939

examples/fargate/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.3"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.66.1"
7+
version = ">= 5.34"
88
}
99
}
1010
}

modules/cluster/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module "ecs_cluster" {
7070
autoscaling_capacity_providers = {
7171
one = {
7272
auto_scaling_group_arn = "arn:aws:autoscaling:eu-west-1:012345678901:autoScalingGroup:08419a61:autoScalingGroupName/ecs-ec2-one-20220603194933774300000011"
73+
managed_draining = "DISABLED"
7374
managed_termination_protection = "ENABLED"
7475
7576
managed_scaling = {
@@ -86,6 +87,7 @@ module "ecs_cluster" {
8687
}
8788
two = {
8889
auto_scaling_group_arn = "arn:aws:autoscaling:eu-west-1:012345678901:autoScalingGroup:08419a61:autoScalingGroupName/ecs-ec2-two-20220603194933774300000022"
90+
managed_draining = "ENABLED"
8991
managed_termination_protection = "ENABLED"
9092
9193
managed_scaling = {
@@ -134,14 +136,14 @@ module "ecs_cluster" {
134136

135137
| Name | Version |
136138
|------|---------|
137-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
138-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66.1 |
139+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
140+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
139141

140142
## Providers
141143

142144
| Name | Version |
143145
|------|---------|
144-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66.1 |
146+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
145147

146148
## Modules
147149

modules/cluster/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ resource "aws_ecs_capacity_provider" "this" {
151151

152152
auto_scaling_group_provider {
153153
auto_scaling_group_arn = each.value.auto_scaling_group_arn
154+
managed_draining = try(each.value.managed_draining, "ENABLED")
154155
# When you use managed termination protection, you must also use managed scaling otherwise managed termination protection won't work
155156
managed_termination_protection = length(try([each.value.managed_scaling], [])) == 0 ? "DISABLED" : try(each.value.managed_termination_protection, null)
156157

0 commit comments

Comments
 (0)