ZoneArgs

data class ZoneArgs(val comment: Output<String>? = null, val delegationSetId: Output<String>? = null, val forceDestroy: Output<Boolean>? = null, val name: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val vpcs: Output<List<ZoneVpcArgs>>? = null) : ConvertibleToJava<ZoneArgs>

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const primary = new aws.route53.Zone("primary", {name: "example.com"});
import pulumi
import pulumi_aws as aws
primary = aws.route53.Zone("primary", name="example.com")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var primary = new Aws.Route53.Zone("primary", new()
{
Name = "example.com",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := route53.NewZone(ctx, "primary", &route53.ZoneArgs{
Name: pulumi.String("example.com"),
})
if err != nil {
return err
}
return nil
})
}
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 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", ZoneArgs.builder()
.name("example.com")
.build());
}
}
resources:
primary:
type: aws:route53:Zone
properties:
name: example.com

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.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const main = new aws.route53.Zone("main", {name: "example.com"});
const dev = new aws.route53.Zone("dev", {
name: "dev.example.com",
tags: {
Environment: "dev",
},
});
const dev_ns = new aws.route53.Record("dev-ns", {
zoneId: main.zoneId,
name: "dev.example.com",
type: aws.route53.RecordType.NS,
ttl: 30,
records: dev.nameServers,
});
import pulumi
import pulumi_aws as aws
main = aws.route53.Zone("main", name="example.com")
dev = aws.route53.Zone("dev",
name="dev.example.com",
tags={
"Environment": "dev",
})
dev_ns = aws.route53.Record("dev-ns",
zone_id=main.zone_id,
name="dev.example.com",
type=aws.route53.RecordType.NS,
ttl=30,
records=dev.name_servers)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var main = new Aws.Route53.Zone("main", new()
{
Name = "example.com",
});
var dev = new Aws.Route53.Zone("dev", new()
{
Name = "dev.example.com",
Tags =
{
{ "Environment", "dev" },
},
});
var dev_ns = new Aws.Route53.Record("dev-ns", new()
{
ZoneId = main.ZoneId,
Name = "dev.example.com",
Type = Aws.Route53.RecordType.NS,
Ttl = 30,
Records = dev.NameServers,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
main, err := route53.NewZone(ctx, "main", &route53.ZoneArgs{
Name: pulumi.String("example.com"),
})
if err != nil {
return err
}
dev, err := route53.NewZone(ctx, "dev", &route53.ZoneArgs{
Name: pulumi.String("dev.example.com"),
Tags: pulumi.StringMap{
"Environment": pulumi.String("dev"),
},
})
if err != nil {
return err
}
_, err = route53.NewRecord(ctx, "dev-ns", &route53.RecordArgs{
ZoneId: main.ZoneId,
Name: pulumi.String("dev.example.com"),
Type: pulumi.String(route53.RecordTypeNS),
Ttl: pulumi.Int(30),
Records: dev.NameServers,
})
if err != nil {
return err
}
return nil
})
}
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", ZoneArgs.builder()
.name("example.com")
.build());
var dev = new Zone("dev", ZoneArgs.builder()
.name("dev.example.com")
.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());
}
}
resources:
main:
type: aws:route53:Zone
properties:
name: example.com
dev:
type: aws:route53:Zone
properties:
name: dev.example.com
tags:
Environment: dev
dev-ns:
type: aws:route53:Record
properties:
zoneId: ${main.zoneId}
name: dev.example.com
type: NS
ttl: '30'
records: ${dev.nameServers}

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.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const _private = new aws.route53.Zone("private", {
name: "example.com",
vpcs: [{
vpcId: example.id,
}],
});
import pulumi
import pulumi_aws as aws
private = aws.route53.Zone("private",
name="example.com",
vpcs=[{
"vpc_id": example["id"],
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var @private = new Aws.Route53.Zone("private", new()
{
Name = "example.com",
Vpcs = new[]
{
new Aws.Route53.Inputs.ZoneVpcArgs
{
VpcId = example.Id,
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := route53.NewZone(ctx, "private", &route53.ZoneArgs{
Name: pulumi.String("example.com"),
Vpcs: route53.ZoneVpcArray{
&route53.ZoneVpcArgs{
VpcId: pulumi.Any(example.Id),
},
},
})
if err != nil {
return err
}
return nil
})
}
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()
.name("example.com")
.vpcs(ZoneVpcArgs.builder()
.vpcId(example.id())
.build())
.build());
}
}
resources:
private:
type: aws:route53:Zone
properties:
name: example.com
vpcs:
- vpcId: ${example.id}

Import

Using pulumi import, import Route53 Zones using the zone id. For example:

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

Constructors

Link copied to clipboard
constructor(comment: Output<String>? = null, delegationSetId: Output<String>? = null, forceDestroy: Output<Boolean>? = null, name: Output<String>? = null, tags: Output<Map<String, String>>? = null, vpcs: Output<List<ZoneVpcArgs>>? = null)

Properties

Link copied to clipboard
val comment: Output<String>? = null

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

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

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>? = null

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

Link copied to clipboard
val name: Output<String>? = null

This is the name of the hosted zone.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

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 vpcs: Output<List<ZoneVpcArgs>>? = null

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.

Functions

Link copied to clipboard
open override fun toJava(): ZoneArgs