Skip to content

AWS cloudmap is not adding port when adding target using ECS service

0

when i update the ECS service with service discovery (Cloudmap, etc) , it does not add PORT to the target, while manually I can add one.

2 Answers
0

To properly diagnose:

  • Check ECS task definition port mappings
  • Verify service discovery configuration
  • Confirm the service registry settings in the ECS service definition

try: Task Definition Level:

{
  "containerDefinitions": [
    {
      "portMappings": [
        {
          "containerPort": 80,
          "protocol": "tcp"
        }
      ]
    }
  ]
}

answered 2 years ago

  • yes task definition has port , we have custom port 3000,

0

Hello,

If you want to include the port in the Service Discovery DNS record, please check if you are using SRV records instead of A records.

Also, check the AWS CloudMap console to ensure that the Service Discovery service is correctly configured with the SRV record type.

If you've checked all these points and are still experiencing issues, you may want to consider recreating the service with the correct configuration, as some Service Discovery settings cannot be modified after creation.

Remember, if you're using SRV records, clients will need to be able to resolve SRV records to discover both the IP and port of your service.

More information: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html

AWS
EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.