generated from terraform-module/terraform-module-blueprint
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
31 lines (23 loc) · 746 Bytes
/
main.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
resource "aws_ecs_cluster" "this" {
count = var.create_ecs ? 1 : 0
name = var.name
setting {
name = "containerInsights"
value = var.container_insights ? "enabled" : "disabled"
}
tags = var.tags
}
resource "aws_ecs_cluster_capacity_providers" "this" {
count = var.create_ecs ? 1 : 0
cluster_name = aws_ecs_cluster.this[0].name
capacity_providers = var.capacity_providers
dynamic "default_capacity_provider_strategy" {
for_each = var.default_capacity_provider_strategy
iterator = strategy
content {
capacity_provider = strategy.value["capacity_provider"]
weight = lookup(strategy.value, "weight", null)
base = lookup(strategy.value, "base", null)
}
}
}