Summary:
I have an EC2 in public subnet of a VPC that has a internet gateway in its route table. Its connecting well bothways based on routing table. However, I am now trying to reach out to ECR and that leads to "Could not connect to the endpoint URL" message.
What I have tried:
I tried connecting to ECR using access key id and secret access key of permitted user. That doesn't work and leads to "could not connect message"
I then tried creating an end point for both ecr.api and ecr.dkr with default security group and connecting it to subnet where EC2 is located. I realized that this end point is not usual gateway type of endpoint (S3 etc) but an interface. In any case, that also doesn't work and leads to similar message
Code: $(aws ecr get-login --no-include-email --region ap-south-1)
Error:
Could not connect to the endpoint URL: "https://api.ecr.ap-south-1.amazonaws.com/"
Can someone point me in the right direction?