Skip to content

Commit

Permalink
Pull upsteam changes (#19)
Browse files Browse the repository at this point in the history
* Bump gopkg.in/yaml.v3 from 3.0.0-20210107192922-496545a6307b to 3.0.0 (telia-oss#88)

Bumps gopkg.in/yaml.v3 from 3.0.0-20210107192922-496545a6307b to 3.0.0.

---
updated-dependencies:
- dependency-name: gopkg.in/yaml.v3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add optional capacity provider strategy (telia-oss#85)

* Add option to set a healthCheck property on the task container definition (telia-oss#91)

* Allow higher versions of null provider (telia-oss#92)

* Allow higher versions of null provider

* Bump Taskfile schema version

* Use Cantara version of container health check

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Feraudet Cyril <[email protected]>
Co-authored-by: Fredrik Oterholt <[email protected]>
Co-authored-by: Pål Sollie <[email protected]>
  • Loading branch information
5 people authored May 8, 2024
1 parent 7ba9064 commit bc88da4
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: '3'

env:
TERM: screen-256color
Expand Down Expand Up @@ -36,7 +36,7 @@ tasks:
CWD=$PWD
for d in $DIRECTORIES; do
for d in $DIRECTORIES; do
cd $d
echo "${BOLD}$PWD:${NORM}"
Expand Down Expand Up @@ -66,4 +66,4 @@ tasks:
silent: true
cmds:
- go test -v ./... -timeout=1h

8 changes: 8 additions & 0 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ module "fargate" {
TEST_VARIABLE = "TEST_VALUE"
}

container_health_check = {
retries = 3,
command = ["CMD-SHELL", "curl -f http://localhost:9000/ || exit 1"],
timeout = 5,
interval = 30,
startPeriod = 15
}

health_check = {
port = "traffic-port"
path = "/"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ require (
github.com/gruntwork-io/terratest v0.36.0
github.com/stretchr/testify v1.7.0
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
10 changes: 9 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,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 @@ -263,6 +263,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
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}
null = {
source = "hashicorp/null"
version = "~> 3.1.0"
version = ">= 3.1.0"
}
}
}

0 comments on commit bc88da4

Please sign in to comment.