aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

Error when adding ApplicationLoadBalancer in front of QueueProcessingFargateService

Open stephankaag opened this issue 7 years ago • 3 comments

  • I'm submitting a ...

    • [x] :beetle: bug report
  • What is the current behavior?

Code:

const service = new ECSPatterns.QueueProcessingFargateService(this, 'QueueService', {
  cluster,
  memoryLimitMiB: 512,
  image: ECS.EcrImage.fromEcrRepository(repository),
  memoryLimitMiB: 512,
  cpu: 256,
  desiredTaskCount: 1,
  queue,
});

const lb = new ELBv2.ApplicationLoadBalancer(this, 'LB', { vpc, internetFacing: true });
const listener = lb.addListener('Listener', { port: 80 });
const target = listener.addTargets('ECS', {
  protocol: ELBv2.Protocol.HTTP,
  port: 9222,
  targets: [service]
});

Result:

aws-elasticloadbalancingv2/lib/alb/application-target-group.ts:104
      const result = target.attachToApplicationTargetGroup(this);
                            ^
TypeError: target.attachToApplicationTargetGroup is not a function

stephankaag avatar Jul 19 '19 06:07 stephankaag

What is the resolution here? Got into similar problem. Dunno how to fix that :(

porn avatar Nov 29 '19 13:11 porn

@stephankaag were you able to resolve this? having same issue...

paujur avatar Nov 21 '20 00:11 paujur

I'm having the same issue. Any idea on how to fix it?

andybirenzi avatar Dec 09 '20 20:12 andybirenzi