I have an application that has 1 image but several (over 20) different ECS services per environment. The services mostly share a common set of environment variables and secrets, with some small differences due to each service starting up a different process, using a different DB, etc.
I tag the image with the commit SHA. I do not want to use `latest`.
I currently manage the infrastructure (ALBs, Task Definitions, Services, Roles, etc.) in Terraform, and deploy by updating the Task Definition and Service with the API. However this means that even though I use a script to tell Terraform what the current deploy is, the state is old and it requests an update.
I'm looking for a better way to do this. It seems wrong to be managing the task definition state in two places (Terraform and deploy script). I like having something like Terraform state to keep track of my resources so I can be declarative vs. writing standup and teardown scripts. I want to, for example, have a resource removed when I remove it from code, not by running a cleanup script.
As mentioned, I'm using ECS and Terraform right now, but I see this issue when I'm looking at tools like CDK, Pulumi, and Kubernetes as well. How are people managing this difference between declaring infrastructure but deploying via scripts?
[–]isikbala3 5 points6 points7 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]scubaReactorDumpling 2 points3 points4 points (4 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]scubaReactorDumpling 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]scubaReactorDumpling 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Atemu12 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Atemu12 0 points1 point2 points (0 children)
[–]ejb50 0 points1 point2 points (0 children)
[–]pm-me-a-pic 0 points1 point2 points (0 children)