Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/capacity provider strategy #85

Merged
merged 24 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3b56fb8
Add ouputs for task execution role
feraudet May 25, 2021
e1f6181
Typo
feraudet May 25, 2021
2d71ef3
Merge branch 'master' of github.com:telia-oss/terraform-aws-ecs-fargate
feraudet May 25, 2021
e8cc87c
Add task_definition ignore_changes
feraudet May 25, 2021
a5b5c7c
Revert "Add task_definition ignore_changes"
feraudet Jun 1, 2021
74ec418
Add EFS volumes
feraudet Jun 1, 2021
e671613
Remove efs creation_token according to #53 discussion
feraudet Jun 1, 2021
463f11d
Fix missing mountpoints
feraudet Jun 2, 2021
fb7a443
Add efs_volumes var specifications
feraudet Jun 3, 2021
a9888b1
Add wait_for_steady_state & privileged vars. Port is now optional
feraudet Aug 24, 2021
08db846
Fix style https://github.com/telia-oss/terraform-aws-ecs-fargate/pull…
feraudet Aug 24, 2021
8aef21b
Merge remote-tracking branch 'upstream/master'
feraudet Sep 22, 2021
af6c313
Re-add privileged option support
feraudet Sep 22, 2021
32da0b2
Merge remote-tracking branch 'upstream/master'
feraudet Sep 27, 2021
0b1d20c
Merge pull request #1 from telia-oss/master
feraudet Oct 28, 2021
ecb6d16
Prevent port mapping with 0 as port when no port mapping is needed
feraudet Oct 28, 2021
4e79d4e
Merge remote-tracking branch 'upstream/master'
feraudet Jan 28, 2022
549872e
Merge remote-tracking branch 'upstream/master'
feraudet Sep 26, 2022
b541ea4
Merge remote-tracking branch 'upstream/master'
feraudet Feb 7, 2023
7222db8
Merge remote-tracking branch 'upstream/master'
feraudet Jul 17, 2023
7c10b8b
Add capacity_provider_strategy feature
feraudet Jul 17, 2023
5a35a50
Add capacity_provider_strategy variable
feraudet Jul 17, 2023
a635167
Fix launch type when capacity_provider_strategy set
feraudet Jul 18, 2023
edd4e74
Merge branch 'master' into feature/capacity_provider_strategy
larstobi Sep 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ resource "aws_ecs_service" "service" {
cluster = var.cluster_id
task_definition = var.task_definition != "" ? var.task_definition : aws_ecs_task_definition.task.arn
desired_count = var.desired_count
launch_type = "FARGATE"
launch_type = length(var.capacity_provider_strategy) == 0 ? "FARGATE" : null
deployment_minimum_healthy_percent = var.deployment_minimum_healthy_percent
deployment_maximum_percent = var.deployment_maximum_percent
health_check_grace_period_seconds = var.lb_arn == "" ? null : var.health_check_grace_period_seconds
Expand Down Expand Up @@ -262,6 +262,14 @@ resource "aws_ecs_service" "service" {
container_name = var.container_name != "" ? var.container_name : var.name_prefix
}
}
dynamic "capacity_provider_strategy" {
for_each = var.capacity_provider_strategy
content {
base = lookup(capacity_provider_strategy.value, "base", null)
capacity_provider = lookup(capacity_provider_strategy.value, "capacity_provider", null)
weight = lookup(capacity_provider_strategy.value, "weight", null)
}
}
}

# HACK: The workaround used in ecs/service does not work for some reason in this module, this fixes the following error:
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ variable "volumes" {
default = []
}

variable "capacity_provider_strategy" {
description = "List capacity provider strategy"
type = list(any)
default = []
}

variable "extra_target_groups" {
description = "List of extra target group configurations used to register a service to multiple target groups"
type = list(object({
Expand Down
Loading