Skip to main content
886

March 19th, 2025 × #AWS#Infrastructure#SST

AWS and IAC for Dummies with SST

Scott explains SST for configuring infrastructure on AWS and other providers, setting up a dev environment, debugging issues, and managing staging/production.

or
Topic 0 00:00

Transcript

Scott Tolinski

Welcome to Syntax.

Scott Tolinski

Today, we're gonna be talking about infrastructure as code and AWS, Cloudflare, these types of things with something called SST.

Scott Tolinski

We had Dax Rad on the show a little while ago to talk about SST and some of the things he's been up to, but I hadn't gotten my hands dirty with it until now.

Scott Tolinski

And I've been deploying things on AWS with SST. And let me tell you, it makes it way easier than ever having to deal with AWS services. In fact, when I press deploy on what I'm working with, it modifies, like, 30 different things in AWS. And I don't have to know what those things are. I don't have to click through the GUIs. I don't have to, get all my roles and all that stuff. So we're gonna be talking all about how you can utilize these skills to both deploy on AWS JS well as anywhere that supports, Terraform or Pulumi, I believe it's called. If I pronounce that wrong, you can correct me.

Scott Tolinski

Either way, my name is Scott Tolinski. I'm a developer from Denver. With me, as always, is Wes Bos. What's up, Wes? Hey. Yeah. This this sounds exciting. We had DAX on a long time ago. Yes.

Wes Bos

Probably, like, two years ago just when this thing was just kicking off. And it seems like it is, so much more mature and and, like, obviously, very usable right now. And this is this is awesome because, like, a lot of people do wanna be able to deploy to something like AWS, but it's just not worth not worth the the pain of of having to do that type of thing. So, like, SST is correct me if I'm wrong, but this is a a way to configure your deployment architecture with code. So this is not something you build an an app with, but it's it's a way to put all the pieces together, which is like servers and image storage and all that stuff?

Scott Tolinski

Yes. That's correct. In fact, it it is basically like a nicer way to work with something like Terraform.

Scott Tolinski

Terraform is infrastructure as code. We've talked about that in one of our episodes about bare metal. That was, like, really super good, where what you have with infrastructure as code is that you are defining the way that all of your services and all of these things fit together inside of a single config file and, SST as a platform using Palomi and, therefore, Terraform ideas. It it's able to create all of those things behind the scenes.

Scott Tolinski

And it's not just AWS like I mentioned.

Scott Tolinski

There's a whole bunch, and we'll talk all about more of those.

Topic 1 02:33

Many providers work with SST like AWS, Cloudflare, Stripe

Scott Tolinski

But, hey, before we do that, let's talk about Century real quick because let me tell you, I've been deploying things on SST, And I moved a site from, one service to another service, and I had my database over on Neon, and I had my UI over here. And it was all connected like you typically connect things. And then now that I moved this to SST, I have my databases and oh, man. What are all of the different services called? I I tell I tell you, I've been learning more three letter acronyms in the past week than anything else. I actually I think I I had a Google one time that was like, should I do this with my VPC and r or, you know, RDS to s three to e c two? Like, it was just like speaking another language. It's ridiculous.

Topic 2 03:21

Century monitors app errors during infrastructure changes

Scott Tolinski

So if you're moving all that kind of stuff around, you're getting into Vercel, or perhaps there's now private services in your own virtual private cloud that you need to connect and things aren't connecting, you wanna make sure that you keep on top of all of that stuff. So use a service like Sanity at sentry.i0/syntax, sign up and get two months for free using the coupon code Sanity treat.

Scott Tolinski

And, I'd let me tell you, Wes, I needed it because I I'm deploying an app that people are actually using. I have, like, 800 users on this app, and I need to make sure that these users know if this thing is or I need to make I need to know if if the app is breaking any kind of way, especially when you do such a major architectural change to this thing. Yeah. And this is your your HabitPath app?

Topic 3 04:03

Scott moved HabitPath app to AWS for better performance

Wes Bos

Yeah. Yeah. I've moved it all to AWS. On? Coolify.

Scott Tolinski

Coolify. Okay. In Coolify, there's no problem with Coolify. The thing is is that my Coolify server is like a hobby server. It's for, like, hobby projects for me. And in fact, because of that, it's a it's an Yarn server, and the only place that, Hetzner has ARM servers is, like, overseas.

Scott Tolinski

So it's slow. It's slow where I am for a lot of reasons, but it's it's, like, for hobby projects. But, like, now that I got users on this thing, it's like, okay. I I I gotta actually put it somewhere where it's gonna be more performant everywhere. So, yeah, I went and we need to have that. Excuse to to learn how to deploy to AWS? That's kinda my whole job JS, finding excuses to to,

