Skip to content

Can I call a service that is inside Fargate from a lambda function?

0

Hi!

I have a microservice running inside fargate, this is built in my first stack, and then Im passing to my second stack the alb dns name because my lambda function needs to call an endpoint that is inside the microservice that is inside fargate. Is possible from my Lambda function to call this service if the security groups configuration is correct?

Thank you!

asked 2 years ago434 views

1 Answer
1
Accepted Answer

Hello.

It's possible.
If the ALB is created with internet facing, it is publicly accessible, so if the inbound rules of the ALB's security group allow 0.0.0.0/0 for HTTP or HTTPS, you can send requests directly from Lambda. is.
If you are restricting the inbound rules of the ALB security group, you can also connect Lambda to the VPC and access it via NAT Gateway to fix the Lambda IP address.
Also, even if you create an ALB internal, you can send requests by connecting Lambda to the VPC and enabling communication within the VPC.
https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Hello! thanks a lot Riku!

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.