2

I am trying to use SSL/TLS for Python Flask/Waitress server running the ECS Fargate. I haven't found a solution for our use case.

Here are the designs for the ECS Fargate:

  • Container will only interacts with backend AWS Lambda
  • Public IP disabled, only private ip is enabled.
  • No use of load balancer. The Python server is stateful and spinning a new container when requested is more cost effective.

How should I make a HTTPS request from Lambda to the ECS Fargate?

EzyHoo
  • 301
  • 2
  • 14

2 Answers2

2

Solved the issue:

  • Create a self-signed cert using OpenSSL in Flask server
  • Trust self-signed certs in Lambda
EzyHoo
  • 301
  • 2
  • 14
1

Why do even need to make an HTTPS request from the lambda?

Answer to your question

Enable the security group port 443 on your ecs fargate instance and you should be able to make requests even without ssl certs as browsers only block them,

2nd thing is if for any reason you need a SSL cert on localhost you can use this library https://github.com/FiloSottile/mkcert

  • The Lambda and Fargate are in the same VPC/cluster. The traffic from lambda to Fargate is in HTTP using Fargate's private IP. In case the attackers got into the VPC, the traffic will be encrypted if it is HTTPS request. The browser doesn't call Fargate instance. Only Lambda calls Fargate instance. – EzyHoo Feb 10 '22 at 18:59