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

Commit 2ecd621

Browse files
docs(aws): add aws websites and domain configuration documentation (#739)
1 parent ab482fb commit 2ecd621

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

docs/providers/pulumi/aws.mdx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ apis:
189189
- api.example.com
190190
description: An AWS API
191191
192+
# Apply configuration for nitric websites
193+
cdn:
194+
# A valid domain or subdomain for the CloudFront Distribution to use for the deployed websites endpoint
195+
domain: cdn.example.com
196+
# Skip CDN cache invalidation during deployments (defaults to false)
197+
skip-cache-invalidation: true
198+
192199
# Configure your deployed services
193200
config:
194201
# How services without a type will be deployed
@@ -227,6 +234,41 @@ config:
227234
provisioned-concurrency: 1
228235
```
229236
237+
### Websites
238+
239+
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.
240+
241+
The Hosted Zone used to configure the custom domain must be created in Route53 before deploying your CloudFront distribution with a custom domain configuration.
242+
243+
- Purchase/Register a domain name with your domain registrar of choice.
244+
- Navigate to https://us-east-1.console.aws.amazon.com/route53/v2/hostedzones in your Azure Portal
245+
- Click `Create hosted zone`
246+
- Enter a `Domain name` of your choice, this should be the domain name you purchased i.e. example.com
247+
- Select Public Hosted Zone
248+
- Click `Create hosted zone`
249+
- Once the Hosted Zone is created, click on the `Go to resource` button
250+
251+
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.
252+
253+
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.
254+
255+
#### Domain
256+
257+
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.
258+
259+
#### Subdomain
260+
261+
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:
262+
263+
<Note>Substitute your values for `Nameserver`</Note>
264+
265+
| Record Type | Nameserver |
266+
| ----------- | ----------------------- |
267+
| NS Record | ns-001.awsdns-60.net. |
268+
| NS Record | ns-002.awsdns-49.co.uk. |
269+
| NS Record | ns-003.awsdns-24.org. |
270+
| NS Record | ns-004.awsdns-34.com. |
271+
230272
<Note>
231273
Missing something? Let us know by raising an issue in
232274
[GitHub](https://github.com/nitrictech/nitric) or by dropping us a line on

docs/providers/terraform/aws.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ apis:
155155
domains:
156156
- api.example.com
157157
158+
# Apply configuration for nitric websites
159+
cdn:
160+
# A valid domain or subdomain for the CloudFront Distribution to use for the deployed websites endpoint
161+
domain: cdn.example.com
162+
# Skip CDN cache invalidation during deployments (defaults to false)
163+
skip-cache-invalidation: true
164+
158165
# Configure your deployed services
159166
config:
160167
# How services without a type will be deployed

0 commit comments

Comments
 (0)