Hi folks, how can I make Pulumi not change my ECS ...
# aws
d
Hi folks, how can I make Pulumi not change my ECS task definition container image on subsequent runs? i.e. if said service already has an existing task definition, just reuse latest container image and update the other properties normally, creating a new revision.
Essentially I want Pulumi to be able to bootstrap an environment with dummy images, but from thereon my CI/CD pipeline manages image versioning. I still want to be able to cut revisions from Pulumi to manage scaling and other taskdef configurations though.
On a naive implementation what happens is, if I make any changes to my task definition, Pulumi cuts a new revision with the hardcoded image in my Pulumi file.
w
https://www.pulumi.com/docs/concepts/options/ignorechanges/ maybe you can ignore the container value on ‘bootstrap’ code + store the container image:tag on SSM parameter store to later fetch it and include it subsequent ‘bootstrap’ runs?
d
ignoreChanges would be close enough for my needs.. but just tested and what happens is, if I change anything in my container definition, Pulumi won't trigger an update as expected, but changing anything on the task definition will trigger a full update and override the container def with what's on the Pulumi program.. I'd expect updates to be ignored altogether.. as in filtered out from updates that do happen.
My plan now is something similar to your SSM suggestion.. I'll write something to find the latest running image and use that on the Pulumi program.. so it just updates for the same thing
w
include the parameter update on CICD pipeline and later fetch that value with pulumi https://www.pulumi.com/registry/packages/aws/api-docs/ssm/getparameter/
d
We chose to go with the approach of fetching the latest image directly from ECS on the Pulumi program instead, as adding this to SSM would introduce additional state that could drift. Appreciate the help 🙂 happy to share my final solution for anyone who's interested.