great-sunset-355
11/08/2023, 11:10 AMerror TS2339: Property 'send' does not exist on type 'ECSClient'
when I run pulumi preview
but everything is fine in IDE
import {ECSClient,ListServicesCommand} from "@aws-sdk/client-ecs";
import * as aws from "@pulumi/aws";
import * as pulumi from "@pulumi/pulumi";
const clusterName = "myCluster"
const myService = "myService"
const ecsClientPromise = aws.getRegion(undefined, { parent: this }).then((r) => new ECSClient({ region: r.name }))
const serviceArn = ecsClientPromise.then(async (ecsClient) => {
const listServicesOutput = await ecsClient.send(new ListServicesCommand({
cluster: clusterName,
}))
const serviceArn = listServicesOutput.serviceArns?.find((f: string)=>f.match(new RegExp(myService, 'g')))
return serviceArn
});
pulumi.all([serviceArn]).apply(console.log)
purple-printer-9748
11/08/2023, 11:20 AMgreat-sunset-355
11/08/2023, 11:27 AMgreat-sunset-355
11/08/2023, 11:54 AMpurple-printer-9748
11/08/2023, 12:04 PMgreat-sunset-355
11/08/2023, 12:13 PMgreat-sunset-355
11/08/2023, 12:14 PMpnpm
I had to hoist @aws-sdk
and @smithy