1
votes

I have deployed the docker image of my spring boot application over aws ECR, following creation of AWS fargate cluster. PFA screenshots of the configurations stating task, security, service and cluster definition.I can ping my public ip successfully. But I can't access my application over neither load balancer nor public ip. The urls I tried to access application were

public_ip:8081/my_rest_end_point

and

load_balancer_public_dns:8081/my_reset_end_point

I have tested running my docker image on local host using port 8081 and the same 8081 port I have configured for port mapping in my Fargate container configuration (reference: service definition). How can I access my application? I have followed almost all the articles over Medium and AWS.

Task Definition security definition service definition cluster definition Target group load balancer definition1 load balancer definition2 inbound rules Updated security rules service subnet load balancer subnets registered target groups

Tutorials followed: https://medium.com/underscoretec/deploy-your-own-custom-docker-image-on-amazon-ecs-b1584e62484

https://medium.com/faun/aws-fargate-services-deployment-with-continuous-delivery-pipeline-b67d33407c88

1
Can you provide settings of your ALB, end its target groups?Marcin
@Marcin ALB settings and target group updated!Caffeine Coder
If you use dynamic port mapping, then your fargate task SG must allow all ports from your LB, or just all ports. Not only 8081.Marcin
@Marcin in security settings I have also configured all traffic with all ports, have attached screenshot just now!Caffeine Coder
The screenshot shows that IPv4 is still 8081. All ports are for IPv6.Marcin

1 Answers

1
votes

Based on the comments and chat discussion.

The tutorial followed creates a custom VPC with CIDR range of 10.0.0.0/16 with two subnets. There is no internet gateway (IGW); and subsequently, the Fargate tasks launched in the VPC have no internet access nor they can't be accessed from the internet.

There are two solutions to this problem:

  • use the default VPC which correctly provides internet access
  • create a custom VPC (or modify existing) that is setup with IGW and the corresponding route tables. An example of a custom VPC with internet access is in AWS docs.