Skip to content

Commit

Permalink
docs: autodeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jayair committed Aug 19, 2024
1 parent 7918a11 commit 7bec9f7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 25 deletions.
5 changes: 5 additions & 0 deletions platform/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ export interface Target {
* - `small`: 4 GB, 2 vCPUs
* - `large`: 8 GB, 4 vCPUs
*
* To increase the memory used by your Node.js process in the build environment, you'll want
* to set the `NODE_OPTIONS` environment variable to `--max-old-space-size=xyz`. Where `xyz`
* is the memory size in MB. By default, this is set to 1.5 GB.
*
* Read more about the [CodeBuild build environments](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html).
*
* @default `small`
*/
compute?: "small" | "medium" | "large" | "xlarge";
Expand Down
5 changes: 3 additions & 2 deletions www/src/content/docs/docs/component/aws/router.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ request is routed to.
The `/*` route is a default or catch-all route.
:::
The `/*` route is a _default_ route, meaning that if no routes match, the `/*` route will be used. It does not matter where the `/*` route is listed in the routes object.
The `/*` route is a _default_ route, meaning that if no routes match, the `/*` route will be used. It does not matter where the `/*` route is listed in the routes object.
:::note
If you don't have a `/*` route, you'll get a 404 error for any requests that don't match a route.
Expand All @@ -431,12 +431,13 @@ Suppose you have the following three routes.
"/api/*.json": "https://example1.com",
"/api/*": "https://example2.com",
"/*.xml": "https://example3.com",
}
}
```
A request to `/api/sample.xml` will match `/api/*` first and route to it; even though it matches `/*.xml`.
However for this case, a request to `/api/users` will route to `/api/*` even though it comes after `/*`. This is because the `/*` route is the default route.
However for this case, a request to `/api/users` will route to `/api/*` even though it comes after `/*`. This is because the `/*` route is the default route.
```js
{
Expand Down
44 changes: 21 additions & 23 deletions www/src/content/docs/docs/component/aws/vpc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,28 @@ import InlineSection from '../../../../../../src/components/tsdoc/InlineSection.
The `Vpc` component lets you add a VPC to your app. It uses [Amazon VPC](https://docs.aws.amazon.com/vpc/). This is useful for services like RDS and Fargate that need to be hosted inside
a VPC.

Let's see look at a few common use cases for VPC and how to create them.

#### Default setup

```ts title="sst.config.ts"
new sst.aws.Vpc("MyVPC");
```

This creates a VPC with 1 Availability Zones by default. It creates the following
This creates a VPC with 2 Availability Zones by default. It also creates the following
resources:

1. A VPC with CIDR block `10.0.0.0/16`.
2. A security group blocking all incoming internet traffic.
3. A public subnet with CIDR block `10.0.1.0/24`
4. A private subnet with CIDR block `10.0.2.0/24`.
5. An Internet Gateway. All the traffic from the public subnets are routed through it.

This setup is useful for services like Fargate where containers are deployed in the
public subnet.
1. A default security group blocking all incoming internet traffic.
2. A public subnet in each AZ.
3. A private subnet in each AZ.
4. An Internet Gateway. All the traffic from the public subnets are routed through it.
5. If `nat` is enabled, a NAT Gateway in each AZ. All the traffic from the private subnets
are routed to the NAT Gateway in the same AZ.

:::note
By default, this creates two NAT Gateways, one in each AZ. And it roughly costs $33 per
NAT Gateway per month.
By default, this does not create NAT Gateways.
:::

NAT Gateways are billed per hour and per gigabyte of data processed. By default,
this creates a NAT Gateway in each AZ. And this would be roughly $33 per NAT
Gateway per month. Make sure to [review the pricing](https://aws.amazon.com/vpc/pricing/).

NAT Gateways are billed per hour and per gigabyte of data processed. Each NAT Gateway
roughly costs $33 per month. Make sure to [review the pricing](https://aws.amazon.com/vpc/pricing/).

#### Create a VPC

```ts title="sst.config.ts"
new sst.aws.Vpc("MyVPC");
```

#### Create it with 3 Availability Zones

Expand All @@ -56,6 +46,14 @@ new sst.aws.Vpc("MyVPC", {
az: 3
});
```

#### Enable NAT

```ts title="sst.config.ts" {2}
new sst.aws.Vpc("MyVPC", {
nat: "managed"
});
```
</Section>

---
Expand Down
4 changes: 4 additions & 0 deletions www/src/content/docs/docs/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,10 @@ For `arm64` architecture, only `small` and `large` are supported:
- `small`: 4 GB, 2 vCPUs
- `large`: 8 GB, 4 vCPUs

To increase the memory used by your Node.js process in the build environment, you'll want
to set the `NODE_OPTIONS` environment variable to `--max-old-space-size=xyz`. Where `xyz`
is the memory size in MB. By default, this is set to 1.5 GB.

Read more about the [CodeBuild build environments](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html).

</Segment>
Expand Down

0 comments on commit 7bec9f7

Please sign in to comment.