Record
Provides a single Route53 Record
Examples
CNAME from a certificate
Verify a certificate with DNS validation by adding a CNAME record.
exports.createResources = () => [
{ type: "Certificate", group: "ACM", name: "grucloud.org" },
{
type: "HostedZone",
group: "Route53",
name: "grucloud.org.",
dependencies: () => ({
domain: "grucloud.org",
}),
},
{
type: "Record",
group: "Route53",
dependencies: () => ({
hostedZone: "grucloud.org.",
certificate: "grucloud.org",
}),
},
{
type: "Domain",
group: "Route53Domains",
name: "grucloud.org",
readOnly: true,
},
];
TXT record
Let's add TXT record to verify a domain ownership:
exports.createResources = () => [
{
type: "HostedZone",
group: "Route53",
name: "grucloud.org.",
dependencies: () => ({
domain: "grucloud.org",
}),
},
{
type: "Record",
group: "Route53",
properties: ({}) => ({
Name: "gcrun.grucloud.org.",
Type: "TXT",
TTL: 300,
ResourceRecords: [
{
Value:
'"google-site-verification=ZXCVBNMF8sKTj__itc4iAXA4my_hB-bzUlCFGHJK"',
},
],
}),
dependencies: () => ({
hostedZone: "grucloud.org.",
}),
},
{
type: "Domain",
group: "Route53Domains",
name: "grucloud.org",
readOnly: true,
},
];
A record from an elastic IP address
Ads a IPv4 A record from an elastic IP address
exports.createResources = () => [
{
type: "ElasticIpAddress",
group: "EC2",
name: "myip",
},
{
type: "HostedZone",
group: "Route53",
name: "grucloud.org.",
dependencies: () => ({
domain: "grucloud.org",
}),
},
{
type: "Record",
group: "Route53",
properties: ({ getId }) => ({
Name: "grucloud.org.",
Type: "A",
TTL: 300,
ResourceRecords: [
{
Value: getId({
type: "ElasticIpAddress",
group: "EC2",
name: "myip",
path: "live.PublicIp",
}),
},
],
}),
dependencies: () => ({
hostedZone: "grucloud.org.",
elasticIpAddress: "myip",
}),
},
];
Alias for a CloudFront Distribution
Add an alias entry to the the CloudFront distribution domain name
exports.createResources = () => [
{
type: "HostedZone",
group: "Route53",
name: "dev.cloudfront.aws.test.grucloud.org.",
dependencies: () => ({
domain: "grucloud.org",
}),
},
{
type: "Record",
group: "Route53",
dependencies: () => ({
hostedZone: "dev.cloudfront.aws.test.grucloud.org.",
distribution: "distribution-cloudfront.aws.test.grucloud.org-dev",
}),
},
];
Source Code Examples
- ACM Certificate
- ApiGatewayV2 http-lambda
- CloudFront Distribution
- ElasticLoadBalancingV2 Alias record for a load balancer
- Alias record for a Cloudfront distribution
- TXT record and hosted zone
- health-check simple example
- A Record to an elastic IP address
- CognitoIdentityServiceProvider identity-provider
Properties
Dependencies
- ACM Certificate
- ApiGatewayV2 DomainName
- CloudFront Distribution
- EC2 Elastic IP Address
- EC2 Vpc Endpoint
- ElasticLoadBalancingV2 LoadBalancer
- Route53 HostedZone
- Route53 HealthCheck
List
gc l -t Route53::Record
Listing resources on 1 provider: aws
✓ aws us-east-1
✓ Initialising
✓ Listing 3/3
┌───────────────────────────────────────────────────────────────────────────┐
│ 3 Route53::Record from aws │
├───────────────────────────────────────────────────────────────────────────┤
│ name: record::NS::grucloud.org. │
│ managedByUs: Yes │
│ live: │
│ Name: grucloud.org. │
│ Type: NS │
│ TTL: 172800 │
│ ResourceRecords: │
│ - Value: ns-39.awsdns-04.com. │
│ - Value: ns-1621.awsdns-10.co.uk. │
│ - Value: ns-1344.awsdns-40.org. │
│ - Value: ns-793.awsdns-35.net. │
│ HostedZoneId: Z0150486BN9SN0JQWCYZ │
│ │
├───────────────────────────────────────────────────────────────────────────┤
│ name: record::SOA::grucloud.org. │
│ managedByUs: Yes │
│ live: │
│ Name: grucloud.org. │
│ Type: SOA │
│ TTL: 900 │
│ ResourceRecords: │
│ - Value: ns-39.awsdns-04.com. awsdns-hostmaster.amazon.com. 1 7200 9… │
│ HostedZoneId: Z0150486BN9SN0JQWCYZ │
│ │
├───────────────────────────────────────────────────────────────────────────┤
│ name: record::TXT::gcrun.grucloud.org. │
│ managedByUs: Yes │
│ live: │
│ Name: gcrun.grucloud.org. │
│ Type: TXT │
│ TTL: 300 │
│ ResourceRecords: │
│ - Value: "google-site-verification=DPVEQ54F8sKTj__itc4iAXA4my_hB-bzU… │
│ HostedZoneId: Z0150486BN9SN0JQWCYZ │
│ │
└───────────────────────────────────────────────────────────────────────────┘
List Summary:
Provider: aws
┌──────────────────────────────────────────────────────────────────────────┐
│ aws │
├─────────────────┬────────────────────────────────────────────────────────┤
│ Route53::Record │ record::NS::grucloud.org. │
│ │ record::SOA::grucloud.org. │
│ │ record::TXT::gcrun.grucloud.org. │
└─────────────────┴────────────────────────────────────────────────────────┘
3 resources, 1 type, 1 provider
Command "gc l -t Route53::Record" executed in 6s, 105 MB