Namespace Pulumi.Aws.Route53
Classes
DelegationSet
Provides a Route53 Delegation Set resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var main = new Aws.Route53.DelegationSet("main", new Aws.Route53.DelegationSetArgs
{
ReferenceName = "DynDNS",
});
var primary = new Aws.Route53.Zone("primary", new Aws.Route53.ZoneArgs
{
DelegationSetId = main.Id,
});
var secondary = new Aws.Route53.Zone("secondary", new Aws.Route53.ZoneArgs
{
DelegationSetId = main.Id,
});
}
}
DelegationSetArgs
DelegationSetState
GetDelegationSet
GetDelegationSetArgs
GetDelegationSetResult
GetResolverRule
GetResolverRuleArgs
GetResolverRuleResult
GetResolverRules
GetResolverRulesArgs
GetResolverRulesResult
GetZone
GetZoneArgs
GetZoneResult
HealthCheck
Provides a Route53 health check.
Example Usage
Connectivity and HTTP Status Code Check
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Route53.HealthCheck("example", new Aws.Route53.HealthCheckArgs
{
FailureThreshold = "5",
Fqdn = "example.com",
Port = 80,
RequestInterval = "30",
ResourcePath = "/",
Tags =
{
{ "Name", "tf-test-health-check" },
},
Type = "HTTP",
});
}
}
Connectivity and String Matching Check
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Route53.HealthCheck("example", new Aws.Route53.HealthCheckArgs
{
FailureThreshold = "5",
Fqdn = "example.com",
Port = 443,
RequestInterval = "30",
ResourcePath = "/",
SearchString = "example",
Type = "HTTPS_STR_MATCH",
});
}
}
Aggregate Check
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var parent = new Aws.Route53.HealthCheck("parent", new Aws.Route53.HealthCheckArgs
{
ChildHealthThreshold = 1,
ChildHealthchecks =
{
aws_route53_health_check.Child.Id,
},
Tags =
{
{ "Name", "tf-test-calculated-health-check" },
},
Type = "CALCULATED",
});
}
}
CloudWatch Alarm Check
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var foobar = new Aws.CloudWatch.MetricAlarm("foobar", new Aws.CloudWatch.MetricAlarmArgs
{
AlarmDescription = "This metric monitors ec2 cpu utilization",
ComparisonOperator = "GreaterThanOrEqualToThreshold",
EvaluationPeriods = "2",
MetricName = "CPUUtilization",
Namespace = "AWS/EC2",
Period = "120",
Statistic = "Average",
Threshold = "80",
});
var foo = new Aws.Route53.HealthCheck("foo", new Aws.Route53.HealthCheckArgs
{
CloudwatchAlarmName = foobar.Name,
CloudwatchAlarmRegion = "us-west-2",
InsufficientDataHealthStatus = "Healthy",
Type = "CLOUDWATCH_METRIC",
});
}
}
HealthCheckArgs
HealthCheckState
QueryLog
Provides a Route53 query logging configuration resource.
NOTE: There are restrictions on the configuration of query logging. Notably, the CloudWatch log group must be in the
us-east-1region, a permissive CloudWatch log resource policy must be in place, and the Route53 hosted zone must be public. See Configuring Logging for DNS Queries for additional details.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var us_east_1 = new Aws.Provider("us-east-1", new Aws.ProviderArgs
{
Region = "us-east-1",
});
var awsRoute53ExampleCom = new Aws.CloudWatch.LogGroup("awsRoute53ExampleCom", new Aws.CloudWatch.LogGroupArgs
{
RetentionInDays = 30,
});
var route53_query_logging_policyPolicyDocument = Output.Create(Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
{
Statements =
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
{
Actions =
{
"logs:CreateLogStream",
"logs:PutLogEvents",
},
Principals =
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalArgs
{
Identifiers =
{
"route53.amazonaws.com",
},
Type = "Service",
},
},
Resources =
{
"arn:aws:logs:*:*:log-group:/aws/route53/*",
},
},
},
}));
var route53_query_logging_policyLogResourcePolicy = new Aws.CloudWatch.LogResourcePolicy("route53-query-logging-policyLogResourcePolicy", new Aws.CloudWatch.LogResourcePolicyArgs
{
PolicyDocument = route53_query_logging_policyPolicyDocument.Apply(route53_query_logging_policyPolicyDocument => route53_query_logging_policyPolicyDocument.Json),
PolicyName = "route53-query-logging-policy",
});
var exampleComZone = new Aws.Route53.Zone("exampleComZone", new Aws.Route53.ZoneArgs
{
});
var exampleComQueryLog = new Aws.Route53.QueryLog("exampleComQueryLog", new Aws.Route53.QueryLogArgs
{
CloudwatchLogGroupArn = awsRoute53ExampleCom.Arn,
ZoneId = exampleComZone.ZoneId,
});
}
}
QueryLogArgs
QueryLogState
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,
});
}
}
RecordArgs
RecordState
ResolverEndpoint
Provides a Route 53 Resolver endpoint resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var foo = new Aws.Route53.ResolverEndpoint("foo", new Aws.Route53.ResolverEndpointArgs
{
Direction = "INBOUND",
IpAddresses =
{
new Aws.Route53.Inputs.ResolverEndpointIpAddressArgs
{
SubnetId = aws_subnet.Sn1.Id,
},
new Aws.Route53.Inputs.ResolverEndpointIpAddressArgs
{
Ip = "10.0.64.4",
SubnetId = aws_subnet.Sn2.Id,
},
},
SecurityGroupIds =
{
aws_security_group.Sg1.Id,
aws_security_group.Sg2.Id,
},
Tags =
{
{ "Environment", "Prod" },
},
});
}
}
ResolverEndpointArgs
ResolverEndpointState
ResolverRule
Provides a Route53 Resolver rule.
Example Usage
System rule
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var sys = new Aws.Route53.ResolverRule("sys", new Aws.Route53.ResolverRuleArgs
{
DomainName = "subdomain.example.com",
RuleType = "SYSTEM",
});
}
}
Forward rule
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var fwd = new Aws.Route53.ResolverRule("fwd", new Aws.Route53.ResolverRuleArgs
{
DomainName = "example.com",
ResolverEndpointId = aws_route53_resolver_endpoint.Foo.Id,
RuleType = "FORWARD",
Tags =
{
{ "Environment", "Prod" },
},
TargetIps =
{
new Aws.Route53.Inputs.ResolverRuleTargetIpArgs
{
Ip = "123.45.67.89",
},
},
});
}
}
ResolverRuleArgs
ResolverRuleAssociation
Provides a Route53 Resolver rule association.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Route53.ResolverRuleAssociation("example", new Aws.Route53.ResolverRuleAssociationArgs
{
ResolverRuleId = aws_route53_resolver_rule.Sys.Id,
VpcId = aws_vpc.Foo.Id,
});
}
}
ResolverRuleAssociationArgs
ResolverRuleAssociationState
ResolverRuleState
Zone
Manages a Route53 Hosted Zone.
Example Usage
Public Zone
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var primary = new Aws.Route53.Zone("primary", new Aws.Route53.ZoneArgs
{
});
}
}
Public Subdomain Zone
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var main = new Aws.Route53.Zone("main", new Aws.Route53.ZoneArgs
{
});
var dev = new Aws.Route53.Zone("dev", new Aws.Route53.ZoneArgs
{
Tags =
{
{ "Environment", "dev" },
},
});
var dev_ns = new Aws.Route53.Record("dev-ns", new Aws.Route53.RecordArgs
{
Name = "dev.example.com",
Records =
{
dev.NameServers.Apply(nameServers => nameServers[0]),
dev.NameServers.Apply(nameServers => nameServers[1]),
dev.NameServers.Apply(nameServers => nameServers[2]),
dev.NameServers.Apply(nameServers => nameServers[3]),
},
Ttl = "30",
Type = "NS",
ZoneId = main.ZoneId,
});
}
}
Private Zone
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var @private = new Aws.Route53.Zone("private", new Aws.Route53.ZoneArgs
{
Vpcs =
{
new Aws.Route53.Inputs.ZoneVpcArgs
{
VpcId = aws_vpc.Example.Id,
},
},
});
}
}
ZoneArgs
ZoneAssociation
Manages a Route53 Hosted Zone VPC association. VPC associations can only be made on private zones.
NOTE: Unless explicit association ordering is required (e.g. a separate cross-account association authorization), usage of this resource is not recommended. Use the
vpcconfiguration blocks available within theaws.route53.Zoneresource instead.
NOTE: This provider provides both this standalone Zone VPC Association resource and exclusive VPC associations defined in-line in the
aws.route53.Zoneresource viavpcconfiguration blocks. At this time, you cannot use those in-line VPC associations in conjunction with this resource and the same zone ID otherwise it will cause a perpetual difference in plan output. You can optionally useignoreChangesin theaws.route53.Zoneresource to manage additional associations via this resource.