Invalid 'containerPort' setting for container 'prerenderContainer'. (Service: AmazonECS; Status Code: 400; Error Code: ClientException; Request ID: ac922961-8445-4810-a839-03bb031938a2)
Error above ^ code snippet below....
const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef',{
networkMode: "bridge",
prerenderContainer.addPortMappings('ports',{
containerPort: 3000,
hostPort: 80,
});
const listener = applb.addListener('appFleet', {
targetGroupName: 'prerenderFleet-TGroup',
port: 80
});
const prerenderFleetTGroup = listener.addTargets('ECS', {
port: 80,
targets:[service.loadBalancerTarget({
containerName: 'prerenderContainer',
containerPort: 3000,
})],
I've tried bridge and awsvpc for the network mode with no luck. I thought this might be because of the specific port range I have chosen so I also tried "40391" but no luck.
Is it a timeout issue?
Any help is appreciated.