wide-jackal-86020
03/25/2021, 10:53 PMtargetGroup
does not have an associated load balancer. The target groups are created with alb.createTargetGroup()
Diagnostics:
aws:ecs:Service (backend-nginx): error: 1 error occurred:
* InvalidParameterException: The target group with targetGroupArn arn:aws:elasticloadbalancing:us-west-2:617706700270:targetgroup/backend-nginx-tg-041ec1c/55dd1342456346aa does
not have an associated load balancer. "backend-nginx-5a1a7c5"
pulumi:pulumi:Stack (ingenio-backend-dev):
error: update failed
awsx:x:ecs:FargateTaskDefinition (backend-hello):
warning: WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
<https://docs.docker.com/engine/reference/commandline/login/#credentials-store>
aws:ecs:Service (backend-hello):
error: 1 error occurred: * InvalidParameterException: The target group with targetGroupArn arn:aws:elasticloadbalancing:us-west-2:617706700270:targetgroup/backend-hello-tg-6614d94/57f5672e4de31767 does
not have an associated load balancer. "backend-hello-9844a6d"
import * as awsx from "@pulumi/awsx";
import { project, baseTags } from '../config';
const vpc = awsx.ec2.Vpc.getDefault();
const alb = new awsx.lb.ApplicationLoadBalancer(`${project}-lb`, {
vpc,
tags: baseTags,
external: true,
});
export const http = alb.createListener(`${project}-http`, {
defaultActions: [{
fixedResponse: {
contentType: "text/plain",
messageBody: "404 Site Not Found",
statusCode: "404",
},
type: "fixed-response",
}],
external: true,
port: 80,
protocol: "HTTP",
});
export const nginxTarget = alb.createTargetGroup(`${project}-nginx-tg`, {
port: 80,
protocol: "HTTP",
tags: baseTags,
});
export const helloTarget = alb.createTargetGroup(`${project}-hello-tg`, {
port: 80,
protocol: "HTTP",
tags: baseTags,
});
const nginxRule = http.addListenerRule(`${project}-nginx-lr`, {
actions: [{
targetGroupArn: nginxTarget.targetGroup.arn.apply(v => v),
type: "forward",
}],
conditions: [{
pathPattern: {
values: ["/nginx"],
}},{
hostHeader: {
values: [`*`],
},
}],
priority: 1,
});
const helloRule = http.addListenerRule(`${project}-hello-lr`, {
actions: [{
targetGroupArn: helloTarget.targetGroup.arn.apply(v => v),
type: "forward",
}],
conditions: [{
pathPattern: {
values: ["/hello"],
}},{
hostHeader: {
values: [`*`],
},
}],
priority: 1,
});
const cluster = new awsx.ecs.Cluster("cluster", {
vpc,
tags: baseTags,
});
const nginxService = new awsx.ecs.FargateService("backend-nginx", {
cluster,
taskDefinitionArgs: {
containers: {
nginx: {
image: "nginx",
cpu: 128,
memory: 128,
portMappings: [ nginxTarget ],
},
},
},
desiredCount: 3,
});
const img = awsx.ecs.Image.fromPath("hello-img", "./app");
const helloService = new awsx.ecs.FargateService("backend-hello", {
cluster,
taskDefinitionArgs: {
container: {
image: img,
cpu: 128,
memory: 128,
portMappings: [ helloTarget ],
},
},
desiredCount: 5,
});
little-cartoon-10569
03/25/2021, 10:57 PMwide-jackal-86020
03/25/2021, 11:03 PMdoes not have an associated load balancer
shouldn't happen.little-cartoon-10569
03/25/2021, 11:47 PMwide-jackal-86020
03/26/2021, 12:05 AMlisteners
in ApplicationTargetGroup
is set to []
and seems not used.little-cartoon-10569
03/26/2021, 12:27 AMwide-jackal-86020
03/26/2021, 1:27 AMListener.attachTarget()
?little-cartoon-10569
03/26/2021, 1:32 AMwide-jackal-86020
03/26/2021, 1:36 AM