hardfinhq / terraform-aws-tailscale-subnet-router

Terraform module for Tailscale subnet router in AWS ECS Fargate
https://registry.terraform.io/modules/hardfinhq/tailscale-subnet-router/aws
Apache License 2.0
30 stars 9 forks source link

Feature: Improve ECS service deployment #12

Open jaymefSO opened 1 year ago

jaymefSO commented 1 year ago

Hey, I came across your project. Thanks for the work! I noticed your documentation states the following: "When deploying a new version, ECS will do a rolling update so two ECS tasks will be simultaneously claiming to be the same host. This conflict will eventually resolve itself some time after the older task exits, but may be confusing during the rollout."

I believe you can resolve this using the following ECS service config -- this should make it so that only one copy of the service runs at any given time during deployments.

deployment_maximum_percent         = 100
deployment_minimum_healthy_percent = 0
desired_count                      = 1
dhermes commented 1 year ago

SGTM @jaymefSO, want to send a PR: https://github.com/hardfinhq/terraform-aws-tailscale-subnet-router/blob/main/modules/subnet_router/ecs.tf#L70?

dhermes commented 1 year ago

I can't quite recall what I observed when originally implementing this, but I think there may have still been issues with multiple hosts being connected to Tailscale at the same time (with the same hostname).

But I'm happy to take this for a spin and see how it works for the module.