Wes Bos

f with things. Yeah. And it to totally rip everything out, redo it, hit all the problems along the way.

Scott Tolinski

Totally. So, okay. Let's let's talk about it. We mentioned it's SST is infrastructure as code. Again, you're writing your code to define your infrastructure. That's pretty self explanatory.

Scott Tolinski

But the the nice thing about that is is that you don't have to go through in what they call click ops and click here and click there. And let me tell you, on AWS dashboard, there's just about 800,000,000,000 things to click on. So that was the hardest part for me was, like, when I was, like, trying to figure out what was going wrong. I was like, alright. Now I gotta click through these dashboards.

Scott Tolinski

Even though it was a user error on my part, I was like, I'm gonna see if I can dive into AWS's dashboards and figure out what I did wrong here Yeah. Or, like, open up groups or try to route things. And it's like, the end of the day, I needed to nuke my SST config and start over because I was just too green. I I didn't know what I was doing enough. So, yeah, we'll talk a little bit all about that. So either way, you define all of the services in your app in a single config. And I'll show you my config here. And this config file can be very big. It can be very small depending on how many services you have. And I'll collapse some of this stuff so you can see what's important here. For this config, I am hosting a number of things. The config that is on the screen right now. I'm not gonna explain the code too much, but I'm I'm hosting an email service with was it simple email service or something? I don't know. All that happens too. Yeah. SES is simple email service. Yep. Correct. Okay. So I'm hosting email with SES. I'm hosting my sync server for my Deno, local first platform.

Scott Tolinski

I'm, hosting that with an e c two cluster.

Scott Tolinski

I am hosting a UI with Lambda via the SvelteKit Lambda adapter.

Scott Tolinski

I did have an s three bucket in here for for database backup or replica backups at some point. I'm not doing that anymore. It was too complex for for me when I was getting started. The zero schema thing, that is a

Wes Bos

like a like a Linux image, or or how does that run? Yeah. It's a Docker container.

Scott Tolinski

So the first first part about it here is we have our app config. Inside of our app config, you just give your app a name.

Scott Tolinski

You can give it different stages.

Scott Tolinski

So, like, I can have totally separate production and and staging infrastructure.

Scott Tolinski

So that way, I can manage all of that with only, like, completely separated production user and a staging user. I'm also using CloudFlare, and I'm able to run some commands. I'm choosing what region it is, and I'm just declaring that it's a an AWS, provider that I'm using for for many of these things. And then you have essentially, a run function in your config. And this run function is where you define all of your different services.

Scott Tolinski

So one cool thing about this config is that it's TypeScript. It's a TypeScript file. So I can do straight up JavaScript in here. So for instance, I needed to load a JSON file and pass it into pnpm n v variable for zero schema. So I'm doing all of that just in straight up JavaScript, reading a file and loading it into an environment variable. So we can ignore that because it's not SST related.

Scott Tolinski

Here's where the good stuff starts. So I have a VPC configuration. I'm creating my own virtual private cloud. Right? You could think of a virtual private cloud as being like a this is an AWS thing, but you could think of it as being like a a a grouping of related services that need to talk to each other, but privately.

Scott Tolinski

And some of these services can become public, but, like, things like your database or, you know, the sync server. I don't necessarily want those to be, public in that way Wes I want the the UI to be able to connect to them. Right? But Mhmm. I don't I don't want users outside of my VPC to connect to the database. Got it. So you have your own virtual private cloud, so you create that. Then you, in this case, for my container, for my Deno sync stuff, I am creating an an ECS cluster, and I'm passing in my virtual private cloud. I'm giving it some just, like, additional settings, which are not things we need to worry about here. But so you create the cluster. You create the VPC.

Topic 4 08:47

SST config sets up PostgreSQL database

Scott Tolinski

Here, I'm creating a database.

Scott Tolinski

So I'm using, their Postgres helper here, which is just oh, dear gosh. What is the database service? It's so funny. I've been running through these acronyms in my Wes. RDS. My god. I'm so close to all this stuff, and I've been in it for so deep. It's it's all just cycling in my brain. So either way, I'm creating an RDS database with this Postgres helper, naming the database, passing ESLint my virtual private cloud, giving it a name. I do have some additional, transform parameters to do things like logical replication that I need for Xero. I got all this config straight out of Xero, so you typically wouldn't have to do any of that stuff. And then I can even pass it in my dev dev information. So in a dev thing, what this is going to do is it's not going to connect out to AWS for this database. It's just going to when I'm in my development environment, it's going to utilize

Wes Bos

