I am using the AWS CDK to create an ApplicationLoadBalancer
which has port 80 accepting external connections.
I want to use port 8080 of target to health check port.
const lb = new elb.ApplicationLoadBalancer(this, "LB", {
vpc: cluster.vpc,
loadBalancerName : loadBalancerName,
internetFacing: true,
vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },
});
const listener = lb.addListener("Listener", { port: 80 });
const targetGroup = listener.addTargets("ECS", {
protocol: elb.ApplicationProtocol.HTTP,
port: 80,
targets: [ecsAdminService]
});
targetGroup.configureHealthCheck({
path: "/",
port: "8080"
})
In this case ApplicationLoadBalancer
makes the security group automatically.
However, it has an outbound rule only port 80
. I want to add anoutbound rule port 8080
How can I change the security group so it is automatically generated?