Are there any plans to add docker/ecs stack? I'd l...
# sst
r
Are there any plans to add docker/ecs stack? I'd love the option to deploy a gatsby/nextjs site using a docker container.
t
We've been talking about making a simple way to deploy a container
r
I would be very interested in this and happy to help test.
I'd like something like your static site construct, but with docker container instead of s3
g
@thdxr it sounds great! In one of my projects I have an integration with an IoT broker which make much request (more than 10/1s for subscription) to one single endpoint. My idea was to keep all app apis built in Lambda (for simplicity) and a http server (with only 1 endpoint for IoT) deployed in ECS (for save costing)
t
Did you do the math to verify ecs will save money? IIRC the cheapest ECS fargate setup is still ~ $70 a month which is a lot of lambda executions
r
Assuming an very minimalistic ECS/Fargate (0.25 CPU, 0.5 GB mem, non-spot, API Gateway + CloudMap for LB), I'm pretty sure that's about 10$ a month. That's still more expensive than pure API Gateway + Lambda afaik though
t
ah think my number maybe from non-burst
r
Yah, from my understanding Fargate pricing is pretty reasonable these days albiet still more expensive than EC2 and manual bin packing. At least in our case, we're moving to Lambda for event processing workloads, and ECS/Fargate for request-driven or protocol-specific workloads as it has differing attributes (and a simpler mental model) for what we're doing. So +1 for a ECS/Docker option. CDK already has some decent foundation to build on here, and some inspiration could probably also be taken from Copilot
g
@thdxr I just made some simple calculation, assuming a request rate about 5 request/s and 100 subscriptions for the first year.
Copy code
5 request/1s * (60 * 60 * 24 * 30) * 100 subscriptions = 1296000000 requests/months
From dashbird lambda calculator I retrieved $1332.55/month. I didn’t make math with ECS but I’m pretty sure to handle this traffic with less than $1332.55. In the next year subscription will increase (500 the second year, 1500 the third…)
r
@gio (maybe off topic now but) at that point also, why are you having any portion of the API in Lambda? Why not go all in on ECS? Or is there a specific type of processing happening in Lambda? Because otherwise you're still paying those Lambda costs, just in addition to ECS costs
t
@gio are you using aws IOT? You can use IOT Rules to trigger a lambda or queue into sqs instead of going through apig
And if it's in a queue, you can batch the lambdas so it's not 1 invocation per message and can cut the costs
g
@Richard Simpson IoT system is an additional feature for a subset of users of the main system. Basically I didn’t want move all infrastructure to ECS just for this reason, I prefer keep things simpler through pure serverless and instantiate a specific solution for IoT. @thdxr No, it is not made through AWS IoT but you gave me a nice suggestion. It is a pubsub system which works in two steps. 1. Main system request a subscription specifying a “callback_url” where vehicles data will be sent (through POST method) 2. IoT system performs a challenge (one off on sub init) in which it will send a GET request to callback_url passing a token in query string. Main system should only return that token as response to iot system. 3. If challenge succeeded IoT system will send request to callback_url through POST method. From your suggestion I thought a possible solution: I could integrate SQS FIFO inside API Gateway, this because I need to satisfy GET challenge on callback_url through a Lambda meanwhile POST on same url is directly connected to SQS