the local Your your local those guys. Yeah. Yes. Oh, that's cool. And and you can, like, turn that on and off? Like, if you don't provide a dev, then it's just gonna connect to remote?

Scott Tolinski

It's going to connect to a remote AWS, that's not your production. I wanted a local database here that I could, like, goof with and make sure I'm doing things correct. And we'll talk about this this interpolate in a little bit so we can ignore that. We'll talk about the secret in a little bit. I just wanna show you all the services I have. We also have my zero sync service, which we talked about as being a Docker container. So I use the cluster add service. I give it an image.

Scott Tolinski

I give it a dev command.

Scott Tolinski

I pass it in load balancer things, and then I even define a domain for it. I'll talk a little bit more about domains and how that all works in just a little bit. And then I give it some e n v variables, and that gets my zero server sync container setup.

Scott Tolinski

Next, I am having an email service. So it's simple email service. Again, this this gets it all all going. That's it. This is the only line I Node, and now I have email ready. Now granted, I had to get the email approved. I had to apply for things on Amazon's dashboard, but this is it. It's essentially three lines of code where you just define SST AWS email, give it a name for the service, give it a sender, bingo, bingo. Now you Scott email in your app.

Wes Bos

You're saying it gives you email. Is does that mean it just simply gives you, like, SMTP credentials? Or, like, it's not setting up any sort of, like, client to actually send the emails. Right? It's just the the actual connection to it.

Topic 5 11:00

SES provides email sending credentials

Scott Tolinski

Well, we'll talk about that.

Scott Tolinski

Because SST, we've talked a lot about it as infrastructure as code. Right? But there's also runtime code associated with SST.

Scott Tolinski

Now I'm not using any runtime code to send email from SST or AWS. I am just using the SMTP credentials.

Scott Tolinski

But many times what you're doing is in your runtime code, you're actually pulling in your, SST resources or using AWS specific packages to connect to your SST resources to then send the email. So that way everything stays really, like, tight. Right? I didn't wanna do that for a number of reasons, so I'm just using SMTP. But, yes, you can get in runtime as well. The website is just using the SvelteKit adapter. There's adapters for everything, which I'll show you in a bit. But we do this neat thing where we're linking a database. We add our VPC. I give it a domain, and then that is that. And then there's a little dev command that can run as well that just runs, DrizzleKit Studio in my dev environment as well.

Scott Tolinski

So this is my, SST config file. It's pretty big. This file could be really just as small as a website if you just had this one SvelteKit thing and that's it. Right? It could be that small.

Wes Bos

But, you know, it can also be big and host a ass ton of stuff. That's for sure. That's good. And there's there's probably parts of SSD that you you didn't use as well. Right? Like, you mentioned s three.

Wes Bos

Right? But, like, what other services

Scott Tolinski

do they have? Let's take a look at the docs. Well, let me tell you, Wes. The answer is that it's pretty much endless. And, it's crazy because this uses Terraform, and because of that, there's, like, a ton of stuff. But even, like, as far as, like, the UI stuff, like, let's say Wes had the SvelteKit site, they have getting started docs for BUN, NUC, Solid, Auth, Deno, tRPC, HONO, Astro, email, remix, Svelte, Drizzle, Prisma, and Next. Js, Analog. I mean, I just keep going. There's they they have docs for everything on here. They knocked this out of the park, these docs. So there's an endless amount of Vercel, especially for, like, getting started. But if you really get into the components, this is where things get nuts. So if you click on components and then AWS on their doc site, it can do anything. You know, EFS, BUS, VPC, task, cron, auth, NUCs. I mean, it can do everything. Oh, man. It's yeah. So

Wes Bos

just AWS alone, there's 39 different Maybe even more than that. Like services. I counted them. So there is 39. Did you count the ones under internal as well? Oh, no. No. I didn't. That's what I'm saying. AWS, and then internal is oh, man. Yeah. Yeah. Man, AWS is just what a huge freaking monster of a of a service. It's just it's so huge, like, when you think about all the different little services that they provide.

Scott Tolinski

Yeah. And then so, also, you can do CloudFlare stuff with this too, k v d Node, workers bucket, all of that stuff. You can do a ton of stuff.

Scott Tolinski

And there's not just that, Wes. There's a 50 providers that work with SST.

Scott Tolinski

So you can think of AWS as one provider. You could think of as Cloudflare as another provider, and then there is more than, what, a 50 other ones. In fact, there's a whole directory of different providers that you can use, to essentially configure your infrastructure. You can even create things like Stripe products directly from your SST config.

Scott Tolinski

So it's not just AWS. It's not just Cloudflare.

Scott Tolinski

It is endless amounts of things.

Scott Tolinski

It's pretty insane. Yeah. That's because

Wes Bos

of Terraform and Pulumi?

Scott Tolinski

Yeah. It's it's based on I think it's built using Pulumi, which uses the Terraform spec. Man, I am, like, not the right person to get deep into that because Yeah. I I'm so new to some of this stuff. But when I was looking at it, it uses Pulumi, which so Pulumi is infrastructure as code in any programming language. It's an open source project, and SST uses all of this open source stuff.

Scott Tolinski

So this is really kind of the backbone for a lot of this stuff, and it's why it all works as infrastructure as code. And it's a cool project. I didn't really know anything about it. I heard of Terraform, obviously, but not Pulumi.

Scott Tolinski

But, yeah, you config configure all of this stuff inside of, your SST config. Again, it's your entire infrastructure. It's it's pretty incredible.

Scott Tolinski

Let's talk a little bit about the developer experience here because the dev mode is something that you can run. And, in fact, let me pop up in my term. Okay. So we run for me, it's p n p m s s t dev, but it's typically just s s t dev. And you can see that it tells me my app, and it does all this stuff automatically. It's giving me my, my zero sync server. You can see it's up and running. My functions are up and running. It has my Drizzle Kit Studio. You can see it has the tunneling here, HabitPath, my HabitPath Postgres, and my HabitPath SvelteKit adapter. And it has all this stuff up and running. And at this point, I can just load up my system.

Topic 6 16:22

Dev environment runs services like database and functions

Wes Bos

Scott has a terminal running, and it's like this little GUI in the terminal, where he's switching between all of these different resources.

Wes Bos

And you're you're clicking on them as well? What is Yeah. You can click on it. Can you is can you click on things in the terminal?

Scott Tolinski

This is whatever this is, Wes, I don't know what what this is. And it's not ghosty because ghosty has not great you know, like, Warp has really good click functionality. Ghosty doesn't. It has, like, not so whatever he built this in, you can you can click in this. So Cool. So either way, yeah, I got all my dev services up. I mean, it's like you don't have to worry about, like it's like running all your services like you would if you were using something like Docker. Right? Here's my app. It's up and running right here. So pretty nice.

Wes Bos

That is really cool. I I imagine that would be really handy for, scaling up and and being able to define what happens when the resources start to get limited. Right? We had, David Flanagan on Node seven forty six, and he talked about something's kinda similar to this, where he's, like, really into, like, Kubernetes.

Wes Bos

And he does all of that architecture of the Kubernetes with TypeScript files, and it JS absolutely wild, the stuff that he's talking about. And he was, like, kind of explaining how to handle the different traffic spikes. Is is that something that's doable in here? I would imagine. Right?

Scott Tolinski

Yeah. Yeah. There's all kinds of you can you can configure literally everything about your your hosting. And and I've I've only ever deployed to AWS with this, so I don't know what it's like in other platforms.

Scott Tolinski

In the past, I had this replication manager from the Deno sync docs. And, yeah, you're giving it the the CPU and the memory and all that stuff. But I would have to imagine, it wouldn't be too difficult to set up, auto scaling or any of that stuff inside of here. Not something I've Deno. But Yeah. Your entire infrastructure is defined in here to the point where you're only really getting into the AWS console to set up user accounts and I'm rules and stuff like that.

Wes Bos

And I'm trying to, like like, compare this against, other things like, flight control.

Topic 7 18:31

SST similar to Kubernetes config with TypeScript

Wes Bos

We had them on the podcast as Wes, where flight control is like a it's a service that you pay for, and then that service connects to your own AWS account. That service has, like, a GUI, and you can hook it up to Git, and it will deploy. And you can you can use it for, AWS Lambda. You can use it for databases, job scheduling, background workers, things like that. It's it's just for AWS. It kinda gives you that, like, Vercel experience, but with your own with your own AWS account. Does Yeah. SST have something like this as well? Like, if you wanna, like, say, okay. What am I using? Yeah. What's the approach to that?

Scott Tolinski

Yeah. You you mean, like, in terms of, like, what am I actually deploying right now? What's the GUI for that look like? Yeah. Yeah. And my other question to that is is is there also,

Wes Bos

like, a, like, a CI built into this?

Scott Tolinski

Yeah. Well, I got all those answers in one. Alright.

Scott Tolinski

Let me pull up my SST console.

Scott Tolinski

So, in addition to your your your scaling question, Wes, yes. Yeah. There is I just was on the, this is the v VPC.

Scott Tolinski

This might be the VPC. This is the cluster, the EC, whatever. This is the cluster. Either way, scaling is a thing you can set up to be, you know, auto scaling, give it min and max values for things Okay. Memory utilization, that kind of stuff. So, yeah, you can set up auto scaling directly. 50% CPU, it scales up another one to a maximum of however many you've set.

