I had made a lengthy post a while back about wanting to statically assign ports on my ELB but took it down thinking I could accomplish this by editing the Docker for AWS CloudFormation template. I have not had any luck doing that so far. The short of it is - I have my containers listening on non-standard ports (eg nginx listening on port 1989 instead of 80) and my goal was to have a static mapping at the ELB so that when users connect to the ELB on port 443 (ssl) that connection will be translated to the docker swarm cluster on port 1989. I can manually configure the ELB and this configuration works great UNTIL I discard the containers and spin up new ones (using the same published port of 1989). The moment I remove the containers, all port mappings on the ELB (including my static 443 to 1989 mapping) are removed and once the containers is started, only the dynamic port mapping for the published port is there (load balancer port = 1989 and Instance Port = 1989).
I basically need a way to configure the ELB with port mappings of my choice and have them stay there regardless of how many times I shutdown, remove and spin up new containers.
Is this possible via editing the cloudformation template?