``` const tvxClusterS = aws.ecs.Cluster.get(`${ide...
# general
a
Copy code
const tvxClusterS = aws.ecs.Cluster.get(`${identifier}-clustera`, stackCluster.getOutput(config.require("clusterName")))
const tvxVpcIdS = awsx.ec2.Vpc.fromExistingIds(`${identifier}-networka`, {
    vpcId: stackCluster.getOutput(config.require("vpcId"))
})

// const tvxVpcIdS = aws.ec2.Vpc.get(`${identifier}-networka`, stackCluster.getOutput(config.require("vpcId")))

const tvxCluster = new awsx.ecs.Cluster(`${identifier}-clusterb`, {
    cluster: tvxClusterS,
    vpc: tvxVpcIdS
})

const ecsService = new awsx.ecs.EC2Service(`${identifier}-svc`, {
    cluster: tvxCluster,
    taskDefinitionArgs: {
        containers: {
            app: {
                image: awsx.ecs.Image.fromPath(`${identifier}-img`, "./app"),
                portMappings: [{
                    containerPort: 3000,
                    hostPort: 80,
                    protocol: "tcp"
                }]
            }  
        },
    },
    desiredCount: 2
})
const app = new Service(`${identifier}-svc-instance`, ecsService)
g
You're referring to the upstream cluster via the StackReference, but then also creating a new cluster with this bit of code:
Copy code
const tvxCluster = new awsx.ecs.Cluster(`${identifier}-clusterb`, {
    cluster: tvxClusterS,
    vpc: tvxVpcIdS
})
a
Thanks for the feedback, but isn't that necessary in order to for
new awsx.ecs.EC2Service
to create a service in that cluster?
Is there another way of consuming the cluster? I was inspired by this: https://www.pulumi.com/docs/guides/crosswalk/aws/ecs/#using-an-existing-ecs-cluster