

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

# 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 资源名称 (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>
定义 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
```