https://pulumi.com logo
#general
Title
# general
a

adamant-dress-73325

10/17/2019, 11:53 PM
Is there a way to invoke
task.run({ cluster });
on a FargateTaskDefinition at the top-level of our pulumi program during update? We are trying to run a one-off task inside a container, without needing lambda like in https://www.pulumi.com/docs/guides/crosswalk/aws/ecs/#running-fire-and-forget-tasks .
w

white-balloon-205

10/18/2019, 12:13 AM
There’s not a super easy way today. You can do it with the aws-sdk directly - but that involves a bit of work. Question - when do you want it to run? 1. On every run of the program 2. Only on updates (not previews) 3. Only once when it is first “created” and then only again if something it depends on changes (like a resource being “replaced”) 4. Something else?
a

adamant-dress-73325

10/18/2019, 9:18 PM
@white-balloon-205 We only want to run it during
update
and toggle whether to run it from pulumi.config value or just comment/uncomment the
run()
code. Basically if I have a one-off task container that indexes some documents in Elasticsearch, would be good to have pulumi run it, as it has all the necessary parameters, right now we go to the AWS ECS console to run the one-off tasks which is workaround.