DomainConfiguration - Amazon Serverless Application Model
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

DomainConfiguration

为 API 配置自定义域。

语法

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

属性

BasePath

要使用 Amazon API Gateway 域名配置的基本路径列表。

类型:列表

必需:否

默认值:/

Amazon CloudFormation 兼容性:此属性类似于 AWS::ApiGateway::BasePathMapping 资源的 BasePath 属性。Amazon SAM 创建多个 AWS::ApiGateway::BasePathMapping 资源,在此属性中每个 BasePath 指定一个。

NormalizeBasePath

表示 BasePath 属性定义的基本路径中是否允许非字母数字字符。如果设置为 True,则将从基本路径中移除非字母数字字符。

针对 BasePath 属性使用 NormalizeBasePath

类型:布尔值

必需:否

默认值:True

Amazon CloudFormation 兼容性:此属性为 Amazon SAM 独有,没有 Amazon CloudFormation 等效属性。

CertificateArn

Amazon 托管证书的 Amazon 资源名称(ARN)该域名的端点。Amazon Certificate Manager 是唯一受支持的源。

类型:字符串

必需:是

Amazon CloudFormation 兼容性:此属性类似于 AWS::ApiGateway::DomainName 资源的 CertificateArn 属性。如果设置EndpointConfigurationREGIONAL(默认值),则CertificateArn映射到 RegionalCertificateArnin AWS::ApiGateway::DomainName。如果设置EndpointConfigurationEDGE,则CertificateArn映射到 CertificateArnin AWS::ApiGateway::DomainName

附加说明:对于 EDGE 端点,您必须在 us-east-1 Amazon 区域中创建证书。

DomainName

API Gateway API 的自定义域名。不支持大写字母。

如果设置了此属性,Amazon SAM 会生成 AWS::ApiGateway::DomainName 资源。有关此场景的更多信息,请参阅DomainName属性已指定。有关生成的 Amazon CloudFormation 资源的信息,请参阅 生成的 Amazon CloudFormation 资源

类型:字符串

必需:是

Amazon CloudFormation 兼容性:此属性直接传递给 AWS::ApiGateway::DomainName 资源的 DomainName 属性。

EndpointConfiguration

定义要映射到自定义域的 API Gateway 端点的类型。此属性的值决定了 CertificateArn 属性在 Amazon CloudFormation 中的映射方式。

有效值REGIONALEDGE

类型:字符串

必需:否

默认值REGIONAL

Amazon CloudFormation 兼容性:此属性为 Amazon SAM 独有,没有 Amazon CloudFormation 等效属性。

MutualTlsAuthentication

自定义域名的相互传输层安全性协议(TLS)身份验证配置。

类型:MutualTlsAuthentication

必需:否

Amazon CloudFormation 兼容性:此属性直接传递给 AWS::ApiGateway::DomainName 资源的 MutualTlsAuthentication 属性。

OwnershipVerificationCertificateArn

ACM 颁发的用于验证自定义域所有权的公有证书的 ARN。只有在配置双向 TLS 并且为 CertificateArn 指定了 ACM 导入的或私有 CA 证书 ARN 时才需要。

类型:字符串

必需:否

Amazon CloudFormation 兼容性:此属性直接传递给 AWS::ApiGateway::DomainName 资源的 OwnershipVerificationCertificateArn 属性。

Route53

定义 Amazon Route 53 配置。

类型Route53Configuration

必需:否

Amazon CloudFormation 兼容性:此属性为 Amazon SAM 独有,没有 Amazon CloudFormation 等效属性。

SecurityPolicy

此域名的 TLS 版本加密码套件。

类型:字符串

必需:否

Amazon CloudFormation 兼容性:此属性直接传递给 AWS::ApiGateway::DomainName 资源的 SecurityPolicy 属性。

示例

DomainName

DomainName 示例

YAML

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