fargateService.ts:210:9
# general
m
fargateService.ts2109
w
That sounds like a bug. Could you open an issue at pulumi-awsx GitHub repo and we’ll take a look?
Oh - I think I see the issue - though we should give a better error (or just directly support this). You are passing the result of
aws.ecs.getCluster
which returns a value that is not actually a Cluster. I assume you are not using TypeScript? Pretty sure this would have been an early error in TypeScript. @lemon-spoon-91807 what’s the easiest way to use an existing ECS cluster here?
l
one sec
you can say:
new awsx.ecs.Cluster("somename", { cluster })
. This will allow you to built an awsx Cluster from an aws Cluster.
m
Thanks
You are right though I was not using typescript
Copy code
Type 'Promise<GetClusterResult>' is missing the following properties from type 'Cluster': arn, name, tags, id, and 2 more.ts(2740)
cluster.d.ts(52, 5): The expected type comes from property 'cluster' which is declared here on type 'ClusterArgs'
when I try that
l
Sorry, not at computer. You'll need to look into aws.ecs.Cluster.get as weol
As well
That will let you create the low level cluster from the result you got back.
I can also add a helper here for a future release to help out here
So you could just do awsx.ecs.Cluster.fromExistingIds
m
nice, the get worked but clusters dont have ids so you use the name twice
Copy code
var tCluster = aws.ecs.Cluster.get(name ,name);
Copy code
var cluster = new awsx.ecs.Cluster(name, { cluster: tCluster });
I will look forward to future release as that failed
l
in terms of your current code, can you try:
Copy code
const result = await aws.ecs.getCluster({ clusterName: clusterName });
    const underlyingCluster = aws.ecs.Cluster.get("whatever", result.id);
    const cluster = new awsx.ecs.Cluster("blahblah", {
        cluster: underlyingCluster,
        securityGroups: [/*fill this in*/],
    });
m
thanks guys, i really look forward to expanding with pulumi
l
Sure!
And please keep the feedback coming 🙂