Zone

class Zone : KotlinCustomResource

Manages a Route53 Hosted Zone. For managing Domain Name System Security Extensions (DNSSEC), see the aws.route53.KeySigningKey and aws.route53.HostedZoneDnsSec resources.

Example Usage

Public Zone

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.Zone;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var primary = new Zone("primary");
}
}

Public Subdomain Zone

For use in subdomains, note that you need to create a aws.route53.Record of type NS as well as the subdomain zone.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.Zone;
import com.pulumi.aws.route53.ZoneArgs;
import com.pulumi.aws.route53.Record;
import com.pulumi.aws.route53.RecordArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var main = new Zone("main");
var dev = new Zone("dev", ZoneArgs.builder()
.tags(Map.of("Environment", "dev"))
.build());
var dev_ns = new Record("dev-ns", RecordArgs.builder()
.zoneId(main.zoneId())
.name("dev.example.com")
.type("NS")
.ttl("30")
.records(dev.nameServers())
.build());
}
}

Private Zone

NOTE: This provider provides both exclusive VPC associations defined in-line in this resource via vpc configuration blocks and a separate Zone VPC Association resource. At this time, you cannot use in-line VPC associations in conjunction with any aws.route53.ZoneAssociationresources with the same zone ID otherwise it will cause a perpetual difference in plan output. You can optionally use [ignoreChanges](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to manage additional associations via the aws.route53.ZoneAssociation` resource. NOTE: Private zones require at least one VPC association at all times.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.route53.Zone;
import com.pulumi.aws.route53.ZoneArgs;
import com.pulumi.aws.route53.inputs.ZoneVpcArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var private_ = new Zone("private", ZoneArgs.builder()
.vpcs(ZoneVpcArgs.builder()
.vpcId(aws_vpc.example().id())
.build())
.build());
}
}

Import

Route53 Zones can be imported using the zone id, e.g.,

$ pulumi import aws:route53/zone:Zone myzone Z1D633PJN98FT9

Properties

Link copied to clipboard
val arn: Output<String>

The Amazon Resource Name (ARN) of the Hosted Zone.

Link copied to clipboard
val comment: Output<String>

A comment for the hosted zone. Defaults to 'Managed by Pulumi'.

Link copied to clipboard
val delegationSetId: Output<String>?

The ID of the reusable delegation set whose NS records you want to assign to the hosted zone. Conflicts with vpc as delegation sets can only be used for public zones.

Link copied to clipboard
val forceDestroy: Output<Boolean>?

Whether to destroy all records (possibly managed outside of this provider) in the zone when destroying the zone.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

This is the name of the hosted zone.

Link copied to clipboard
val nameServers: Output<List<String>>

A list of name servers in associated (or default) delegation set. Find more about delegation sets in AWS docs.

Link copied to clipboard

The Route 53 name server that created the SOA record.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the zone. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vpcs: Output<List<ZoneVpc>>?

Configuration block(s) specifying VPC(s) to associate with a private hosted zone. Conflicts with the delegation_set_id argument in this resource and any aws.route53.ZoneAssociation resource specifying the same zone ID. Detailed below.

Link copied to clipboard
val zoneId: Output<String>

The Hosted Zone ID. This can be referenced by zone records.