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_overwrite
optional computed - bool -
fqdn
optional computed - string -
health_check_id
optional - string -
id
optional computed - string -
multivalue_answer_routing_policy
optional - bool -
name
required - string -
records
optional - set of string -
set_identifier
optional - string -
ttl
optional - number -
type
required - string -
zone_id
required - string -
alias
set block-
evaluate_target_health
required - bool -
name
required - string -
zone_id
required - string
-
-
failover_routing_policy
list block-
type
required - string
-
-
geolocation_routing_policy
list block-
continent
optional - string -
country
optional - string -
subdivision
optional - string
-
-
latency_routing_policy
list block-
region
required - string
-
-
weighted_routing_policy
list block-
weight
required - 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
-
AliasTarget
optional - AliasTarget -
Comment
optional - String -
Failover
optional - String -
GeoLocation
optional - GeoLocation -
HealthCheckId
optional - String -
HostedZoneId
optional - String -
HostedZoneName
optional - String -
MultiValueAnswer
optional - Boolean -
Name
required - String -
Region
optional - String -
ResourceRecords
optional - List -
SetIdentifier
optional - String -
TTL
optional - String -
Type
required - String -
Weight
optional - Integer
Explanation in CloudFormation Registry
Information about the record that you want to create.
The
AWS::Route53::RecordSet
type can be used as a standalone resource or as an embedded property in theAWS::Route53::RecordSetGroup
type. Note that someAWS::Route53::RecordSet
properties 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.