Scott Tolinski

Yeah. So that that brings it's a good time to bring in the the console here. So, like you mentioned, like, what is the GUI for this type of thing? You you get access to this. Now this does become a paid product at some point.

Scott Tolinski

I would imagine, when I was looking at the what does it take for this to become a paid product, it's not anything that I'm close to hitting. So it's I haven't really looked too much at it, but it was really reasonable. And and what this JS, again, is this is exactly asking about. So within this, you can see all of the services that you're using. And if you've ever been, like, you know, how how many things JS this actually configuring and using? I mean, just, like, scroll through all of this stuff. And this is all of the stuff this is having to deal with and configure. It's pretty mammoth. Right? So this is everything that I'm using just for that one app, which is why AWS is tough. And it it's neat. So you get all kinds of things. You get logs, so you can get the logs for both your your your any of your processes that have them. So my Lambda JS for my SvelteKit site or my Deno sync service. You get logs.

Scott Tolinski

You get issues, actually, which are interesting. It's kind of like a, Century mini. You can see I need clearly need a four zero four page because, a lot of people are looking for WP login on my site right now. The bottom Yeah. And it's hitting a four zero four and giving me an error. So, that's, like, kinda funny. You get, things like that. You can get the UIs for your updates. You can check your deploys. And as far as auto deploying go and things like that, you can connect it directly to a GitHub repo. So I do have mine connected to my GitHub repo, and I do have auto deploy. So anytime I push to a specific branch, it does do an auto deploy for me, without issue. And one of the cool things that we haven't necessarily talked about is environment variables and how you connect your app and all those kinds of ways. It ends up being really nice and simple to the point where I only have one environment variable defined in, like, in ClickOps here Wes I'm pasting it into this UI. I only have one single environment variable even though I'm using a ton of them, and I'll show you a little bit why in in just a second here. But this is the GUI for it all, and it's fantastic. And, they've done a really great job with this.

Wes Bos

So the pricing is based on active resources.

Wes Bos

So anything anything over 350 active resources is charged at 8.6¢ per resource. So what how many resources do you have for for your app here?

Scott Tolinski

Oh, man. That's a great question.

Scott Tolinski

So many resources, but not that many.

Wes Bos

Wes, like like, what's what's a resource?

Scott Tolinski

Every single one of these little things is a resource. So So, like, clearly, like, when you have this, you know, it sets you up with, yeah. I I don't even know what half this stuff JS. If I'm being entirely honest, I'm so I'm such an s s or I'm such an AWS Node. SK CDN SSL.

Wes Bos

That's a SSL certificate.

Scott Tolinski

Yep. This is, like, Cloudflare's own lookup.

Scott Tolinski

There it sets you up with, like, what's it called, CDNs and all that stuff for you with CloudFront.

Wes Bos

And what you're scrolling through right now is a list of all the resources that are used. And these seem like like functions or just like like, helpers? They're, like, for Microservices Vercel. Right? Pieces?

Topic 8 23:24

Pricing reasonable for small to medium complexity apps

Scott Tolinski

Yeah. Like, the SST certificate, SSL validation.

Scott Tolinski

Okay. Yeah. I mean, it's it's all messed up. Sanity are are you using here?

Wes Bos

Is this is this is a relatively

Scott Tolinski

large app. Right? You have you have a front end. You have a back end. You have a database. It's a sync server. I have an email service. That's a great question. I don't know how to other than just by, like, straight up counting them, which will take forever here.

Scott Tolinski

I would say looking at this, it's probably less than a hundred. Yeah. It looks like it. Okay. Maybe more than 50. Yeah. Maybe around 50 something. Who knows? But, again, I haven't I haven't gotten to that limit yet, so I haven't even thought about it. And this is all I need. So, like, now that I have this Yeah. I'm, like, good. I'm golden. I don't need to add anything else for this.

Wes Bos

Yeah. Even just, like, if you were to think about if you had three times that, that'd probably be $25 a month. Yeah. And if your app was three times more complex than it would be, then you probably are okay with spending $25 a month because Yeah.

Wes Bos

Vercel, like, using a a platform as a service, you're probably looking at at hundreds. Right? That's always the trade off with using AWS. Right? It's hard, but it's much cheaper.

Scott Tolinski

