Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 3fab0f0

Browse files
add aws website documentation
1 parent ed98a97 commit 3fab0f0

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

docs/providers/pulumi/aws.mdx

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ The Nitric team is working to expand the list of resources that can be imported.
9696
- [Buckets](/storage)
9797

9898
<Note>
99-
Currently, only resources in the same AWS account and region as the Nitric project
100-
are supported.
99+
Currently, only resources in the same AWS account and region as the Nitric
100+
project are supported.
101101
</Note>
102102

103103
### Buckets
@@ -142,8 +142,8 @@ import:
142142
```
143143

144144
<Note>
145-
Unlike some other imported resources, secret imports require the ARN to be used.
146-
Providing only the secret's name will be invalid.
145+
Unlike some other imported resources, secret imports require the ARN to be
146+
used. Providing only the secret's name will be invalid.
147147
</Note>
148148

149149
Need to import another resource type or have another question? Chat with us on [Discord](https://nitric.io/chat) or [open an issue](https://github.com/nitrictech/nitric/issues) on GitHub.
@@ -190,6 +190,13 @@ apis:
190190
- api.example.com
191191
description: An AWS API
192192
193+
# Apply configuration for nitric websites
194+
cdn:
195+
# A valid domain or subdomain for the CloudFront Distribution to use for the deployed websites endpoint
196+
domain: cdn.example.com
197+
# Skip CDN cache invalidation during deployments (defaults to false)
198+
skip-cache-invalidation: true
199+
193200
# Configure your deployed services
194201
config:
195202
# How services without a type will be deployed
@@ -228,6 +235,41 @@ config:
228235
provisioned-concurrency: 1
229236
```
230237
238+
### Websites
239+
240+
When deploying [websites](/websites), Nitric will create a CloudFront Distribution that automatically provides a public URL for your website. This URL is not suitable for production use, and you should configure a custom domain for your website.
241+
242+
The Hosted Zone used to configure the custom domain must be created in Route53 before deploying your CloudFront distribution with a custom domain configuration.
243+
244+
- Purchase/Register a domain name with your domain registrar of choice.
245+
- Navigate to https://us-east-1.console.aws.amazon.com/route53/v2/hostedzones in your Azure Portal
246+
- Click `Create hosted zone`
247+
- Enter a `Domain name` of your choice, this should be the domain name you purchased i.e. example.com
248+
- Select Public Hosted Zone
249+
- Click `Create hosted zone`
250+
- Once the Hosted Zone is created, click on the `Go to resource` button
251+
252+
Now that the Hosted Zone is created, you need to configure your registrar (domain) or existing DNS (subdomain) to point at the new name servers created for the zone.
253+
254+
The configuration details are available on the `Records` tab within the `Hosted Zone` page. This step is different depending on your chosen domain registrar. Below are some general steps depending on whether your configuring the primary domain or a subdomain.
255+
256+
#### Domain
257+
258+
Your registrar (e.g. Namecheap, GoDaddy, Cloudflare, etc.) will allow you to change the name servers for you domain, sometimes this is called 'Custom DNS'. Add each of the name servers (NS records) from the Registrar setup dialog in the relevant config page for your registrar.
259+
260+
#### Subdomain
261+
262+
If you're configuring a subdomain e.g. app.yourdomain.com, you can simply add the NS records to your existing DNS configuration for the chosen subdomain. Typically, the config will look something like this:
263+
264+
<Note>Substitute your values for `Nameserver`</Note>
265+
266+
| Record Type | Nameserver |
267+
| ----------- | ----------------------- |
268+
| NS Record | ns-001.awsdns-60.net. |
269+
| NS Record | ns-002.awsdns-49.co.uk. |
270+
| NS Record | ns-003.awsdns-24.org. |
271+
| NS Record | ns-004.awsdns-34.com. |
272+
231273
<Note>
232274
Missing something? Let us know by raising an issue in
233275
[GitHub](https://github.com/nitrictech/nitric) or by dropping us a line on

0 commit comments

Comments
 (0)