Is there a built-in way to run a single task on an...
# general
h
Is there a built-in way to run a single task on an existing ECS cluster? I don't think the cloud-sdk
Task
class works for me as AFAICT it wants to create a cluster
w
It is technically possible to use
cloud.Task
, but you need to set some configuration to indicate you want to use an existing Cluster instead of creating a new one.
cloud-aws:ecsClusterARN
is the main setting, but there are a couple others you may need to provide. See https://pulumi.io/quickstart/cloudfx/index.html. Alternatively, you can use
new aws.ecs.TaskDefinition
and then
runTask
from the Node.js
aws-sdk
at runtime to do this directly using AWS APIs.
h
Ok i'll look - thanks!
I looked at the implementation of
cloud.Task
and saw it was using the node SDK - how does it distinguish preview mode from non-preview?
Looks like I extend
ComponentResource
and implment an async
run
method? https://github.com/pulumi/pulumi-cloud/blob/master/aws/service.ts#L883