AWS Route 53 Record
This page shows how to write Terraform and CloudFormation for Route 53 Record and write them securely.
aws_route53_record (Terraform)
The Record in Route 53 can be configured in Terraform with the resource name aws_route53_record. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_route53_record" "training-vm-oz-0" {
zone_id = data.aws_route53_zone.training-gxp-eu.zone_id
name = "gat-0.oz.training.galaxyproject.eu"
type = "A"
ttl = "7200"
records = ["115.146.85.100"]
resource "aws_route53_record" "osamaoracle_com__mx" {
zone_id = aws_route53_zone.osamaoracle_com.zone_id
name = ""
type = "MX"
ttl = "300"
Parameters
-
allow_overwriteoptional computed - bool -
fqdnoptional computed - string -
health_check_idoptional - string -
idoptional computed - string -
multivalue_answer_routing_policyoptional - bool -
namerequired - string -
recordsoptional - set of string -
set_identifieroptional - string -
ttloptional - number -
typerequired - string -
zone_idrequired - string -
aliasset block-
evaluate_target_healthrequired - bool -
namerequired - string -
zone_idrequired - string
-
-
failover_routing_policylist block-
typerequired - string
-
-
geolocation_routing_policylist block-
continentoptional - string -
countryoptional - string -
subdivisionoptional - string
-
-
latency_routing_policylist block-
regionrequired - string
-
-
weighted_routing_policylist block-
weightrequired - number
-
Explanation in Terraform Registry
Provides a Route53 record resource.
AWS::Route53::RecordSet (CloudFormation)
The RecordSet in Route53 can be configured in CloudFormation with the resource name AWS::Route53::RecordSet. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::Route53::RecordSet
Properties:
Name:
Fn::ImportValue: !Sub '${HostedZoneStack}-name'
HostedZoneId:
Fn::ImportValue: !Sub '${HostedZoneStack}-id'
Type: AWS::Route53::RecordSet
Properties:
Name:
Fn::ImportValue: !Sub '${HostedZoneStack}-name'
HostedZoneId:
Fn::ImportValue: !Sub '${HostedZoneStack}-id'
Type: AWS::Route53::RecordSet
Properties:
Name:
Fn::ImportValue: !Sub '${HostedZoneStack}-name'
HostedZoneId:
Fn::ImportValue: !Sub '${HostedZoneStack}-id'
Type: "AWS::Route53::RecordSet"
Properties:
Name:
!Sub
- 'dev.${DomainName}'
- DomainName:
Type: "AWS::Route53::RecordSet"
Properties:
Name: '_16963e3ff6d1efbe92bfdddaed549e39.suggpro.fr'
HostedZoneName: 'suggpro.fr.'
Type: CNAME
TTL: 900
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneName": "dirtybit.io.",
"Name": "db-mon-m01.dirtybit.io.",
"ResourceRecords": [ "217.100.96.52" ],
"TTL": "3600",
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneName": {
"Ref": "targetHostedZoneName"
},
"TTL": "900",
"Type" : "AWS::Route53::RecordSet",
"Properties" : {
"HostedZoneName" : { "Ref" : "EnvironmentSuffix" },
"Comment" : "DNS name for instance.",
"Name" : { "Fn::Join" : [ "", ["sw-hit-",{ "Ref" : "EnvironmentName" },".",{ "Ref" : "EnvironmentSuffix" }]]},
"Type" : "A",
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId": {
"Ref": "R53HZROOT"
},
"Name": "myamazingtech.com",
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneName": {
"Fn::Sub": "${BaseDomainName}."
},
"Name": {
Parameters
-
AliasTargetoptional - AliasTarget -
Commentoptional - String -
Failoveroptional - String -
GeoLocationoptional - GeoLocation -
HealthCheckIdoptional - String -
HostedZoneIdoptional - String -
HostedZoneNameoptional - String -
MultiValueAnsweroptional - Boolean -
Namerequired - String -
Regionoptional - String -
ResourceRecordsoptional - List -
SetIdentifieroptional - String -
TTLoptional - String -
Typerequired - String -
Weightoptional - Integer
Explanation in CloudFormation Registry
Information about the record that you want to create.
The
AWS::Route53::RecordSettype can be used as a standalone resource or as an embedded property in theAWS::Route53::RecordSetGrouptype. Note that someAWS::Route53::RecordSetproperties are valid only when used withinAWS::Route53::RecordSetGroup. For more information, see ChangeResourceRecordSets in the Amazon Route 53 API Reference.
Frequently asked questions
What is AWS Route 53 Record?
AWS Route 53 Record is a resource for Route 53 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Route 53 Record?
For Terraform, the galaxyproject/admin-training and OsamaOracle/infrastructure-scripts-terraform source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the Benjamin-99/Webapp, Benjamin-99/Webapp and Benjamin-99/Webapp source code examples are useful. See the CloudFormation Example section for further details.