gorgeous-monitor-13375
03/23/2021, 5:41 PMportMappings
attribute of my ECS service, but I can't see a way to override any of those defaults without fully creating a target group myself. If I have to do that I will lose all the benefit of crosswalk in the first place.
TL;DR: what's the correct way to change the heath check path of the auto-generated target group when passing an application load balancer listener into an ECS service?
Thanks in advance! 🙂billowy-army-68599
03/23/2021, 6:09 PMgorgeous-monitor-13375
03/23/2021, 7:44 PMconst loadBalancerListener = new awsx.lb.ApplicationListener(`lb`,
{
port: 8080,
protocol: "HTTPS",
vpc: vpcConfig.vpc,
certificateArn: config.require("sslCertificateArn"),
});
const cluster = new awsx.ecs.Cluster("cluster", {
vpc: vpcConfig.vpc,
name: `cluster`,
securityGroups: [ securityGroup ]
});
const service = new awsx.ecs.FargateService("hasura-service", {
cluster,
name: `service`,
taskDefinitionArgs: {
containers: {
hasura: {
image: "hasura/graphql-engine:v2.0.0-alpha.5",
memory: 128,
portMappings: [loadBalancerListener],
},
},
},
desiredCount: 1,
});
I thought maybe I could pass in some different defaults into the targetGroup
attribute of the listener:
const loadBalancerListener = new awsx.lb.ApplicationListener(`lb`,
{
port: 8080,
protocol: "HTTPS",
vpc: vpcConfig.vpc,
certificateArn: config.require("sslCertificateArn"),
targetGroup: {
healthCheck: ...
}
);
But I get an error for missing required attributes, even though they are all optional on the interface itself. It makes it seem like I have to fully define the target group manually, in which case I might as well not use crosswalk, so I feel like I'm missing something.