hashicorp / terraform-aws-consul-ecs

Consul Service Mesh on AWS ECS (Elastic Container Service)
https://www.consul.io/docs/ecs
Mozilla Public License 2.0
52 stars 30 forks source link

Add health-sync to gateway-tasks when ACLs are enabled #120

Closed cthain closed 2 years ago

cthain commented 2 years ago

Changes proposed in this PR:

When ACLs are enabled gateway tasks do a consul login to get a token using the IAM Auth Method. The ACL controller will delete the tokens during its reconciliation cycle but we want task to do a consul logout when it stops to destroy the tokens. This PR adds a health-sync container to the gateway-task so that the task automatically attempts a consul logout when the task stops.

How I've tested this PR:

2022-06-15T18:50:34.380Z [INFO]  signal received, ignoring: signal=terminated
2022-06-15T18:50:34.380Z [INFO]  log out token: file=/consul/service-token
2022-06-15T18:50:34.387Z [INFO]  log out token: file=/consul/client-token

How I expect reviewers to test this PR:

:eyes: (Suggest ignoring whitespace to skip the indenting changes)

Checklist: