From the following link, it seems possible to call a Fargate task from the API Gateway: https://aws.amazon.com/blogs/compute/introducing-amazon-api-gateway-private-endpoints/
But, does the task have to be running 24/7 for this to work? Is it possible to have the task run only when the endpoint is hit? I have some critical but rarely used services and I'd like to make them as inexpensive as possible.
I believe something similar is possible with Gateway + Lambda: https://serverless.com/blog/flask-python-rest-api-serverless-lambda-dynamodb/
But, I like the flexibility and ease of use which comes with using Docker and Fargate.