Hi everyone!  I have a question I was hoping someo...
# general
g
Hi everyone!  I have a question I was hoping someone could help me with.  I'm using crosswalk to create an ECS instance with ELB and so far it has made it so much easier.  However, I don't quite understand the documentation when it explains how to add advanced settings - in my case, a different health check endpoint.  Currently my target group seems to be created automatically due to my passing the listener into the 
portMappings
 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! 🙂
b
can you share what you have so far in terms of code?
g
Sure, so far I have this:
Copy code
const 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:
Copy code
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.