Hi Guys, I need to deploy a docker image that expo...
# general
a
Hi Guys, I need to deploy a docker image that exposes multiple ports with aws Fargate, how can I manage it?
p
are you using
awsx.ecs.FargateService
?
@agreeable-refrigerator-25320 or maybe better: What mechanism are you using now? 🙂
a
yes, I am using
awsx.ecs.FargateService but I am not sure how to assign the port mappings
currently this is what i have
p
in that case,
taskDefinitionArgs: { container: { portMappings: [ https ] }, },
is your friend. portMapping is a list.
a
const appService = new awsx.ecs.FargateService("neo4j-svc", { cluster, taskDefinitionArgs: { container: { image: img, cpu: 200 /*CPU units*/, memory: 1024 /*MB*/, portMappings: [elb.createListener("neo4j-db-listener", { port: 7474, external: true, protocol: "HTTP", })], }, }, desiredCount: 1, });
this is my current code
but i am not sure how to skip the create listener part
p
you can move the create listener out, stick it a ~var and consume it. or you can just stack another one in the
[ ]
block along with it.
a
ok, i will give it a try, Thanks a lot
p
at least, that's how I've read it. I haven't done it but it was on my todo list. (actually, that's not true: I DID pass two elb listeners successfully, but I never tested end to end..)
a
did you create the listeners from the same elastic load balancer instance?
p
yeah
(possibly the same target group associated with the alb, but same idea)
a
ok i am triying to deploy it right now
it gives this error message
error: awsecs/serviceService resource 'neo4j-svc' has a problem: load_balancer: attribute supports 1 item maximum, config has 2 declared
w
a
oh ok, thanks a lot
so now, what are my options?