

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# HttpApiDomainConfiguration
<a name="sam-property-httpapi-httpapidomainconfiguration"></a>

設定 API 的自訂網域。

## 語法
<a name="sam-property-httpapi-httpapidomainconfiguration-syntax"></a>

若要在 AWS Serverless Application Model (AWS SAM) 範本中宣告此實體，請使用下列語法。

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

```
  [BasePath](#sam-httpapi-httpapidomainconfiguration-basepath): List
  [CertificateArn](#sam-httpapi-httpapidomainconfiguration-certificatearn): String
  [DomainName](#sam-httpapi-httpapidomainconfiguration-domainname): String
  [EndpointConfiguration](#sam-httpapi-httpapidomainconfiguration-endpointconfiguration): String
  [MutualTlsAuthentication](#sam-httpapi-httpapidomainconfiguration-mutualtlsauthentication): [MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)
  [OwnershipVerificationCertificateArn](#sam-httpapi-httpapidomainconfiguration-ownershipverificationcertificatearn): String
  [Route53](#sam-httpapi-httpapidomainconfiguration-route53): Route53Configuration
  [SecurityPolicy](#sam-httpapi-httpapidomainconfiguration-securitypolicy): String
```

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

 `BasePath`   <a name="sam-httpapi-httpapidomainconfiguration-basepath"></a>
要使用 Amazon API Gateway 網域名稱設定的基本路徑清單。  
*類型：*清單  
*必要*：否  
*預設*：/  
*CloudFormation 相容性*：此屬性類似於 `AWS::ApiGatewayV2::ApiMapping` 資源的 `[ApiMappingKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-apimapping.html#cfn-apigatewayv2-apimapping-apimappingkey)` 屬性。 會 AWS SAM 建立多個 `AWS::ApiGatewayV2::ApiMapping` 資源，每個在此屬性中指定的值各一個。

 `CertificateArn`   <a name="sam-httpapi-httpapidomainconfiguration-certificatearn"></a>
此網域名稱端點受 AWS 管憑證的 Amazon Resource Name (ARN)。 AWS Certificate Manager 是唯一支援的來源。  
*類型：*字串  
*必要*：是  
*CloudFormation 相容性*：此屬性會直接傳遞至 `AWS::ApiGateway2::DomainName DomainNameConfiguration` 資源的 `[CertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-certificatearn)` 屬性。

 `DomainName`   <a name="sam-httpapi-httpapidomainconfiguration-domainname"></a>
API Gateway API 的自訂網域名稱。不支援大寫字母。  
AWS SAM 會在設定此屬性時產生 `AWS::ApiGatewayV2::DomainName` 資源。如需此案例的資訊，請參閱 [已指定 DomainName 屬性](sam-specification-generated-resources-httpapi.md#sam-specification-generated-resources-httpapi-domain-name)。如需所產生 CloudFormation 資源的資訊，請參閱 [為 產生 CloudFormation 資源 AWS SAM](sam-specification-generated-resources.md)。  
*類型：*字串  
*必要*：是  
*CloudFormation 相容性*：此屬性會直接傳遞至 `AWS::ApiGateway2::DomainName` 資源的 `[DomainName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-domainname)` 屬性。

 `EndpointConfiguration`   <a name="sam-httpapi-httpapidomainconfiguration-endpointconfiguration"></a>
定義要映射到自訂網域的 API Gateway 端點類型。此屬性的值會決定`CertificateArn`屬性的映射方式 CloudFormation。  
HTTP APIs 的唯一有效值是 `REGIONAL`。  
*類型：*字串  
*必要*：否  
*預設*：`REGIONAL`  
*CloudFormation 相容性*：此屬性對 是唯一的 AWS SAM ，並且沒有 CloudFormation 同等屬性。

 `MutualTlsAuthentication`   <a name="sam-httpapi-httpapidomainconfiguration-mutualtlsauthentication"></a>
自訂網域名稱的交互傳輸層安全 (TLS) 身分驗證組態。  
*類型*：[MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)  
*必要*：否  
*CloudFormation 相容性*：此屬性會直接傳遞至 `AWS::ApiGatewayV2::DomainName` 資源的 `[MutualTlsAuthentication](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-mutualtlsauthentication)` 屬性。

 `OwnershipVerificationCertificateArn`   <a name="sam-httpapi-httpapidomainconfiguration-ownershipverificationcertificatearn"></a>
ACM 核發之公有憑證的 ARN，用於驗證您的自訂網域的擁有權。只有在您設定交互 TLS 並指定 的 ACM 匯入或私有 CA 憑證 ARN 時才需要`CertificateArn`。  
*類型：*字串  
*必要*：否  
*CloudFormation 相容性*：此屬性會直接傳遞至 `AWS::ApiGatewayV2::DomainName` `DomainNameConfiguration` 資料類型的 `[OwnershipVerificationCertificateArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-ownershipverificationcertificatearn)` 屬性。

 `Route53`   <a name="sam-httpapi-httpapidomainconfiguration-route53"></a>
定義 Amazon Route 53 組態。  
*類型*：[Route53Configuration](sam-property-httpapi-route53configuration.md)  
*必要*：否  
*CloudFormation 相容性*：此屬性對 是唯一的 AWS SAM ，並且沒有 CloudFormation 同等的。

 `SecurityPolicy`   <a name="sam-httpapi-httpapidomainconfiguration-securitypolicy"></a>
此網域名稱之安全政策的 TLS 版本。  
HTTP APIs 的唯一有效值是 `TLS_1_2`。  
*類型：*字串  
*必要*：否  
*CloudFormation 相容性*：此屬性會直接傳遞至 `AWS::ApiGatewayV2::DomainName` `DomainNameConfiguration` 資料類型的 `[SecurityPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-domainname-domainnameconfiguration.html#cfn-apigatewayv2-domainname-domainnameconfiguration-securitypolicy)` 屬性。

## 範例
<a name="sam-property-httpapi-httpapidomainconfiguration--examples"></a>

### DomainName
<a name="sam-property-httpapi-httpapidomainconfiguration--examples--domainname"></a>

DomainName 範例

#### YAML
<a name="sam-property-httpapi-httpapidomainconfiguration--examples--domainname--yaml"></a>

```
Domain:
  DomainName: www.example.com
  CertificateArn: arn-example
  EndpointConfiguration: REGIONAL
  Route53:
    HostedZoneId: Z1PA6795UKMFR9
  BasePath:
    - foo
    - bar
```

# 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`資源，並將提供的 HostedZone `AAAA`的 [Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-type) 設定為 。  
*類型*：布林值  
*必要*：否  
*CloudFormation 相容性*：此屬性對 是唯一的 AWS SAM ，並且沒有 CloudFormation 同等的。

`Region`  <a name="sam-httpapi-route53configuration-region"></a>
*僅限延遲型資源記錄集：*您建立資源的 Amazon EC2 區域，這是此資源記錄集指向的資源。資源通常是 AWS 資源，例如 EC2 執行個體或 ELB 負載平衡器，並且根據記錄類型由 IP 地址或 DNS 網域名稱參考。  
當 Amazon Route 53 收到網域名稱和類型的 DNS 查詢，而您已建立其延遲資源記錄集時，Route 53 會選取最低延遲介於最終使用者與相關聯 Amazon 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
```