Skip to content

Private WebServer with AWS Cognito

0

Is it possible to use AWS congito for user authentication with an EC2 webserver sitting inside a private subnet that has an internal ALB?

2 Answers
1

Currently Cognito does not support Privatelink so in order for the ALB to be able to reach Cognito you would require to have a route through a NAT gateway.

AWS
EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

0

Hello.

Have you set up a NAT Gateway to communicate from EC2 to your Cognito user pool?
If you have a NAT Gateway, you can access the Cognito user pool, so you can authenticate with your application.
As of October 2024, Cognito user pools do not support VPC endpoints, etc., so if there is no communication path from each application to the Cognito user pool, authentication etc. cannot be performed from EC2 in the private subnet.

There was a similar exchange on AWS re:Post in the past, but I don't think support for VPC endpoints has progressed.
https://repost.aws/questions/QUcBZhT-tlSMC_vYwjWGJUIg/will-cognito-support-privatelink

EXPERT

answered 2 years ago

EXPERT

reviewed 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.