Also doing my deploys/destroy outside of github ac...
# sst
j
Also doing my deploys/destroy outside of github actions would make sense
f
I remember from your architecture you were deploying ESC fargate, i guess that’s what took the longest to provision.
CDK deploys all stacks sequentially one after another. If ur CDK app has stacks that aren’t interdependent, SST will deploy them concurrently. And you might see a speed boost there.
Subsequent deployment shouldn’t take this long.
j
My stacks are dependents from each others
I think I'll need to build a "common stack" that I keep around like the vpc, aurora, cloudfront
And a preview stack which handle the most dynamic part like lambdas and fargate
Yes subsequent deploys are faster of course 🙂
f
Yeah that makes sense!
j
I deployed a second time, I think the longest parts are the VPC creation with the NAT gateways and Aurora serverless
also I’m currently not using codepipeline so cdk deploy is doing 0 parallel deployment 😞
it took 27 min again, at least the timing is the same every time lol
f
LOL very positive thinking 😁
j
my architecture evolved quite a bit since the last time I show you my diagram, I’ll need to update it and show you again ^^
Basically Cloudfront as a reverse proxy to both my frontend and backend. The backend is a fargate service fronted by an ALB. And I have a a private ApiGateway + lambdas that communicate with the fargate service
I had to implement fun patterns to make all of these works
Like making a private ApIGateway, or protecting the ALB to be accessed outside of Cloudfront 😄
Also I didn’t see a lot of documentations / examples about using Cloudfront as a reverse proxy for the backend too but I think it makes sense and open a lot of interesting caching opportunities 🙂
(also no CORS :p)
f
yeah… this is awesome! I was asked by a few folks about setting up Hasura on lambda.. i’d love to have a peak at ur CDK code at some point, and maybe make it a Hasura Construct out of it.
j
Sure, I’ll have to make sure everything is working smoothly but happy to share 🙂
Hasura is hosted in fargate but I have an internal graphql API stitched to Hasura as a remote schema for my business logic
this one is in a lambda
Hasura in a containerized lambda could work on paper but as it provides subscriptions features (websocket) I don’t think it would fit at all
f
Yup. it’s impressive you just dived in and managed to put something together so quickly. There are quite a few moving pieced there.
j
Well, with CDK it’s quite magic, it’s just code 😎
f
right.. and you don’t have to define every single CloudFormation resource
j
For my job consuming lambdas I can just loop over my “workers” folder and create them dynamically (SQS + Lambda for each worker), it’s so cool.