That's that's exactly correct. And and so, like, getting into this stuff has been really great because I do feel like AWS is not something I necessarily have the time to get a degree in. You know? So for me, being able to, work through a config like this is something that has been really nice for me. Let's talk a little bit more. I mentioned that, like, I don't have to use a lot of environment variables inside of, like, click ops or or copying and pasting them or anything like that. Or even in my dev environment, I'm not having to use that a lot because SST allows you to do some things here. So for instance, like, I have my, like, auth secret, and that auth secret is defined as an SST secret. Now I set this via the command line once, and then I'm able to access this auth secret just with a, a new SST auth secret. Right? I'm able to access that in my infrastructure.

Scott Tolinski

And, likewise, the database, let's say I did need the database connection string, which I I did, I can use the database variable that comes from my Postgres definition.

Scott Tolinski

And then I can use this interpolate to pull out all of the values out of it and then turn it into a connection string if I need it, which I did because I I do use environment variables in my code. And then later on, let's say, in my website, I can pass in that connection string that's generated from SST.

Scott Tolinski

And remember, my SST config had a dev database and it had a production Node. So I don't have to fuss with a dev e n v and a production e n v. It's just gonna use my dev database and my local one. And, likewise, if I want to pull from a dot e n v, I can just use process dot e n v in this file, and it will pull directly from my dot e n v. But, again, like, other things can come directly from that, like, secret value I created. You can do just straight up JavaScript in here. So I can say, oh, hey. For my sync server, when I'm in production, use the service URL that it created. But in in local, use the local host URL.

Scott Tolinski

So, you know, super nice there. So, again, you're you're defining a lot of this stuff in this single file, and you're able to use it, pass it into your app, all that stuff. But there's also, like, more, like, runtime code stuff. And I didn't use a whole lot of this, so I'm just gonna paste this down here for people who are watching.

Scott Tolinski

You can there's SST runtime things. So the code I'm showing on the screen, and I'll talk through it, is using s three, to upload files.

Scott Tolinski

And what they're able to do is from the SST package, they're able to import resource, and then they're able to access the current bucket with resource, my bucket, and then dot name. And that all comes directly from your SST config. So, therefore, it will work in dev. It will work in prod. It will work in staging, even if those buckets are all different locations necessarily.

Scott Tolinski

And it it works super well directly with the AWS s three client, but you can do this with any of your resources, especially things like oftentimes, they'll recommend using the SST config to pull out, the database, credentials, right, or the email credentials or those types of things because they're being defined as the infrastructure. So you can use SST in runtime as Wes. So it's not just, like, config and let it rip. You know? Yeah. So it it's really pretty Scott. And Wes did mention, like, the tunneling aspect, but, like, one thing that I had a big problem with, me personally, I'm so used to having, like, oh, I just have a connection string for my database.

Topic 9 27:50

Tunneling provides access to private production resources

Scott Tolinski

I I pass it my IP to approve my IP, and then I can connect to it from my local one and, you know, make sure that the migrations I did or whatever is the data is where it's supposed to be. And I had such a problem with that, Wes. I had such a problem with, with the private resources and a VPC. Like, how the hell do I connect to this stuff? How do I make sure the data's there? And what I was able to do was I was able to do an SST shell, and then you have access, like, shell access to your database that I could run PG restore and stuff like that on my database while connecting to the production one without having to expose that production database to the general public. Yeah. Yeah.

Scott Tolinski

Which which freaks me out. Right? If you click those buttons, it's like, make this public and, have no IP restrictions and stuff like that, and it should freak you out. But it freaks me out. So, being able to tunnel into that is is super nice. Cautious amount or a healthy amount of caution is always good when

Wes Bos

when exposing things to the Internet.

Scott Tolinski

Yeah. No kidding.

Scott Tolinski

But, yeah, this is this is SST. And you know what? It it is one thing I gotta say, if you're if you're, like, watching this and you're like, this all looks interesting to me, I feel like I could do this. Maybe I'll actually have a YouTube video. Yeah. I think that's a good idea, to put out a YouTube video at the same time we release this that shows you maybe walking through some of this stuff. But I will say that the the developer docs for SST, the biggest round of applause, for everybody involved in creating these docs because they are good. They're very good. And they walk you through not only, like, things you might want to do, but I gotta say, as somebody who's an AWS noob, when I went to the how to setting up your AWS accounts and it tells you to create management accounts, create, staging and production accounts, create all these different I'm credentials and interfaces and stuff like that. You create all of these things, and these docs walk you through it. They hold your hand like I'm holding my daughter's hand crossing the street. It is like I feel so secure reading these docs because everywhere it tells me to click. I click these darn things, and they're there. I don't know how many times that, like, happened to you where it's like, click the, getting started button, and there's no getting started button. So Oh, yeah. Yeah. Shout out to, everyone involved in these docs because they're fantastic, and they will walk you through all of this stuff. On that kind of same idea, I remember Wes had Brian LaRue on. He was working on begin.

