incalculable-dream-27508
02/09/2020, 4:16 PMawsx.lb.ApplicationLoadBalancer
any health checksrhythmic-camera-25993
02/09/2020, 7:05 PMApplicationLoadBalancer
instance.portMappings
for the service it matched toincalculable-dream-27508
02/09/2020, 7:32 PM/
and expect 200
return coderhythmic-camera-25993
02/09/2020, 7:38 PMincalculable-dream-27508
02/09/2020, 7:43 PMrhythmic-camera-25993
02/09/2020, 8:02 PMconst tg = alb.createTargetGroup("my-tg", {
port: 80,
protocol: "HTTP",
healthCheck: {
path: "/",
port: "80",
protocol: "HTTP",
matcher: "200",
}
});
tg.attachTarget("server-attach", server);
?incalculable-dream-27508
02/09/2020, 8:03 PMrhythmic-camera-25993
02/09/2020, 8:04 PMincalculable-dream-27508
02/09/2020, 8:07 PM"server-attach"
in the attachTarget
?rhythmic-camera-25993
02/09/2020, 8:08 PMtargetgroupattachment
that is created as part of the attachTarget
callpublic attachTarget(name: string, args: mod.LoadBalancerTarget, opts: pulumi.CustomResourceOptions = {}) {
return new mod.TargetGroupAttachment(name, this, args, opts);
}
incalculable-dream-27508
02/09/2020, 8:09 PMlistener.defaultTargetGroup
but I wasn't able to figure out yet how to use itrhythmic-camera-25993
02/09/2020, 8:37 PMlistener.addListenerRule
, and in tha rule set an action
of type
"forward", and targetGroupArn
of your new target group// listen for https traffic. by default returns 404, will have rules added to forward to the requisite groups
const listener = alb.createListener("http-traffic", {
port: 80,
protocol: "HTTP",
external: true,
defaultAction: {
type: "fixed-response",
fixedResponse: {
contentType: "text/plain",
statusCode: "404"
}
},
});
/// this listener forwards all traffic to the identity server
listener.addListenerRule("plain-traffic-to-server", {
priority: 49999, // priority goes from 1 to 50000 with lower numbers going first, so this makes the rule always eval last
conditions: [{ httpRequestMethod: { values: ["GET", "PUT", "POST", "HEAD", "OPTIONS"] } } as aws.types.output.lb.ListenerRuleCondition], // all HTTP methods
actions: [
{
type: "forward",
targetGroupArn: tg.targetGroup.arn // targetgroups in pulumi have a 'targetGroup' property with the arn on it
}
]
});
incalculable-dream-27508
02/09/2020, 8:43 PMconst listener = alb.createListener("web-listener", { port: 80 });
rhythmic-camera-25993
02/09/2020, 8:44 PMincalculable-dream-27508
02/09/2020, 9:04 PMrhythmic-camera-25993
02/09/2020, 9:12 PM