Show / Hide Table of Contents

Class 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
    {
        Name = "www.example.com",
        Records = 
        {
            aws_eip.Lb.Public_ip,
        },
        Ttl = "300",
        Type = "A",
        ZoneId = aws_route53_zone.Primary.Zone_id,
    });
}

}

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
    {
        Name = "www",
        Records = 
        {
            "dev.example.com",
        },
        SetIdentifier = "dev",
        Ttl = "5",
        Type = "CNAME",
        WeightedRoutingPolicies = 
        {
            new Aws.Route53.Inputs.RecordWeightedRoutingPolicyArgs
            {
                Weight = 10,
            },
        },
        ZoneId = aws_route53_zone.Primary.Zone_id,
    });
    var www_live = new Aws.Route53.Record("www-live", new Aws.Route53.RecordArgs
    {
        Name = "www",
        Records = 
        {
            "live.example.com",
        },
        SetIdentifier = "live",
        Ttl = "5",
        Type = "CNAME",
        WeightedRoutingPolicies = 
        {
            new Aws.Route53.Inputs.RecordWeightedRoutingPolicyArgs
            {
                Weight = 90,
            },
        },
        ZoneId = aws_route53_zone.Primary.Zone_id,
    });
}

}

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
    {
        Aliases = 
        {
            new Aws.Route53.Inputs.RecordAliasArgs
            {
                EvaluateTargetHealth = true,
                Name = main.DnsName,
                ZoneId = main.ZoneId,
            },
        },
        Name = "example.com",
        Type = "A",
        ZoneId = aws_route53_zone.Primary.Zone_id,
    });
}

}

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",
        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]),
        },
        Ttl = 30,
        Type = "NS",
        ZoneId = exampleZone.ZoneId,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Record
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Route53
Assembly: Pulumi.Aws.dll
Syntax
public class Record : CustomResource

Constructors

View Source

Record(String, RecordArgs, CustomResourceOptions)

Create a Record resource with the given unique name, arguments, and options.

Declaration
public Record(string name, RecordArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

RecordArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Aliases

An alias block. Conflicts with ttl & records. Alias record documented below.

Declaration
public Output<ImmutableArray<RecordAlias>> Aliases { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<RecordAlias>>
View Source

AllowOverwrite

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.

Declaration
public Output<bool> AllowOverwrite { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

FailoverRoutingPolicies

A block indicating the routing behavior when associated health check fails. Conflicts with any other routing policy. Documented below.

Declaration
public Output<ImmutableArray<RecordFailoverRoutingPolicy>> FailoverRoutingPolicies { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<RecordFailoverRoutingPolicy>>
View Source

Fqdn

FQDN built using the zone domain and name.

Declaration
public Output<string> Fqdn { get; }
Property Value
Type Description
Output<System.String>
View Source

GeolocationRoutingPolicies

A block indicating a routing policy based on the geolocation of the requestor. Conflicts with any other routing policy. Documented below.

Declaration
public Output<ImmutableArray<RecordGeolocationRoutingPolicy>> GeolocationRoutingPolicies { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<RecordGeolocationRoutingPolicy>>
View Source

HealthCheckId

The health check the record should be associated with.

Declaration
public Output<string> HealthCheckId { get; }
Property Value
Type Description
Output<System.String>
View Source

LatencyRoutingPolicies

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.

Declaration
public Output<ImmutableArray<RecordLatencyRoutingPolicy>> LatencyRoutingPolicies { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<RecordLatencyRoutingPolicy>>
View Source

MultivalueAnswerRoutingPolicy

Set to true to indicate a multivalue answer routing policy. Conflicts with any other routing policy.

Declaration
public Output<bool?> MultivalueAnswerRoutingPolicy { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Name

DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another resource record set in this hosted zone.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Records

A string list of records. To specify a single record value longer than 255 characters such as a TXT record for DKIM, add \&quot;\&quot; inside the configuration string (e.g. &quot;first255characters\&quot;\&quot;morecharacters&quot;).

Declaration
public Output<ImmutableArray<string>> Records { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

SetIdentifier

Unique identifier to differentiate records with routing policies from one another. Required if using failover, geolocation, latency, or weighted routing policies documented below.

Declaration
public Output<string> SetIdentifier { get; }
Property Value
Type Description
Output<System.String>
View Source

Ttl

The TTL of the record.

Declaration
public Output<int?> Ttl { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Type

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

Declaration
public Output<string> Type { get; }
Property Value
Type Description
Output<System.String>
View Source

WeightedRoutingPolicies

A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.

Declaration
public Output<ImmutableArray<RecordWeightedRoutingPolicy>> WeightedRoutingPolicies { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<RecordWeightedRoutingPolicy>>
View Source

ZoneId

Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone. See resource_elb.zone_id for example.

Declaration
public Output<string> ZoneId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, RecordState, CustomResourceOptions)

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

Declaration
public static Record Get(string name, Input<string> id, RecordState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

RecordState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Record
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.