

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# Route53Configuration
<a name="sam-property-httpapi-route53configuration"></a>

为 API 配置 Route53 记录集。

## 语法
<a name="sam-property-httpapi-route53configuration-syntax"></a>

要在 AWS Serverless Application Model (AWS SAM) 模板中声明此实体，请使用以下语法。

### YAML
<a name="sam-property-httpapi-route53configuration-syntax.yaml"></a>

```
  [DistributionDomainName](#sam-httpapi-route53configuration-distributiondomainname): String
  [EvaluateTargetHealth](#sam-httpapi-route53configuration-evaluatetargethealth): Boolean
  [HostedZoneId](#sam-httpapi-route53configuration-hostedzoneid): String
  [HostedZoneName](#sam-httpapi-route53configuration-hostedzonename): String
  [IpV6](#sam-httpapi-route53configuration-ipv6): Boolean
  Region: String
  SetIdentifier: String
```

## Properties
<a name="sam-property-httpapi-route53configuration-properties"></a>

 `DistributionDomainName`   <a name="sam-httpapi-route53configuration-distributiondomainname"></a>
配置 API 自定义域名的自定义分配。  
*类型*：字符串  
*必需*：否  
*默认*：使用 API Gateway 分配。  
*CloudFormation 兼容性*：此属性直接传递给`AWS::Route53::RecordSetGroup AliasTarget`资源的`[DNSName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget-1.html#cfn-route53-aliastarget-dnshostname)`属性。  
*其他说明*：[CloudFront分配](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html)的域名。

 `EvaluateTargetHealth`   <a name="sam-httpapi-route53configuration-evaluatetargethealth"></a>
如果 EvaluateTargetHealth 为 true，则别名记录将继承引用 AWS 资源的运行状况，例如 Elastic Load Balancing 负载均衡器或托管区域中的其他记录。  
*类型*：布尔值  
*必需*：否  
*CloudFormation 兼容性*：此属性直接传递给`AWS::Route53::RecordSetGroup AliasTarget`资源的`[EvaluateTargetHealth](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget.html#cfn-route53-aliastarget-evaluatetargethealth)`属性。  
*其他说明*：当别名目标为 CloudFront 分布时，您不能 EvaluateTargetHealth 将其设置为 true。

 `HostedZoneId`   <a name="sam-httpapi-route53configuration-hostedzoneid"></a>
要在其中创建记录的托管区的 ID。  
指定 `HostedZoneName` 或 `HostedZoneId`，但不能同时指定两者。如果您拥有多个使用相同域名的托管区域，则必须使用 `HostedZoneId` 指定托管区。  
*类型*：字符串  
*必需*：否  
*CloudFormation 兼容性*：此属性直接传递给`AWS::Route53::RecordSetGroup RecordSet`资源的`[HostedZoneId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-hostedzoneid)`属性。

 `HostedZoneName`   <a name="sam-httpapi-route53configuration-hostedzonename"></a>
要在其中创建记录的托管区的名称。您必须包含结尾圆点（例如 `www.example.com.`）作为 `HostedZoneName` 的一部分。  
指定 `HostedZoneName` 或 `HostedZoneId`，但不能同时指定两者。如果您拥有多个使用相同域名的托管区域，则必须使用 `HostedZoneId` 指定托管区。  
*类型*：字符串  
*必需*：否  
*CloudFormation 兼容性*：此属性直接传递给`AWS::Route53::RecordSetGroup RecordSet`资源的`[HostedZoneName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-hostedzonename)`属性。

 `IpV6`   <a name="sam-httpapi-route53configuration-ipv6"></a>
设置此属性后，将 AWS SAM 创建一个`AWS::Route53::RecordSet`资源并将提供的资源的 [Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-type) 设置`AAAA`为 HostedZone。  
*类型*：布尔值  
*必需*：否  
*CloudFormation 兼容性*：此属性是独有的 AWS SAM ，没有 CloudFormation 等效属性。

`Region`  <a name="sam-httpapi-route53configuration-region"></a>
*仅限基于延迟的资源记录集*：您创建此资源记录集所引用的资源的亚马逊 EC2 区域。资源通常是 AWS 资源，例如 EC2 实例或 ELB 负载均衡器，并由 IP 地址或 DNS 域名引用，具体取决于记录类型。  
当 Amazon Route 53 收到针对您已为其创建延迟资源记录集的域名和类型的 DNS 查询时，Route 53 会选择最终用户与关联亚马逊 EC2 地区之间延迟最低的延迟资源记录集。然后，Route 53 会返回与所选资源记录集相关的值。  
注意以下几点：  
+ 您只能为每个延迟资源记录集指定一个 `ResourceRecord`。
+ 您只能为每个 Amazon EC2 地区创建一个延迟资源记录集。
+ 您无需为所有 Amazon EC2 区域创建延迟资源记录集。Route 53 会从您已创建延迟资源记录集的区域中选择延迟性能最佳的区域。
+ 您不能创建 `Name` 和 `Type` 元素的值与延迟资源记录集相同的非延迟资源记录集。
*类型*：字符串  
*必需*：否  
*CloudFormation 兼容性*：此属性直接传递给`AWS::Route53::RecordSetGroup``RecordSet`数据类型的`[ Region](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-region)`属性。

`SetIdentifier`  <a name="sam-httpapi-route53configuration-setidentifier"></a>
*具有简单策略以外的路由策略的资源记录集：*用于区分具有相同名称和类型组合的多个资源记录集的标识符，如名为 acme.example.com 且类型为 A 的多个加权资源记录集。在一组具有相同名称和类型的资源记录集中，每个资源记录集的 `SetIdentifier` 值必须唯一。  
有关路由策略的信息，请参阅*《Amazon Route 53 开发人员指南》*中的[选择路由策略](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html)。  
*类型*：字符串  
*必需*：否  
*CloudFormation 兼容性*：此属性直接传递给`AWS::Route53::RecordSetGroup``RecordSet`数据类型的`[ SetIdentifier](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-1.html#cfn-route53-recordset-setidentifier)`属性。

## 示例
<a name="sam-property-httpapi-route53configuration--examples"></a>

### Route 53 配置示例
<a name="sam-property-httpapi-route53configuration--examples--route-53-configuration-example"></a>

此示例演示了如何配置 Route 53。

#### YAML
<a name="sam-property-httpapi-route53configuration--examples--route-53-configuration-example--yaml"></a>

```
Domain:
  DomainName: www.example.com
  CertificateArn: arn-example
  EndpointConfiguration: EDGE
  Route53:
    HostedZoneId: Z1PA6795UKMFR9
    EvaluateTargetHealth: true
    DistributionDomainName: xyz
```