This message was deleted.
# general
s
This message was deleted.
s
I am using the
aws.ecs
resources rather than
awsx
because this was suggested as a workaround. But I am not sure where this error comes from or even what it means.
I have two separate TGs that I am adding to the service in the
loadBalancers
block on creation
it works if I specify ONE target group. But two, I get the error.
w
Can you share your code?
s
here’s the service creation bit. (It’s a salt-stack master node)
Copy code
const service = new aws.ecs.Service(`${fqServiceName}-service`, {
            cluster: ecsClusters[region].arn,
            taskDefinition: saltTask.arn,
            platformVersion: "1.4.0",
            launchType: "FARGATE",
            desiredCount: 1,
            loadBalancers: [{
                targetGroupArn: tg4505.targetGroup.arn,
                containerName: config.saltMasterConfig.serviceName,
                containerPort: 4505
            }, {
                targetGroupArn: tg4506.targetGroup.arn,
                containerName: config.saltMasterConfig.serviceName,
                containerPort: 4506
            }],
            networkConfiguration: {
                subnets: subnetsPromise.then((subnets: any[]) => subnets.map((s: any) => s.id)),
                securityGroups: [saltSg.id],
                assignPublicIp: false,
            },
            serviceRegistries: {
                registryArn: sdService.arn,
                containerName: config.saltMasterConfig.serviceName,
            },
        }, {provider: provider}
    )
I did create the listeners/tgs/NLB using the
awsx
provider
Copy code
const listener4505 = nlb.createListener(`${fqServiceName}-l4505`, {
            port: 4505,
            protocol: "TCP",
        }, {provider: provider}
    )
    const listener4506 = nlb.createListener(`${fqServiceName}-l4506`, {
            port: 4506,
            protocol: "TCP",
        }, {provider: provider}
    )
    const tg4505 = nlb.targetGroups.find(tg => tg.targetGroup.port.apply(p => p === 4505))!
    const tg4506 = nlb.targetGroups.find(tg => tg.targetGroup.port.apply(p => p === 4506))!
there’s a lot of code here so let me know what would be helpful for you to see…
w
I wonder if the calls to targetGroups.find() for tg4505 and tg4506 are not returning different items. An easy way to check would be to just put
export
in front of those lines and see what gets dumped out and confirm that they are different.
s
I will try
184 Views