Loading
    Loading...

    Transcript

    In the last lesson, we deployed an XJS app in our own AWS account with SST. But how does that show up in our account? What did we actually do to our account? Well, ultimately, we deployed a whole bunch of resources, or SST did on our behalf. So what are resources?

    Well, they're like the objects in our account. To take an object-oriented programming parallel, resource types, like a lambda function, are like a class. And the actual functions that end up deployed into your account are the objects. Now, each service, like Lambda, can have one or more classes or resource types. This analogy is stupid, I shouldn't have used it.

    But ultimately, SST is in charge of figuring out exactly what resources need to be deployed into our account to support the infrastructure we've defined in our TypeScript definitions. So, how do we see those in the account? How do we go into our account and see exactly what just happened? Well, let's log in to our development account in the AWS Access Portal. And we're going to go to a service called Resource Explorer.

    And this is a relatively new service that AWS provided to much excitement within the community, because we've never really had a tool like this to search across all regions in our account and inventory the various services and resources that are deployed in our account. So we're going to first, because it's the first time we're coming in here, we have to turn on Resources Explorer. We're just going to do a quick setup. We're going to choose the current region which is US East 1 as the aggregator index region and I think that's it. This is a free service.

    It's called out here at the bottom. But they make us go through this step just to configure it. So let's turn on Resource Explorer. It's going to create the indexes, basically the searchable databases in each region. And now we can go to resource search once it's finished indexing each region.

    So here we get a list of all of the resources deployed into our account. There's a few things I want to call out about resources. You can see the resource type, Like I said, these are like the classes and OOP terms. So we have a Lambda function here. And if we just dive into this Lambda function, each resource in AWS has something called an ARN, an Amazon Resource, wait.

    Amazon Resource Number, what? ARN, what is an ARN? Stand for? A name, it's a name. Amazon Resource Names.

    Every resource deployed into your AWS account has a unique identifier. It's called the ARN, or Amazon Resource Name. And you can usually see that on the landing page for any given resource. Here you can see the function ARN. So this is a unique identifier.

    You'll use this all over the place. In the API or through the SDKs, if you're invoking the function programmatically, you have to provide the function ARN. This is how you identify resources in your account. Resources can also have tags, which are just like what you would think a tag is. So the ability to kind of categorize resources based on custom needs that you might have.

    Well, SST adds tags for the app name and stage on every resource it deploys. So when we created our SST app, we gave it a name, Next.js app, and as I mentioned, every developer will have its own stage, there will be a production stage, you might have a test stage, or a staging stage. So in this case, this Lambda function is deployed for the Next.js app in the Atom stage, which is my developer stage. So with that information in mind, we can come in here and actually search through resources to find only resources for that particular app in that stage. So this query, keywords, filters, and operators text box here, we can actually use some syntax.

    And I could link some documentation for how this works. But for now, we're just concerned with tags. So let's say tag sst app equals Next.js app. And if we click Enter, or if we just hit Enter, it's going to go from 17 resources to 0. Oh, I forgot the hyphen.

    So 17 resources. All the resources in this account have that tag, because all we've done is deploy the one stage. But we could similarly filter sst stage equals atom. And again, we haven't deployed any other stages. But imagine you have multiple developers sharing this staging or this dev account, all deploying their app.

    We could filter down to look at only resources that belong to each developer and all the resources that make up their stage. So then you can filter by resource types. We could say we just want to look at S3 buckets within this particular stage of this app. So here you can see all of the different resources that were deployed into your account. Again, we're within the free tier on all of these, so you don't need to be concerned about cost.

    But I would encourage you to go through and kind of poke around and get an idea of which resources were deployed to support an XJS site, because that'll be useful context down the line.