Topic 10 30:12

Begin creates initial IAM access then configures resources

Wes Bos

And part of what they did is you would just create a initial IAM that had access to everything.

Scott Tolinski

Mhmm. And then you give it that, and then it goes and and creates all the stuff for you. Does that work the same does this work the same way? I you know, I'm not I'm not gonna say yes to that because I don't think so. Okay. And the way I did is I did have to create all the I'm identity center stuff. I had to do all that. I I don't know if this does that, and it might.

Scott Tolinski

You know, maybe Dax can answer that for us. There's a good chance it could because it does so much other things. I don't wanna say it doesn't. But I did it by hand, and it wasn't that tough, just because this warp you through it. And you should, like, click here, do this, whatever, and you're all set up. Mhmm. One thing that I I didn't mention that I I do wanna say is really dope about this, Wes, is that I gave it my CloudFlare ESLint an environment variable, my CloudFlare API keys and stuff. Yeah. And by doing that, in my config, I just specify a domain property. I give it my domain Node.

Scott Tolinski

And then well, this is just saying for production, use Cloudflare as a DNS, and I gave it this override true because it was having some issues creating and recreating it. But this goes through Cloudflare and updates your DNS, for everything, for subdomains, for domains, updates your DNS, gets all the everything going for you. And it did also the same, same thing. Well, like I said, it didn't do the same thing right now. I had to do some click ops for that. But, like, for my domains, for whatever it was, my subdomains or normal domains, it took care of all that for me. And I gotta say that's pretty dope. I didn't have to think about it. It just created this domain record for me, and I went there. And at some ESLint, when I was getting this going because I I I didn't wanna take Habit Path offline while I was working on this, I had another domain pointing to it. And it was easy as just changing this domain here. Next thing you know, it's working. Scott

Topic 11 31:58

Forgetting Cloudflare cache rules only remaining manual step

Wes Bos

yeah. I always love that because there's always one little piece where you accidentally forget one little thing. Like, ah, that that's still a click click ops thing right now. Like, right right now, I have, I'm working with my CloudFlare cache rules. Mhmm.

Wes Bos

And the cache rules are done via the GUI in the, dashboard. And I'm sure you can, like, do something like this Wes you can you can replicate it in code, and that would be kind of Node. But, like, I I didn't feel like diving into it. But I know that when I go to move it to the production domain name, I'm gonna forget.

Scott Tolinski

Just something. Who knows what? Yeah. One thing I I just kinda glossed over a little bit was this link. When I showed you the SST in the runtime stuff, that's where this comes into play here. So if I wanted to access the database credentials on the server of my SvelteKit, site here I guess it's a Lambda. It's not a server. If I wanted to access my database resource, I have to link it. So anytime you have a resource that you wanna make available in another resource, you just link it, and that's it. So pretty nice and simple. Works super well. I I've no issues with that whatsoever. And, yeah, I gotta say, for somebody who's avoided infrastructure as code mostly because you go to you you you think, like, this is a good idea. Right? This this sounds like a good idea. I'm sold on it. And you go to Terraform's docs, and you're just like, I don't wanna do this. Like, every every everything I I wanted out of it is just like, I don't I don't feel the need for it anymore. So Well, there's a reason why that's

Wes Bos

like, infrastructure is an entire career in itself. Right? Just just doing all this stuff. And it's quite amazing that, like, us lowly JavaScript developers can now, like, architect some major infrastructure.

Scott Tolinski

It is. And I I feel very powerful with this because I feel like like I said, you know, I typically, me, personally, we've talked about hosting databases and stuff like that. I you know, I'm I'm opting to use something like PlanetScale or Neon or, you know, like a a paid managed service. Now I gotta now I gotta keep track of another billing and another service Wes with this, I can fire up a database directly.

Topic 12 33:49

Infrastructure as code allows complex architectures

Scott Tolinski

I can have any type of database I want. I can have it available in my application, and I can do it in absolutely no time with, like, a couple liners in a config. And to me, that is very powerful. Yeah. It's very, very powerful. So, yeah, I I'm pretty sold on SST as a platform. And, again, it's not just AWS. It's a 50 plus providers, including CloudFlare, if you wanna deploy things to CloudFlare or products on Stripe or that type of thing. And it's it's really pretty pretty sick.

Scott Tolinski

So shout out to the, everybody involved in SST, DAX, and, you know, anybody who's working on this. Also, what's interesting, Wes, is I don't know if they're currently using this, but in the console of SST, they're either going to or currently using Deno sync. I think they were using Replicash before.

Scott Tolinski

So I'm deploying a zero sync app in a console that's built with zero sync, and, it's pretty sick. Yeah. That's sweet.

