Scenario: I'm creating a SingleRunFargateTask dyna...
# general
Scenario: I'm creating a SingleRunFargateTask dynamic resource provider. I hoped to pass it's constructor a FargateTaskDefinition and then invoke run() on create, like so:
Copy code
const SingleRunFargateTaskProvider = {
  async create(inputs) {
    const id = crypto.randomBytes(16).toString("hex");
    const result = await{
      cluster: inputs.ecsCluster
    return { id };
However I receive this Error:
Copy code
error: update failed

pulumi-nodejs:dynamic:Resource (repro-customfgtask):
    error: is not a function
When I inspect the inputs, inputs.fargateTaskDefn is at that runtime, a string URN. Any guidance on how to make this work would be really appreciated! (My eventual use-case will be a database migration task that I tie to my RDS resource's lifetime). P.S/Sidenote: I am modelling this after the lambda/fargate example that captures a reference to a FargateTaskDefinition and uses the run() call at runtime (and I've tested that scenario/function serialization works fine. See:
Copy code
const helloTask = new awsx.ecs.FargateTaskDefinition("hello-world", {
    container: {
        image: "hello-world",
        memory: 20,

const api = new awsx.apigateway.API("examples-containers", {
    routes: [{
        path: "/run",
        method: "GET",
        eventHandler: async (req) => {
            const result = await{ cluster });
            return { statusCode: 200, body: "OK" };
Is it because the
of a
is a different execution context to the index.ts pulumi program on
pulumi up
? I could always programatically call
using the aws-sdk in the
of the
, but I just wonder if there's another way 🤔