Skip to content

Commit 4389c9d

Browse files
committed
ecs-cluster: expose capacity providers setting; bump min terraform and aws versions
1 parent 02e525c commit 4389c9d

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

modules/ecs-cluster/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ resource "aws_ecs_cluster" "fargate_cluster" {
1717
resource "aws_ecs_cluster_capacity_providers" "default" {
1818
cluster_name = join("", aws_ecs_cluster.fargate_cluster.*.name)
1919

20-
capacity_providers = ["FARGATE_SPOT", "FARGATE"]
20+
capacity_providers = var.capacity_providers
2121

2222
default_capacity_provider_strategy {
2323
capacity_provider = var.default_capacity_provider
2424
weight = 100
25+
base = 1
2526
}
2627
}
2728

@@ -30,5 +31,5 @@ resource "aws_service_discovery_private_dns_namespace" "default" {
3031
name = join(".", [module.this.namespace, "local"])
3132
description = module.this.id
3233
vpc = var.vpc_id
33-
tags = module.this.tags
34+
tags = module.this.tags
3435
}

modules/ecs-cluster/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ variable "default_capacity_provider" {
1010
default = "FARGATE"
1111
}
1212

13+
variable "capacity_providers" {
14+
type = list(string)
15+
description = "List of capacity providers for the ECS cluster. Valid values are FARGATE, FARGATE_SPOT. The default is FARGATE."
16+
default = ["FARGATE"]
17+
}
18+
1319
variable "container_insights_enabled" {
1420
type = bool
1521
description = "Whether to enable Container Insights on the cluster"

modules/ecs-cluster/versions.tf

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

44
required_providers {
5-
aws = ">= 3.0.0"
5+
aws = ">= 5.93.0"
66
}
77
}

0 commit comments

Comments
 (0)