Wes Bos

Right on. Well, thanks for laying it down. I'm certainly gonna give that a shot, on my next project because I think it'd be kinda neat to deploy it like this.

Scott Tolinski

Yeah. Yeah. Big, big fan. So, yeah, that's all I got. Any any other questions, or are you you good? That's it.

Scott Tolinski

Cool. Well, let's get into sick picks and shameless plugs, things that we like that are sick, things that we wanna plug that are shameless.

Scott Tolinski

Wes, do you have any sick picks or shameless plugs today for us? I do.

Wes Bos

It's right here. These are something that my wife found, and I think it's really cool.

Wes Bos

Can you guess what it is? It's two pieces of wood that

Scott Tolinski

connect with magnets. Is it for drying things?

Wes Bos

No. Although, you could. I'm sure you could do that. So what it is is it's actually a picture frame. Oh, yes. Yes. Yes. Yes. Picture frames are one of the most obnoxious things in the world because they're either the worst quality ever, like, even the IKEA picture frames have gotten so awful over the years, or it Scott a million dollars to frame something. And and sometimes you just have something that's nice that you wanna hang up.

Wes Bos

And my wife found these, where it's two pieces of, like, teak wood, and they connect to each other with magnets.

Wes Bos

And you can get them in different lengths. You can cut them down to the actual size of the picture that you're hanging. And you just put one at the top and one at the bottom, and then you you've got this nice oh, I just I just, broke it. Oh, no. No. I didn't. It didn't I didn't break it. It goes through the thing. That's great. I'm glad you didn't break it, honestly. I'm super glad. But it like, if you've got, like, a a nice photo you wanna hang up or whatever and you don't feel like going the whole route of a regular picture frame, grab a set of these. They're, like, I don't know, $510 or something like that.

Wes Bos

And, it looks really nice to have them in all the different colors, like a black one, a white one. This my we got the teak version that looks best with our house.

Wes Bos

That's dope.

Scott Tolinski

I'm gonna, sneak peek something kind of off board here. In Colorado Wes, it's so dry here. It's so dry. I have not been able to get a handle on, like, you know, like, ChapStick. I'm putting ChapStick on, like, every three seconds. My skin is super dry. And nothing I found that has been very good for that until, I started using Aquaphor Healing Ointment Advanced Therapy. And it's like a a balm, but it's it's essentially it's essentially petroleum jelly, but, like, with several other things, like, I believe, like, lanolin or some other stuff in here. Yeah. We slap that on our kids' butts, and we're we're we buy the huge ones of that. I buy the huge one. Yeah. I buy the huge one. And and this is, like, the best thing I've ever had It's amazing.

Scott Tolinski

Chapstick ever in my entire life.

Scott Tolinski

And I, yeah, I hate the Chapstick. You gotta put your finger on whatever, but I'm I'm doing it for this because it works so dang well. And I'd used Aquaphor before for, like, you know, like, tattoo healing and stuff like that. But, man, best ChapStick around, and this stuff rules. I think, like, I've never had a more healthy skin since I I've moved here with this stuff. So shout out to shout out to Aquaphor. Right? Yeah. It's it's good stuff. We're we found a

Wes Bos

small version of it as well when we were in The States at, I think, CVS or something like that. And it's it's like a a mini one we can kinda just keep in in the diaper bag, and you don't have to bring the huge one around. So it's it's expensive stuff, but, man, it's awesome.

Scott Tolinski

Yeah. For this this big ass tub, a 14 ounce jar, it's, 15.

Scott Tolinski

But I I've bought one jar of this in the past year, and I'm not even halfway through it. It makes it super expensive in Canada. It's, like, 45 or so. Jeez. Oh my god.

Wes Bos

Yeah. 15 is not bad at all, though. That'll last forever. Yeah. Yeah. Cool. Yeah. Okay. Shout out to Aquaphor.

Scott Tolinski

Shameless plug. I'm gonna shamelessly plug the Syntax YouTube channel, obviously. I'm gonna do a video on SST config in in dev here. So if you are interested in seeing some of this more in action in, like, Node youtube.com/addsyntaxfm.

Scott Tolinski

Smash that subscribe button. Wes and I and CJ are all going to switch to Neovim the moment we hit 500,000 subscribers. So if if you wanna see, just click that subscribe button. Follow, like, all that kind of stuff. Pro at it. Yeah.

Scott Tolinski

Yeah. And just share share if you like any of our videos, make sure you like them, share them, all that stuff. It just helps us, helps us get out there. So thank you so much.

Wes Bos

Alright. Thanks for tuning in. Catch you later. Peace.

Share