Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.30.0 published on Tuesday, Nov 30, 2021 by Pulumi

Record

Provides a Route53 record resource.

Example Usage

Simple routing policy

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var www = new Aws.Route53.Record("www", new Aws.Route53.RecordArgs
        {
            ZoneId = aws_route53_zone.Primary.Zone_id,
            Name = "www.example.com",
            Type = "A",
            Ttl = 300,
            Records = 
            {
                aws_eip.Lb.Public_ip,
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := route53.NewRecord(ctx, "www", &route53.RecordArgs{
			ZoneId: pulumi.Any(aws_route53_zone.Primary.Zone_id),
			Name:   pulumi.String("www.example.com"),
			Type:   pulumi.String("A"),
			Ttl:    pulumi.Int(300),
			Records: pulumi.StringArray{
				pulumi.Any(aws_eip.Lb.Public_ip),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

www = aws.route53.Record("www",
    zone_id=aws_route53_zone["primary"]["zone_id"],
    name="www.example.com",
    type="A",
    ttl=300,
    records=[aws_eip["lb"]["public_ip"]])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const www = new aws.route53.Record("www", {
    zoneId: aws_route53_zone.primary.zone_id,
    name: "www.example.com",
    type: "A",
    ttl: "300",
    records: [aws_eip.lb.public_ip],
});

Weighted routing policy

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var www_dev = new Aws.Route53.Record("www-dev", new Aws.Route53.RecordArgs
        {
            ZoneId = aws_route53_zone.Primary.Zone_id,
            Name = "www",
            Type = "CNAME",
            Ttl = 5,
            WeightedRoutingPolicies = 
            {
                new Aws.Route53.Inputs.RecordWeightedRoutingPolicyArgs
                {
                    Weight = 10,
                },
            },
            SetIdentifier = "dev",
            Records = 
            {
                "dev.example.com",
            },
        });
        var www_live = new Aws.Route53.Record("www-live", new Aws.Route53.RecordArgs
        {
            ZoneId = aws_route53_zone.Primary.Zone_id,
            Name = "www",
            Type = "CNAME",
            Ttl = 5,
            WeightedRoutingPolicies = 
            {
                new Aws.Route53.Inputs.RecordWeightedRoutingPolicyArgs
                {
                    Weight = 90,
                },
            },
            SetIdentifier = "live",
            Records = 
            {
                "live.example.com",
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := route53.NewRecord(ctx, "www_dev", &route53.RecordArgs{
			ZoneId: pulumi.Any(aws_route53_zone.Primary.Zone_id),
			Name:   pulumi.String("www"),
			Type:   pulumi.String("CNAME"),
			Ttl:    pulumi.Int(5),
			WeightedRoutingPolicies: route53.RecordWeightedRoutingPolicyArray{
				&route53.RecordWeightedRoutingPolicyArgs{
					Weight: pulumi.Int(10),
				},
			},
			SetIdentifier: pulumi.String("dev"),
			Records: pulumi.StringArray{
				pulumi.String("dev.example.com"),
			},
		})
		if err != nil {
			return err
		}
		_, err = route53.NewRecord(ctx, "www_live", &route53.RecordArgs{
			ZoneId: pulumi.Any(aws_route53_zone.Primary.Zone_id),
			Name:   pulumi.String("www"),
			Type:   pulumi.String("CNAME"),
			Ttl:    pulumi.Int(5),
			WeightedRoutingPolicies: route53.RecordWeightedRoutingPolicyArray{
				&route53.RecordWeightedRoutingPolicyArgs{
					Weight: pulumi.Int(90),
				},
			},
			SetIdentifier: pulumi.String("live"),
			Records: pulumi.StringArray{
				pulumi.String("live.example.com"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

www_dev = aws.route53.Record("www-dev",
    zone_id=aws_route53_zone["primary"]["zone_id"],
    name="www",
    type="CNAME",
    ttl=5,
    weighted_routing_policies=[aws.route53.RecordWeightedRoutingPolicyArgs(
        weight=10,
    )],
    set_identifier="dev",
    records=["dev.example.com"])
www_live = aws.route53.Record("www-live",
    zone_id=aws_route53_zone["primary"]["zone_id"],
    name="www",
    type="CNAME",
    ttl=5,
    weighted_routing_policies=[aws.route53.RecordWeightedRoutingPolicyArgs(
        weight=90,
    )],
    set_identifier="live",
    records=["live.example.com"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const www_dev = new aws.route53.Record("www-dev", {
    zoneId: aws_route53_zone.primary.zone_id,
    name: "www",
    type: "CNAME",
    ttl: "5",
    weightedRoutingPolicies: [{
        weight: 10,
    }],
    setIdentifier: "dev",
    records: ["dev.example.com"],
});
const www_live = new aws.route53.Record("www-live", {
    zoneId: aws_route53_zone.primary.zone_id,
    name: "www",
    type: "CNAME",
    ttl: "5",
    weightedRoutingPolicies: [{
        weight: 90,
    }],
    setIdentifier: "live",
    records: ["live.example.com"],
});

Alias record

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var main = new Aws.Elb.LoadBalancer("main", new Aws.Elb.LoadBalancerArgs
        {
            AvailabilityZones = 
            {
                "us-east-1c",
            },
            Listeners = 
            {
                new Aws.Elb.Inputs.LoadBalancerListenerArgs
                {
                    InstancePort = 80,
                    InstanceProtocol = "http",
                    LbPort = 80,
                    LbProtocol = "http",
                },
            },
        });
        var www = new Aws.Route53.Record("www", new Aws.Route53.RecordArgs
        {
            ZoneId = aws_route53_zone.Primary.Zone_id,
            Name = "example.com",
            Type = "A",
            Aliases = 
            {
                new Aws.Route53.Inputs.RecordAliasArgs
                {
                    Name = main.DnsName,
                    ZoneId = main.ZoneId,
                    EvaluateTargetHealth = true,
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/elb"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := elb.NewLoadBalancer(ctx, "main", &elb.LoadBalancerArgs{
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-east-1c"),
			},
			Listeners: elb.LoadBalancerListenerArray{
				&elb.LoadBalancerListenerArgs{
					InstancePort:     pulumi.Int(80),
					InstanceProtocol: pulumi.String("http"),
					LbPort:           pulumi.Int(80),
					LbProtocol:       pulumi.String("http"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = route53.NewRecord(ctx, "www", &route53.RecordArgs{
			ZoneId: pulumi.Any(aws_route53_zone.Primary.Zone_id),
			Name:   pulumi.String("example.com"),
			Type:   pulumi.String("A"),
			Aliases: route53.RecordAliasArray{
				&route53.RecordAliasArgs{
					Name:                 main.DnsName,
					ZoneId:               main.ZoneId,
					EvaluateTargetHealth: pulumi.Bool(true),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

main = aws.elb.LoadBalancer("main",
    availability_zones=["us-east-1c"],
    listeners=[aws.elb.LoadBalancerListenerArgs(
        instance_port=80,
        instance_protocol="http",
        lb_port=80,
        lb_protocol="http",
    )])
www = aws.route53.Record("www",
    zone_id=aws_route53_zone["primary"]["zone_id"],
    name="example.com",
    type="A",
    aliases=[aws.route53.RecordAliasArgs(
        name=main.dns_name,
        zone_id=main.zone_id,
        evaluate_target_health=True,
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const main = new aws.elb.LoadBalancer("main", {
    availabilityZones: ["us-east-1c"],
    listeners: [{
        instancePort: 80,
        instanceProtocol: "http",
        lbPort: 80,
        lbProtocol: "http",
    }],
});
const www = new aws.route53.Record("www", {
    zoneId: aws_route53_zone.primary.zone_id,
    name: "example.com",
    type: "A",
    aliases: [{
        name: main.dnsName,
        zoneId: main.zoneId,
        evaluateTargetHealth: true,
    }],
});

NS and SOA Record Management

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleZone = new Aws.Route53.Zone("exampleZone", new Aws.Route53.ZoneArgs
        {
        });
        var exampleRecord = new Aws.Route53.Record("exampleRecord", new Aws.Route53.RecordArgs
        {
            AllowOverwrite = true,
            Name = "test.example.com",
            Ttl = 172800,
            Type = "NS",
            ZoneId = exampleZone.ZoneId,
            Records = 
            {
                exampleZone.NameServers.Apply(nameServers => nameServers[0]),
                exampleZone.NameServers.Apply(nameServers => nameServers[1]),
                exampleZone.NameServers.Apply(nameServers => nameServers[2]),
                exampleZone.NameServers.Apply(nameServers => nameServers[3]),
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleZone, err := route53.NewZone(ctx, "exampleZone", nil)
		if err != nil {
			return err
		}
		_, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{
			AllowOverwrite: pulumi.Bool(true),
			Name:           pulumi.String("test.example.com"),
			Ttl:            pulumi.Int(172800),
			Type:           pulumi.String("NS"),
			ZoneId:         exampleZone.ZoneId,
			Records: pulumi.StringArray{
				exampleZone.NameServers.ApplyT(func(nameServers []string) (string, error) {
					return nameServers[0], nil
				}).(pulumi.StringOutput),
				exampleZone.NameServers.ApplyT(func(nameServers []string) (string, error) {
					return nameServers[1], nil
				}).(pulumi.StringOutput),
				exampleZone.NameServers.ApplyT(func(nameServers []string) (string, error) {
					return nameServers[2], nil
				}).(pulumi.StringOutput),
				exampleZone.NameServers.ApplyT(func(nameServers []string) (string, error) {
					return nameServers[3], nil
				}).(pulumi.StringOutput),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example_zone = aws.route53.Zone("exampleZone")
example_record = aws.route53.Record("exampleRecord",
    allow_overwrite=True,
    name="test.example.com",
    ttl=172800,
    type="NS",
    zone_id=example_zone.zone_id,
    records=[
        example_zone.name_servers[0],
        example_zone.name_servers[1],
        example_zone.name_servers[2],
        example_zone.name_servers[3],
    ])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleZone = new aws.route53.Zone("exampleZone", {});
const exampleRecord = new aws.route53.Record("exampleRecord", {
    allowOverwrite: true,
    name: "test.example.com",
    ttl: 172800,
    type: "NS",
    zoneId: exampleZone.zoneId,
    records: [
        exampleZone.nameServers[0],
        exampleZone.nameServers[1],
        exampleZone.nameServers[2],
        exampleZone.nameServers[3],
    ],
});

Create a Record Resource

new Record(name: string, args: RecordArgs, opts?: CustomResourceOptions);
@overload
def Record(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           aliases: Optional[Sequence[RecordAliasArgs]] = None,
           allow_overwrite: Optional[bool] = None,
           failover_routing_policies: Optional[Sequence[RecordFailoverRoutingPolicyArgs]] = None,
           geolocation_routing_policies: Optional[Sequence[RecordGeolocationRoutingPolicyArgs]] = None,
           health_check_id: Optional[str] = None,
           latency_routing_policies: Optional[Sequence[RecordLatencyRoutingPolicyArgs]] = None,
           multivalue_answer_routing_policy: Optional[bool] = None,
           name: Optional[str] = None,
           records: Optional[Sequence[str]] = None,
           set_identifier: Optional[str] = None,
           ttl: Optional[int] = None,
           type: Optional[Union[str, RecordType]] = None,
           weighted_routing_policies: Optional[Sequence[RecordWeightedRoutingPolicyArgs]] = None,
           zone_id: Optional[str] = None)
@overload
def Record(resource_name: str,
           args: RecordArgs,
           opts: Optional[ResourceOptions] = None)
func NewRecord(ctx *Context, name string, args RecordArgs, opts ...ResourceOption) (*Record, error)
public Record(string name, RecordArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RecordArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args RecordArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RecordArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RecordArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Record Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Record resource accepts the following input properties:

Name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
Type string | Pulumi.Aws.Route53.RecordType
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
ZoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
Aliases List<RecordAliasArgs>
An alias block. Conflicts with ttl & records. Alias record documented below.
AllowOverwrite bool
Allow creation of this record to overwrite an existing record, if any. This does not affect the ability to update the record using this provider and does not prevent other resources within this provider or manual Route 53 changes outside this provider from overwriting this record. false by default. This configuration is not recommended for most environments.
FailoverRoutingPolicies List<RecordFailoverRoutingPolicyArgs>
A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.
GeolocationRoutingPolicies List<RecordGeolocationRoutingPolicyArgs>
A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.
HealthCheckId string
The health check the record should be associated with.
LatencyRoutingPolicies List<RecordLatencyRoutingPolicyArgs>
A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
MultivalueAnswerRoutingPolicy bool
Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
Records List<string>
A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \"\" inside the configuration string (e.g. "first255characters\"\"morecharacters").
SetIdentifier string
Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.
Ttl int
The TTL of the record.
WeightedRoutingPolicies List<RecordWeightedRoutingPolicyArgs>
A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.
Name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
Type string | RecordType
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
ZoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
Aliases []RecordAliasArgs
An alias block. Conflicts with ttl & records. Alias record documented below.
AllowOverwrite bool
Allow creation of this record to overwrite an existing record, if any. This does not affect the ability to update the record using this provider and does not prevent other resources within this provider or manual Route 53 changes outside this provider from overwriting this record. false by default. This configuration is not recommended for most environments.
FailoverRoutingPolicies []RecordFailoverRoutingPolicyArgs
A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.
GeolocationRoutingPolicies []RecordGeolocationRoutingPolicyArgs
A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.
HealthCheckId string
The health check the record should be associated with.
LatencyRoutingPolicies []RecordLatencyRoutingPolicyArgs
A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
MultivalueAnswerRoutingPolicy bool
Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
Records []string
A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \"\" inside the configuration string (e.g. "first255characters\"\"morecharacters").
SetIdentifier string
Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.
Ttl int
The TTL of the record.
WeightedRoutingPolicies []RecordWeightedRoutingPolicyArgs
A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.
name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
type string | RecordType
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
zoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
aliases RecordAliasArgs[]
An alias block. Conflicts with ttl & records. Alias record documented below.
allowOverwrite boolean
Allow creation of this record to overwrite an existing record, if any. This does not affect the ability to update the record using this provider and does not prevent other resources within this provider or manual Route 53 changes outside this provider from overwriting this record. false by default. This configuration is not recommended for most environments.
failoverRoutingPolicies RecordFailoverRoutingPolicyArgs[]
A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.
geolocationRoutingPolicies RecordGeolocationRoutingPolicyArgs[]
A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.
healthCheckId string
The health check the record should be associated with.
latencyRoutingPolicies RecordLatencyRoutingPolicyArgs[]
A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
multivalueAnswerRoutingPolicy boolean
Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
records string[]
A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \"\" inside the configuration string (e.g. "first255characters\"\"morecharacters").
setIdentifier string
Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.
ttl number
The TTL of the record.
weightedRoutingPolicies RecordWeightedRoutingPolicyArgs[]
A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.
name str
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
type str | RecordType
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
zone_id str
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
aliases Sequence[RecordAliasArgs]
An alias block. Conflicts with ttl & records. Alias record documented below.
allow_overwrite bool
Allow creation of this record to overwrite an existing record, if any. This does not affect the ability to update the record using this provider and does not prevent other resources within this provider or manual Route 53 changes outside this provider from overwriting this record. false by default. This configuration is not recommended for most environments.
failover_routing_policies Sequence[RecordFailoverRoutingPolicyArgs]
A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.
geolocation_routing_policies Sequence[RecordGeolocationRoutingPolicyArgs]
A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.
health_check_id str
The health check the record should be associated with.
latency_routing_policies Sequence[RecordLatencyRoutingPolicyArgs]
A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
multivalue_answer_routing_policy bool
Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
records Sequence[str]
A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \"\" inside the configuration string (e.g. "first255characters\"\"morecharacters").
set_identifier str
Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.
ttl int
The TTL of the record.
weighted_routing_policies Sequence[RecordWeightedRoutingPolicyArgs]
A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.

Outputs

All input properties are implicitly available as output properties. Additionally, the Record resource produces the following output properties:

Fqdn string
FQDN built using the zone domain and name.
Id string
The provider-assigned unique ID for this managed resource.
Fqdn string
FQDN built using the zone domain and name.
Id string
The provider-assigned unique ID for this managed resource.
fqdn string
FQDN built using the zone domain and name.
id string
The provider-assigned unique ID for this managed resource.
fqdn str
FQDN built using the zone domain and name.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Record Resource

Get an existing Record resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RecordState, opts?: CustomResourceOptions): Record
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        aliases: Optional[Sequence[RecordAliasArgs]] = None,
        allow_overwrite: Optional[bool] = None,
        failover_routing_policies: Optional[Sequence[RecordFailoverRoutingPolicyArgs]] = None,
        fqdn: Optional[str] = None,
        geolocation_routing_policies: Optional[Sequence[RecordGeolocationRoutingPolicyArgs]] = None,
        health_check_id: Optional[str] = None,
        latency_routing_policies: Optional[Sequence[RecordLatencyRoutingPolicyArgs]] = None,
        multivalue_answer_routing_policy: Optional[bool] = None,
        name: Optional[str] = None,
        records: Optional[Sequence[str]] = None,
        set_identifier: Optional[str] = None,
        ttl: Optional[int] = None,
        type: Optional[Union[str, RecordType]] = None,
        weighted_routing_policies: Optional[Sequence[RecordWeightedRoutingPolicyArgs]] = None,
        zone_id: Optional[str] = None) -> Record
func GetRecord(ctx *Context, name string, id IDInput, state *RecordState, opts ...ResourceOption) (*Record, error)
public static Record Get(string name, Input<string> id, RecordState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Aliases List<RecordAliasArgs>
An alias block. Conflicts with ttl & records. Alias record documented below.
AllowOverwrite bool
Allow creation of this record to overwrite an existing record, if any. This does not affect the ability to update the record using this provider and does not prevent other resources within this provider or manual Route 53 changes outside this provider from overwriting this record. false by default. This configuration is not recommended for most environments.
FailoverRoutingPolicies List<RecordFailoverRoutingPolicyArgs>
A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.
Fqdn string
FQDN built using the zone domain and name.
GeolocationRoutingPolicies List<RecordGeolocationRoutingPolicyArgs>
A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.
HealthCheckId string
The health check the record should be associated with.
LatencyRoutingPolicies List<RecordLatencyRoutingPolicyArgs>
A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
MultivalueAnswerRoutingPolicy bool
Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
Name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
Records List<string>
A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \"\" inside the configuration string (e.g. "first255characters\"\"morecharacters").
SetIdentifier string
Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.
Ttl int
The TTL of the record.
Type string | Pulumi.Aws.Route53.RecordType
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
WeightedRoutingPolicies List<RecordWeightedRoutingPolicyArgs>
A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.
ZoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
Aliases []RecordAliasArgs
An alias block. Conflicts with ttl & records. Alias record documented below.
AllowOverwrite bool
Allow creation of this record to overwrite an existing record, if any. This does not affect the ability to update the record using this provider and does not prevent other resources within this provider or manual Route 53 changes outside this provider from overwriting this record. false by default. This configuration is not recommended for most environments.
FailoverRoutingPolicies []RecordFailoverRoutingPolicyArgs
A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.
Fqdn string
FQDN built using the zone domain and name.
GeolocationRoutingPolicies []RecordGeolocationRoutingPolicyArgs
A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.
HealthCheckId string
The health check the record should be associated with.
LatencyRoutingPolicies []RecordLatencyRoutingPolicyArgs
A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
MultivalueAnswerRoutingPolicy bool
Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
Name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
Records []string
A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \"\" inside the configuration string (e.g. "first255characters\"\"morecharacters").
SetIdentifier string
Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.
Ttl int
The TTL of the record.
Type string | RecordType
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
WeightedRoutingPolicies []RecordWeightedRoutingPolicyArgs
A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.
ZoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
aliases RecordAliasArgs[]
An alias block. Conflicts with ttl & records. Alias record documented below.
allowOverwrite boolean
Allow creation of this record to overwrite an existing record, if any. This does not affect the ability to update the record using this provider and does not prevent other resources within this provider or manual Route 53 changes outside this provider from overwriting this record. false by default. This configuration is not recommended for most environments.
failoverRoutingPolicies RecordFailoverRoutingPolicyArgs[]
A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.
fqdn string
FQDN built using the zone domain and name.
geolocationRoutingPolicies RecordGeolocationRoutingPolicyArgs[]
A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.
healthCheckId string
The health check the record should be associated with.
latencyRoutingPolicies RecordLatencyRoutingPolicyArgs[]
A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
multivalueAnswerRoutingPolicy boolean
Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
records string[]
A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \"\" inside the configuration string (e.g. "first255characters\"\"morecharacters").
setIdentifier string
Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.
ttl number
The TTL of the record.
type string | RecordType
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
weightedRoutingPolicies RecordWeightedRoutingPolicyArgs[]
A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.
zoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
aliases Sequence[RecordAliasArgs]
An alias block. Conflicts with ttl & records. Alias record documented below.
allow_overwrite bool
Allow creation of this record to overwrite an existing record, if any. This does not affect the ability to update the record using this provider and does not prevent other resources within this provider or manual Route 53 changes outside this provider from overwriting this record. false by default. This configuration is not recommended for most environments.
failover_routing_policies Sequence[RecordFailoverRoutingPolicyArgs]
A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.
fqdn str
FQDN built using the zone domain and name.
geolocation_routing_policies Sequence[RecordGeolocationRoutingPolicyArgs]
A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.
health_check_id str
The health check the record should be associated with.
latency_routing_policies Sequence[RecordLatencyRoutingPolicyArgs]
A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
multivalue_answer_routing_policy bool
Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
name str
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
records Sequence[str]
A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \"\" inside the configuration string (e.g. "first255characters\"\"morecharacters").
set_identifier str
Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.
ttl int
The TTL of the record.
type str | RecordType
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
weighted_routing_policies Sequence[RecordWeightedRoutingPolicyArgs]
A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.
zone_id str
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.

Supporting Types

RecordAlias

EvaluateTargetHealth bool
Set to true if you want Route 53 to determine whether to respond to DNS queries using this resource record set by checking the health of the resource record set. Some resources have special requirements, see related part of documentation.
Name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
ZoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
EvaluateTargetHealth bool
Set to true if you want Route 53 to determine whether to respond to DNS queries using this resource record set by checking the health of the resource record set. Some resources have special requirements, see related part of documentation.
Name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
ZoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
evaluateTargetHealth boolean
Set to true if you want Route 53 to determine whether to respond to DNS queries using this resource record set by checking the health of the resource record set. Some resources have special requirements, see related part of documentation.
name string
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
zoneId string
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.
evaluate_target_health bool
Set to true if you want Route 53 to determine whether to respond to DNS queries using this resource record set by checking the health of the resource record set. Some resources have special requirements, see related part of documentation.
name str
DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.
zone_id str
Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.

RecordFailoverRoutingPolicy

Type string
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
Type string
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
type string
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets
type str
PRIMARY or SECONDARY. A PRIMARY record will be served if its healthcheck is passing, otherwise the SECONDARY will be served. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html#dns-failover-failover-rrsets

RecordGeolocationRoutingPolicy

Continent string
A two-letter continent code. See http://docs.aws.amazon.com/Route53/latest/APIReference/API_GetGeoLocation.html for code details. Either continent or country must be specified.
Country string
A two-character country code or * to indicate a default resource record set.
Subdivision string
A subdivision code for a country.
Continent string
A two-letter continent code. See http://docs.aws.amazon.com/Route53/latest/APIReference/API_GetGeoLocation.html for code details. Either continent or country must be specified.
Country string
A two-character country code or * to indicate a default resource record set.
Subdivision string
A subdivision code for a country.
continent string
A two-letter continent code. See http://docs.aws.amazon.com/Route53/latest/APIReference/API_GetGeoLocation.html for code details. Either continent or country must be specified.
country string
A two-character country code or * to indicate a default resource record set.
subdivision string
A subdivision code for a country.
continent str
A two-letter continent code. See http://docs.aws.amazon.com/Route53/latest/APIReference/API_GetGeoLocation.html for code details. Either continent or country must be specified.
country str
A two-character country code or * to indicate a default resource record set.
subdivision str
A subdivision code for a country.

RecordLatencyRoutingPolicy

RecordType

A
A
AAAA
AAAA
CNAME
CNAME
CAA
CAA
MX
MX
NAPTR
NAPTR
NS
NS
PTR
PTR
SOA
SOA
SPF
SPF
SRV
SRV
TXT
TXT
RecordTypeA
A
RecordTypeAAAA
AAAA
RecordTypeCNAME
CNAME
RecordTypeCAA
CAA
RecordTypeMX
MX
RecordTypeNAPTR
NAPTR
RecordTypeNS
NS
RecordTypePTR
PTR
RecordTypeSOA
SOA
RecordTypeSPF
SPF
RecordTypeSRV
SRV
RecordTypeTXT
TXT
A
A
AAAA
AAAA
CNAME
CNAME
CAA
CAA
MX
MX
NAPTR
NAPTR
NS
NS
PTR
PTR
SOA
SOA
SPF
SPF
SRV
SRV
TXT
TXT
A
A
AAAA
AAAA
CNAME
CNAME
CAA
CAA
MX
MX
NAPTR
NAPTR
NS
NS
PTR
PTR
SOA
SOA
SPF
SPF
SRV
SRV
TXT
TXT

RecordWeightedRoutingPolicy

Weight int
A numeric value indicating the relative weight of the record. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted.
Weight int
A numeric value indicating the relative weight of the record. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted.
weight number
A numeric value indicating the relative weight of the record. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted.
weight int
A numeric value indicating the relative weight of the record. See http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted.

Import

Route53 Records can be imported using ID of the record, which is the zone identifier, record name, and record type, separated by underscores (_)E.g.,

 $ pulumi import aws:route53/record:Record myrecord Z4KAPRWWNC7JR_dev.example.com_NS

If the record also contains a delegated set identifier, it can be appended

 $ pulumi import aws:route53/record:Record myrecord Z4KAPRWWNC7JR_dev.example.com_NS_dev

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.