Service Connect

0
profile picture
asked 2 years ago406 views
1 Answer
1
Accepted Answer

Hi,

There are different services integrated with service connect, ECS, Route53, CloudMap.

Create a cluster associated to a Service connect namespace:

aws ecs create-cluster  --cluster svc-cluster  --service-connect-defaults '{ "namespace": "svc-namespace" }'

You can list services in CloudMap Service discovery:

aws servicediscovery --region $AWS_REGION get-namespace --id svc-namespace

You can create a service that expose on the service connect namespace

aws ecs create-service \
  --cluster svc-cluster \
  --service-name "nodejs" \
  --desired-count 1 \
  --task-definition "ecsdemo-nodejs" \
  --service-connect-configuration '{
    "enabled": true,
    "namespace": "svc-namespace",
    "services":
    [
        {
          "portName": "nodejs-port",
          "clientAliases": [
            {
                "port": 3000,
                "dnsName": "nodejs"
              }
            ]
        }
      ],
  }' \
  --launch-type FARGATE \
  --deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}" \
  --network-configuration "awsvpcConfiguration={subnets=[subnet-123456,subnet-123456],securityGroups=[sg-123456],assignPublicIp="DISABLED"}" \
  --enable-execute-command

To check the connectivity between services, you can ecs exec in a task and connect to it's service connect discovery name.

In the case of the exposed service previous it is reachable on curl http://nodejs:3000

AWS
answered a year 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.

Guidelines for Answering Questions