https://serverless-stack.com/ logo
#sst
Title
# sst
r

Roger Rajaratnam

03/12/2022, 10:46 PM
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

thdxr

03/12/2022, 10:54 PM
We've been talking about making a simple way to deploy a container
r

Roger Rajaratnam

03/12/2022, 11:06 PM
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

gio

03/13/2022, 4:41 PM
@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

thdxr

03/13/2022, 8:10 PM
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

Richard Simpson

03/13/2022, 11:12 PM
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

thdxr

03/13/2022, 11:14 PM
ah think my number maybe from non-burst
r

Richard Simpson

03/13/2022, 11:19 PM
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

gio

03/15/2022, 7:57 AM
@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

Richard Simpson

03/15/2022, 3:28 PM
@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

thdxr

03/15/2022, 4:27 PM
@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

gio

03/18/2022, 10:15 AM
@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