Skip to content

AWS DNS Adapter

Reference doc for the `sst.aws.dns` adapter.

The AWS DNS Adapter is used to create DNS records to manage domains hosted on Route 53.

This adapter is passed in as domain.dns when setting a custom domain.

{
domain: {
name: "example.com",
dns: sst.aws.dns()
}
}

You can also specify a hosted zone ID if you have multiple hosted zones with the same domain.

{
domain: {
name: "example.com",
dns: sst.aws.dns({
zone: "Z2FDTNDATAQYW2"
})
}
}

Functions

dns

dns(args?)

Parameters

Returns Object

DnsArgs

override?

Type Input<boolean>

Default false

Set to true if you want to let the new DNS records replace the existing ones.

This is useful if your domain is currently used by another app and you want to switch it to your current app. Without setting this, you’ll first have to remove the existing DNS records and then add the new one. This can cause downtime.

You can avoid this by setting this to true and the existing DNS records will be replaced without any downtime. Just make sure that when you remove your old app, you don’t remove the DNS records.

{
override: true
}

transform?

Type Object

Transform how this component creates its underlying resources.

transform.record?

Type RecordArgs | (args: RecordArgs, opts: ComponentResourceOptions, name: string) => void

Transform the AWS Route 53 record resource.

zone?

Type Input<string>

Set the hosted zone ID if you have multiple hosted zones that have the same domain in Route 53.

The 14 letter ID of the Route 53 hosted zone that contains the domainName. You can find the hosted zone ID in the Route 53 part of the AWS Console.

{
zone: "Z2FDTNDATAQYW2"
}