AWS::Route53::RecordSetGroup - AWS CloudFormation

AWS::Route53::RecordSetGroup

A complex type that contains an optional comment, the name and ID of the hosted zone that you want to make changes in, and values for the records that you want to create.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Route53::RecordSetGroup", "Properties" : { "Comment" : String, "HostedZoneId" : String, "HostedZoneName" : String, "RecordSets" : [ RecordSet, ... ] } }

YAML

Type: AWS::Route53::RecordSetGroup Properties: Comment: String HostedZoneId: String HostedZoneName: String RecordSets: - RecordSet

Properties

Comment

Optional: Any comments you want to include about a change batch request.

Required: No

Type: String

Maximum: 256

Update requires: No interruption

HostedZoneId

The ID of the hosted zone that you want to create records in.

Specify either HostedZoneName or HostedZoneId, but not both. If you have multiple hosted zones with the same domain name, you must specify the hosted zone using HostedZoneId.

Required: No

Type: String

Maximum: 32

Update requires: Replacement

HostedZoneName

The name of the hosted zone that you want to create records in. You must include a trailing dot (for example, www.example.com.) as part of the HostedZoneName.

When you create a stack using an AWS::Route53::RecordSet that specifies HostedZoneName, AWS CloudFormation attempts to find a hosted zone whose name matches the HostedZoneName. If AWS CloudFormation can't find a hosted zone with a matching domain name, or if there is more than one hosted zone with the specified domain name, AWS CloudFormation will not create the stack.

Specify either HostedZoneName or HostedZoneId, but not both. If you have multiple hosted zones with the same domain name, you must specify the hosted zone using HostedZoneId.

Required: No

Type: String

Maximum: 1024

Update requires: Replacement

RecordSets

A complex type that contains one RecordSet element for each record that you want to create.

Required: No

Type: Array of RecordSet

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the name of the record set group, for example, MyRecordSetGroup.

For more information about using the Ref function, see Ref.

Fn::GetAtt

Id

Specifies a coordinate of the east–west position of a geographic point on the surface of the Earth.

Examples

For more examples, see Route 53 Template Snippets.

Creating records for a mail server

The following example shows how to create three records for a mail server:

  • An A record that specifies the IP address for the mail server.

  • An MX record that routes email to that server.

  • A TXT record that contains an SPF string, which is used to identify the sender of email messages. SPF records are no longer recommended. For more information, see SPF Record Type in the Amazon Route 53 Developer Guide.

JSON

{ "myExampleDotComEmailServer": { "Type": "AWS::Route53::RecordSetGroup", "Properties": { "Comment": "Creating records for mail server", "HostedZoneId": "Z1PA6795UKMFR9", "RecordSets": [ { "Name": "mail.example.com.", "Type": "A", "TTL": "900", "ResourceRecords": [ "192.0.2.44" ] }, { "Name": "mail.example.com.", "Type": "MX", "TTL": "900", "ResourceRecords": [ "10 mail.example.com" ] }, { "Name": "mail.example.com.", "Type": "TXT", "TTL": "900", "ResourceRecords": [ "\"v=spf1 ip4:203.0.113.0/30 -all\"" ] } ] } } }

YAML

myExampleDotComEmailServer: Type: AWS::Route53::RecordSetGroup Properties: Comment: Creating records for mail server HostedZoneId: Z1PA6795UKMFR9 RecordSets: - Name: mail.example.com. ResourceRecords: - 192.0.2.44 TTL: '900' Type: A - Name: mail.example.com. ResourceRecords: - '10 mail.example.com' TTL: '900' Type: MX - Name: mail.example.com. ResourceRecords: - '"v=spf1 ip4:203.0.113.0/30 -all"' TTL: '900' Type: TXT

See also