

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

# WebSocketApiDomainConfiguration
<a name="sam-property-websocketapi-websocketapidomainconfiguration"></a>

設定 WebSocket API 的自訂網域。

## 語法
<a name="sam-property-websocketapi-websocketapidomainconfiguration-syntax"></a>

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

### YAML
<a name="sam-property-websocketapi-websocketapidomainconfiguration-syntax.yaml"></a>

```
  [BasePath](#sam-websocketapi-websocketapidomainconfiguration-basepath): {{List}}
  [CertificateArn](#sam-websocketapi-websocketapidomainconfiguration-certificatearn): {{String}}
  [DomainName](#sam-websocketapi-websocketapidomainconfiguration-domainname): {{String}}
  [EndpointConfiguration](#sam-websocketapi-websocketapidomainconfiguration-endpointconfiguration): {{String}}
  [Route53](#sam-websocketapi-websocketapidomainconfiguration-route53): {{Route53Configuration}}
  [SecurityPolicy](#sam-websocketapi-websocketapidomainconfiguration-securitypolicy): {{String}}
```

## Properties
<a name="sam-property-websocketapi-websocketapidomainconfiguration-properties"></a>

 `BasePath`   <a name="sam-websocketapi-websocketapidomainconfiguration-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-websocketapi-websocketapidomainconfiguration-certificatearn"></a>
此網域名稱端點受 AWS 管憑證的 Amazon Resource Name (ARN)。 AWS Certificate Manager 是唯一支援的來源。  
*類型：*字串  
*必要*：是  
*CloudFormation 相容性*：此屬性會直接傳遞至 `AWS::ApiGatewayV2::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-websocketapi-websocketapidomainconfiguration-domainname"></a>
API Gateway WebSocket API 的自訂網域名稱。不支援大寫字母。  
AWS SAM 會在設定此屬性時產生 `AWS::ApiGatewayV2::DomainName` 資源。如需所產生 CloudFormation 資源的資訊，請參閱 [為 產生 CloudFormation 資源 AWS SAM](sam-specification-generated-resources.md)。  
*類型：*字串  
*必要*：是  
*CloudFormation 相容性*：此屬性會直接傳遞至 `AWS::ApiGatewayV2::DomainName` 資源的 `[DomainName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html#cfn-apigatewayv2-domainname-domainname)` 屬性。

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

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

 `SecurityPolicy`   <a name="sam-websocketapi-websocketapidomainconfiguration-securitypolicy"></a>
此網域名稱之安全政策的 TLS 版本。  
WebSocket 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-websocketapi-websocketapidomainconfiguration--examples"></a>

### DomainName
<a name="sam-property-websocketapi-websocketapidomainconfiguration--examples--domainname"></a>

DomainName 範例

#### YAML
<a name="sam-property-websocketapi-websocketapidomainconfiguration--examples--domainname--yaml"></a>

```
Domain:
  DomainName: ws.example.com
  CertificateArn: arn:aws:acm:us-east-1:123456789012:certificate/example
  EndpointConfiguration: REGIONAL
  Route53:
    HostedZoneId: Z1PA6795UKMFR9
  BasePath:
    - v1
    - v2
```