Skip to content

Commit fc354dd

Browse files
committed
Flip ion to v3
1 parent 7db1b68 commit fc354dd

File tree

73 files changed

+272
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+272
-273
lines changed

_archives/deploying-a-react-app-to-netlify.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ redirect_from:
1111
- /chapters/hosting-your-react-app.html
1212
---
1313

14-
In this section we'll be looking at how to deploy your React.js app as a static website to [Netlify](https://www.netlify.com). You'll recall that in the [main part of the guide]({% link _chapters/create-a-new-reactjs-app.md %}) we used the SST [`ReactStaticSite`]({{ site.docs_url }}/constructs/ReactStaticSite) construct to deploy our React app to AWS.
14+
In this section we'll be looking at how to deploy your React.js app as a static website to [Netlify](https://www.netlify.com). You'll recall that in the [main part of the guide]({% link _chapters/create-a-new-reactjs-app.md %}) we used the SST [`ReactStaticSite`]({{ site.v2_url }}/constructs/ReactStaticSite) construct to deploy our React app to AWS.
1515

1616
Netlify allows you to [host your React app for free](https://www.netlify.com/pricing/) and it allows your to `git push` to deploy your apps.
1717

_archives/dynamically-generate-social-share-images-with-serverless.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ And that's it! Our social cards are now dynamically created for all our pages.
764764
765765
### Wrapping Up
766766
767-
You can check out how these images look on [Serverless-Stack.com](/) and on our [Docs site]({{ site.docs_url }}) by sharing a couple of our pages.
767+
You can check out how these images look on [Serverless-Stack.com](/) and on our [Docs site]({{ site.v2_url }}) by sharing a couple of our pages.
768768
769769
Also, make sure to check out the repo that powers our social cards service — [{{ page.repo | remove: "https://" }}]({{ page.repo }})
770770
@@ -774,8 +774,8 @@ The repo is setup with [Seed](https://seed.run), so a `git push` to the `main` b
774774
775775
We used a couple of SST constructs while building this service. You can read more about them here:
776776
777-
- [Api]({{ site.docs_url }}/constructs/Api)
778-
- [Bucket]({{ site.docs_url }}/constructs/Bucket)
779-
- [Function]({{ site.docs_url }}/constructs/Function)
777+
- [Api]({{ site.v2_url }}/constructs/Api)
778+
- [Bucket]({{ site.v2_url }}/constructs/Bucket)
779+
- [Function]({{ site.v2_url }}/constructs/Function)
780780
781781
Hope you enjoyed this chapter. Leave a comment below if you have any questions or feedback!

_archives/setting-serverless-environments-variables-in-a-react-app.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class MyStack extends sst.Stack {
6868
}
6969
```
7070

71-
Here we are using the [`ReactStaticSite`]({{ site.docs_url }}/constructs/ReactStaticSite) construct. It allows us to set React environment variables from our API.
71+
Here we are using the [`ReactStaticSite`]({{ site.v2_url }}/constructs/ReactStaticSite) construct. It allows us to set React environment variables from our API.
7272

7373
```typescript
7474
environment: {
@@ -149,7 +149,7 @@ We need our React app to be deployed with our environment variables. SST uses [C
149149
3. Replace the environment variables in our React app.
150150
4. Deploy our React app to S3 and CloudFront.
151151

152-
[SST](/){:target="_blank"} and the [`ReactStaticSite`]({{ site.docs_url }}/constructs/ReactStaticSite){:target="_blank"} construct do this automatically for you.
152+
[SST](/){:target="_blank"} and the [`ReactStaticSite`]({{ site.v2_url }}/constructs/ReactStaticSite){:target="_blank"} construct do this automatically for you.
153153

154154
![Serverless environment variable set in a React app deployed to AWS](/assets/extra-credit/serverless-environment-variable-set-in-a-react-app-deployed-to-aws.png)
155155

_archives/using-aws-cdk-with-serverless-framework.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In this guide we've looked at two different ways of creating serverless applicat
1616
As in, you can create your infrastructure with SST and manage your Lambda functions and APIs with Serverless Framework. There are a couple of reasons why you might find yourself wanting to do this.
1717

1818
1. Your applications are currently built using Serverless Framework and you want to use [AWS CDK]({% link _archives/what-is-aws-cdk.md %}) instead of [CloudFormation for your resources]({% link _archives/configure-dynamodb-in-serverless.md %}).
19-
2. Or, you are looking to [migrate from Serverless Framework to SST]({{ site.docs_url }}/migrating-from-serverless-framework).
19+
2. Or, you are looking to [migrate from Serverless Framework to SST]({{ site.v2_url }}/migrating-from-serverless-framework).
2020

2121
In this chapter we'll look at how we can use SST to define your infrastructure using CDK and connecting that to our Serverless Framework app.
2222

_archives/using-cognito-to-add-authentication-to-a-serverless-app.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const auth = new sst.Cognito(this, "Auth", {
5858
});
5959
```
6060

61-
This is using the SST [`Cognito`]({{ site.docs_url }}/constructs/Cognito) construct to create a Cognito User Pool and an Identity Pool.
61+
This is using the SST [`Cognito`]({{ site.v2_url }}/constructs/Cognito) construct to create a Cognito User Pool and an Identity Pool.
6262

6363
#### Aliases
6464

@@ -99,7 +99,7 @@ new Cognito(this, "Auth", {
9999

100100
#### Cognito Triggers
101101

102-
You also might want to trigger (before and after authentication) some actions. The [Cognito Triggers]({{ site.docs_url }}/constructs/Cognito#authuserpooltriggers) allow you to define Lambda functions that get executed for specific events.
102+
You also might want to trigger (before and after authentication) some actions. The [Cognito Triggers]({{ site.v2_url }}/constructs/Cognito#authuserpooltriggers) allow you to define Lambda functions that get executed for specific events.
103103

104104
```js
105105
new Cognito(this, "Auth", {
@@ -114,7 +114,7 @@ new Cognito(this, "Auth", {
114114

115115
### Adding an API
116116

117-
Now let's look at how we can use Cognito to secure our API. In [`stacks/MyStack.js`]({{ repo_url }}/stacks/MyStack.js) of our example, you'll notice our SST [`Api`]({{ site.docs_url }}/constructs/Api) definition.
117+
Now let's look at how we can use Cognito to secure our API. In [`stacks/MyStack.js`]({{ repo_url }}/stacks/MyStack.js) of our example, you'll notice our SST [`Api`]({{ site.v2_url }}/constructs/Api) definition.
118118

119119
```js
120120
// Create an HTTP API
@@ -163,7 +163,7 @@ export async function handler() {
163163

164164
### Adding a React Static Site
165165

166-
We can now turn our attention to the frontend part of our application. In [`stacks/MyStack.js`]({{ repo_url }}/stacks/MyStack.js) take a look at the SST [`ReactStaticSite`]({{ site.docs_url }}/constructs/ReactStaticSite) definition.
166+
We can now turn our attention to the frontend part of our application. In [`stacks/MyStack.js`]({{ repo_url }}/stacks/MyStack.js) take a look at the SST [`ReactStaticSite`]({{ site.v2_url }}/constructs/ReactStaticSite) definition.
167167

168168
```js
169169
// Deploy our React app
@@ -555,7 +555,7 @@ Make sure to check out the rest of the [`frontend/src/App.js`]({{ repo_url }}/fr
555555

556556
### Testing our App
557557

558-
SST features a [Live Lambda Development]({{ site.docs_url }}/live-lambda-development) environment that allows you to work on your serverless apps live.
558+
SST features a [Live Lambda Development]({{ site.v2_url }}/live-lambda-development) environment that allows you to work on your serverless apps live.
559559

560560
To test our [example]({{ repo_url }}):
561561

_archives/what-is-aws-appsync.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ Data sources in AWS AppSync are services, databases, or APIs that hold the data
110110

111111
There are just a handful of data sources that AWS AppSync supports, such as [Amazon DynamoDB](https://aws.amazon.com/dynamodb/), [AWS Lambda](https://aws.amazon.com/lambda/) (Lambda can allow you to use other options, such as RDS or ElastiCache), and [Amazon Elasticsearch Service](https://aws.amazon.com/elasticsearch-service/).
112112

113-
SST’s [`AppSyncApi` construct]({{ site.docs_url }}/constructs/AppSyncApi#examples) makes creating data sources a lot easier. We'll be looking at some examples of how to do this below.
113+
SST’s [`AppSyncApi` construct]({{ site.v2_url }}/constructs/AppSyncApi#examples) makes creating data sources a lot easier. We'll be looking at some examples of how to do this below.
114114

115115
You’ll need data sources whenever you need to fetch and manipulate data. However, in some cases where you might only want to perform data transformation with resolvers and subscriptions to be invoked by a mutation, you might not need a data source.
116116

117-
Using the [SST `AppSyncApi`]({{ site.docs_url }}/constructs/AppSyncApi), you could add a data source to your GraphQL API easily without having to log in to your AWS console.
117+
Using the [SST `AppSyncApi`]({{ site.v2_url }}/constructs/AppSyncApi), you could add a data source to your GraphQL API easily without having to log in to your AWS console.
118118

119119
```js
120120
import { AppSyncApi } from "@serverless-stack/resources";

_chapters/add-an-api-to-create-a-note.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ api.route("POST /notes", "packages/functions/src/create.main");
3535

3636
We are doing a couple of things of note here.
3737

38-
- We are creating an API using SST's [`Api`]({{ site.ion_url }}/docs/component/apigatewayv2/){:target="_blank"} component. It creates an [Amazon API Gateway HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html){:target="_blank"}.
38+
- We are creating an API using SST's [`Api`]({{ site.sst_url }}/docs/component/apigatewayv2/){:target="_blank"} component. It creates an [Amazon API Gateway HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html){:target="_blank"}.
3939

40-
- We are [linking]({{ site.ion_url }}/docs/linking/){:target="_blank"} our DynamoDB table to our API using the `link` prop. This will allow our API to access our table.
40+
- We are [linking]({{ site.sst_url }}/docs/linking/){:target="_blank"} our DynamoDB table to our API using the `link` prop. This will allow our API to access our table.
4141

4242
- The first route we are adding to our API is the `POST /notes` route. It'll be used to create a note.
4343

@@ -109,7 +109,7 @@ There are some helpful comments in the code but let's go over them quickly.
109109
- Parse the input from the `event.body`. This represents the HTTP request body.
110110
- It contains the contents of the note, as a string — `content`.
111111
- It also contains an `attachment`, if one exists. It's the filename of a file that will be uploaded to [our S3 bucket]({% link _chapters/create-an-s3-bucket-in-sst.md %}).
112-
- We can access our linked DynamoDB table through `Resource.Notes.name` using the [SST SDK]({{ site.ion_url }}/docs/reference/sdk/){:target="_blank"}. Here, `Notes` in `Resource.Notes`, is the name of our Table component from the [Create a DynamoDB Table in SST]({% link _chapters/create-a-dynamodb-table-in-sst.md %}) chapter. By doing `link: [table]` earlier in this chapter, we are allowing our API to access our table.
112+
- We can access our linked DynamoDB table through `Resource.Notes.name` using the [SST SDK]({{ site.sst_url }}/docs/reference/sdk/){:target="_blank"}. Here, `Notes` in `Resource.Notes`, is the name of our Table component from the [Create a DynamoDB Table in SST]({% link _chapters/create-a-dynamodb-table-in-sst.md %}) chapter. By doing `link: [table]` earlier in this chapter, we are allowing our API to access our table.
113113
- The `userId` is the id for the author of the note. For now we are hardcoding it to `123`. Later we'll be setting this based on the authenticated user.
114114
- Make a call to DynamoDB to put a new object with a generated `noteId` and the current date as the `createdAt`.
115115
- And if the DynamoDB call fails then return an error with the HTTP status code `500`.

_chapters/adding-auth-to-our-serverless-app.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ comments_id: adding-auth-to-our-serverless-app/2457
1313

1414
So far we've created the [DynamoDB table]({% link _chapters/create-a-dynamodb-table-in-sst.md %}), [S3 bucket]({% link _chapters/create-an-s3-bucket-in-sst.md %}), and [API]({% link _chapters/add-an-api-to-create-a-note.md %}) parts of our serverless backend. Now let's add auth into the mix. As we talked about in the [previous chapter]({% link _chapters/auth-in-serverless-apps.md %}), we are going to use [Cognito User Pool](https://aws.amazon.com/cognito/){:target="_blank"} to manage user sign ups and logins. While we are going to use [Cognito Identity Pool](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html){:target="_blank"} to manage which resources our users have access to.
1515

16-
Setting this all up can be pretty complicated in Terraform. SST has simple [`CognitoUserPool`]({{ site.ion_url }}/docs/component/aws/cognito-user-pool/){:target="_blank"} and [`CognitoIdentityPool`]({{ site.ion_url }}/docs/component/aws/cognito-identity-pool/){:target="_blank"} components to help with this.
16+
Setting this all up can be pretty complicated in Terraform. SST has simple [`CognitoUserPool`]({{ site.sst_url }}/docs/component/aws/cognito-user-pool/){:target="_blank"} and [`CognitoIdentityPool`]({{ site.sst_url }}/docs/component/aws/cognito-identity-pool/){:target="_blank"} components to help with this.
1717

1818
### Create the Components
1919

_chapters/create-a-dynamodb-table-in-sst.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const table = new sst.aws.Dynamo("Notes", {
2828

2929
Let's go over what we are doing here.
3030

31-
We are using the [`Dynamo`]({{ site.ion_url }}/docs/component/aws/dynamo/){:target="_blank"} component to create our DynamoDB table.
31+
We are using the [`Dynamo`]({{ site.sst_url }}/docs/component/aws/dynamo/){:target="_blank"} component to create our DynamoDB table.
3232

3333
It has two fields:
3434

_chapters/create-a-hello-world-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Let's go ahead and deploy this.
6363

6464
### Start Your Dev Environment
6565

66-
We'll do this by starting up our local development environment. SST's dev environment runs your functions [Live]({{ site.ion_url }}/docs/live){:target="_blank"}. It allows you to work on your serverless apps live.
66+
We'll do this by starting up our local development environment. SST's dev environment runs your functions [Live]({{ site.sst_url }}/docs/live){:target="_blank"}. It allows you to work on your serverless apps live.
6767

6868
{%change%} Start your dev environment.
6969

_chapters/create-a-new-reactjs-app.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ build: {
5757

5858
### Add the React App to SST
5959

60-
We are going to be deploying our React app to AWS. To do that we'll be using the SST [`StaticSite`]({{ site.ion_url }}/docs/component/aws/static-site/){:target="_blank"} component.
60+
We are going to be deploying our React app to AWS. To do that we'll be using the SST [`StaticSite`]({{ site.sst_url }}/docs/component/aws/static-site/){:target="_blank"} component.
6161

6262
{%change%} Create a new file in `infra/web.ts` and add the following.
6363

_chapters/create-an-s3-bucket-in-sst.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Recall the following from `infra/storage.ts`.
1818
export const bucket = new sst.aws.Bucket("Uploads");
1919
```
2020

21-
Here we are creating a new S3 bucket using the SST [`Bucket`]({{ site.ion_url }}/docs/component/aws/bucket){:target="_blank"} component.
21+
Here we are creating a new S3 bucket using the SST [`Bucket`]({{ site.sst_url }}/docs/component/aws/bucket){:target="_blank"} component.
2222

2323
### Commit the Changes
2424

_chapters/create-an-sst-app.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default $config({
7474
To rename an app, you’ll need to remove the resources from the old one and deploy to the new one.
7575
{%endcaution%}
7676

77-
The name of your app as you might recall is `notes`. A word of caution on IaC, if you rename your app after you deploy it, it doesn't rename the previously created resources in your app. You'll need to remove your old app and redeploy it again with the new name. To get a better sense of this, you can read more about the [SST workflow]({{ site.ion_url }}/docs/workflow){:target="_blank"}.
77+
The name of your app as you might recall is `notes`. A word of caution on IaC, if you rename your app after you deploy it, it doesn't rename the previously created resources in your app. You'll need to remove your old app and redeploy it again with the new name. To get a better sense of this, you can read more about the [SST workflow]({{ site.sst_url }}/docs/workflow){:target="_blank"}.
7878

7979
## Project layout
8080

_chapters/creating-a-ci-cd-pipeline-for-serverless.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Our workflow is fairly simple. But as your team grows, you'll need to add additi
4444

4545
There are many common CI/CD services, like [GitHub Actions](https://github.com/features/actions){:target="_blank"}, [Travis CI](https://travis-ci.org){:target="_blank"} or [CircleCI](https://circleci.com){:target="_blank"}. These usually require you to manually configure the above pipeline. It involves a fair bit of scripts and configuration.
4646

47-
SST makes this easier with the [SST Console]({{ site.ion_url }}/docs/console/){:target="_blank"}'s [Autodeploy](/docs/console/#autodeploy){:target="_blank"} feature. It also shows you all the resources in your app and allows you to monitor and debug them.
47+
SST makes this easier with the [SST Console]({{ site.sst_url }}/docs/console/){:target="_blank"}'s [Autodeploy](/docs/console/#autodeploy){:target="_blank"} feature. It also shows you all the resources in your app and allows you to monitor and debug them.
4848

4949
We should mention that you don't have to use the SST Console. And this section is completely optional.
5050

_chapters/custom-domains-in-serverless-apis.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This tells SST that we want to use a custom domain **if** we are deploying to th
2323

2424
We could for example, base it on the stage name, `api-${app.stage}.my-serverless-app.com`. So for `dev` it might be `api-dev.my-serverless-app.com`. But we'll leave that as an exercise for you.
2525

26-
The `$app` is a global variable that's available in our config. You can [learn more about it here]({{ site.ion_url }}/docs/reference/global/#app){:target="_blank"}.
26+
The `$app` is a global variable that's available in our config. You can [learn more about it here]({{ site.sst_url }}/docs/reference/global/#app){:target="_blank"}.
2727

2828
### Deploy the App
2929

_chapters/further-reading.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ comments_id: further-reading/209
1010

1111
Once you've completed the guide, you are probably going to use SST for your next project. To help you along the way we try to compile a list of docs that you can use as a reference. The following can be used to drill down in detail for some of the technologies and services used in this guide.
1212

13-
- [SST Documentation]({{ site.ion_url }}): Documentation for SST
13+
- [SST Documentation]({{ site.sst_url }}/docs/): Documentation for SST
1414

1515
- [DynamoDB, explained](https://www.dynamodbguide.com): A Primer on the DynamoDB NoSQL database
1616

@@ -26,6 +26,6 @@ Once you've completed the guide, you are probably going to use SST for your next
2626

2727
- [Vitest Docs](https://vitest.dev/guide/): The official Vitest docs
2828

29-
- [SST Console Docs]({{ site.ion_url }}/docs/console/): The SST Console docs
29+
- [SST Console Docs]({{ site.sst_url }}/docs/console/): The SST Console docs
3030

3131
If you have found any other guides or tutorials helpful in building your serverless app, feel free to edit this page and submit a PR. Or you can let us know via the comments.

_chapters/handle-cors-in-s3-for-file-uploads.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ comments_id: handle-cors-in-s3-for-file-uploads/2174
1010

1111
In the notes app we are building, users will be uploading files to the bucket we just created. And since our app will be served through our custom domain, it'll be communicating across domains while it does the uploads. By default, S3 does not allow its resources to be accessed from a different domain. However, [cross-origin resource sharing (CORS)](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing){:target="_blank"} defines a way for client web applications that are loaded in one domain to interact with resources in a different domain.
1212

13-
Similar to the [previous chapter]({% link _chapters/handle-cors-in-serverless-apis.md %}), the [`Bucket`]({{ site.ion_url }}/docs/component/aws/bucket/){:target="_blank"} component enables CORS by default.
13+
Similar to the [previous chapter]({% link _chapters/handle-cors-in-serverless-apis.md %}), the [`Bucket`]({{ site.sst_url }}/docs/component/aws/bucket/){:target="_blank"} component enables CORS by default.
1414

1515
```ts
1616
new sst.aws.Bucket("Uploads", {
@@ -19,7 +19,7 @@ new sst.aws.Bucket("Uploads", {
1919
});
2020
```
2121

22-
You can configure this further. [Read more about this here]({{ site.ion_url }}/docs/component/aws/bucket#cors){:target="_blank"}.
22+
You can configure this further. [Read more about this here]({{ site.sst_url }}/docs/component/aws/bucket#cors){:target="_blank"}.
2323

2424
```ts
2525
new sst.aws.Bucket("Uploads", {

_chapters/handle-cors-in-serverless-apis.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ And our browser won't show us the HTTP response. This can make debugging our API
4646

4747
### CORS in API Gateway
4848

49-
The [`ApiGatewayV2`]({{ site.ion_url }}/docs/component/aws/apigatewayv2/){:target="_blank"} component that we are using enables CORS by default.
49+
The [`ApiGatewayV2`]({{ site.sst_url }}/docs/component/aws/apigatewayv2/){:target="_blank"} component that we are using enables CORS by default.
5050

5151
```ts
5252
new sst.aws.ApiGatewayV2("Api", {
@@ -55,7 +55,7 @@ new sst.aws.ApiGatewayV2("Api", {
5555
});
5656
```
5757

58-
You can further configure the specifics if necessary. You can [read more about this here]({{ site.ion_url }}/docs/component/aws/apigatewayv2#cors){:target="_blank"}.
58+
You can further configure the specifics if necessary. You can [read more about this here]({{ site.sst_url }}/docs/component/aws/apigatewayv2#cors){:target="_blank"}.
5959

6060
```typescript
6161
new sst.aws.ApiGatewayV2("Api", {

0 commit comments

Comments
 (0)