本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
DomainConfiguration
为 API 配置自定义域。
语法
要在 Amazon Serverless Application Model (Amazon SAM) 模板中声明此实体,请使用以下语法。
YAML
AccessAssociation:DomainAccessAssociationBasePath:ListCertificateArn:StringDomainName:StringEndpointConfiguration:StringMutualTlsAuthentication:MutualTlsAuthenticationNormalizeBasePath:BooleanOwnershipVerificationCertificateArn:StringPolicy:JsonRoute53:Route53ConfigurationSecurityPolicy:String
属性
-
AccessAssociation -
生成
AWS::ApiGateway::DomainNameAccessAssociation资源所需的配置。Amazon SAM 生成一个 AWS::ApiGateway::DomainNameAccessAssociation设置此属性时的资源。有关生成的 Amazon CloudFormation 资源的信息,请参阅生成的 Amazon CloudFormation 资源用于 Amazon SAM。
必需:否
Amazon CloudFormation 兼容性:此属性是独有的 Amazon SAM ,没有 Amazon CloudFormation 等效属性。
-
BasePath -
要使用 Amazon API Gateway 域名配置的基本路径列表。
类型:列表
必需:否
默认值:/
Amazon CloudFormation 兼容性:此属性类似于
AWS::ApiGateway::BasePathMapping资源的BasePath属性。 Amazon SAM 创建多个AWS::ApiGateway::BasePathMapping资源,每个资源在此属性中BasePath指定一个。 -
CertificateArn -
Amazon 托管证书的亚马逊资源名称 (ARN) 此域名的终端节点。 Amazon Certificate Manager 是唯一支持的来源。
类型:字符串
必需:是
Amazon CloudFormation 兼容性:此属性类似于
AWS::ApiGateway::DomainName资源的CertificateArn属性。如果设置EndpointConfiguration为REGIONAL(默认值),则CertificateArn映射到 RegionalCertificateArninAWS::ApiGateway::DomainName。如果设置EndpointConfiguration为EDGE,则CertificateArn映射到 CertificateArninAWS::ApiGateway::DomainName。如果设置EndpointConfiguration为PRIVATE,则此属性将传递给 AWS::ApiGateway::DomainNameV2 资源。其他说明:对于终
EDGE端节点,您必须在us-east-1Amazon 区域中创建证书。 -
DomainName -
API Gateway API 的自定义域名。不支持大写字母。
Amazon SAM 生成一个 AWS::ApiGateway::DomainName设置此属性时的资源。有关此场景的更多信息,请参阅DomainName属性已指定。有关生成的 Amazon CloudFormation 资源的信息,请参阅生成的 Amazon CloudFormation 资源用于 Amazon SAM。
类型:字符串
必需:是
Amazon CloudFormation 兼容性:此属性直接传递给
AWS::ApiGateway::DomainName资源的DomainName属性,或者在设置为AWS::ApiGateway::DomainNameV2时传递给 EndpointConfiguration 该属性PRIVATE。 -
EndpointConfiguration -
定义要映射到自定义域的 API Gateway 端点的类型。此属性的值决定了该
CertificateArn属性的映射方式 Amazon CloudFormation。有效值:
EDGE、REGIONAL或PRIVATE类型:字符串
必需:否
默认值:
REGIONALAmazon CloudFormation 兼容性:此属性是独有的 Amazon SAM ,没有 Amazon CloudFormation 等效属性。
-
MutualTlsAuthentication -
自定义域名的相互传输层安全性协议(TLS)身份验证配置。
必需:否
Amazon CloudFormation 兼容性:此属性直接传递给
AWS::ApiGateway::DomainName资源的MutualTlsAuthentication属性。 -
NormalizeBasePath -
表示
BasePath属性定义的基本路径中是否允许非字母数字字符。如果设置为True,则将从基本路径中移除非字母数字字符。针对
BasePath属性使用NormalizeBasePath。类型:布尔值
必需:否
默认值:True
Amazon CloudFormation 兼容性:此属性是独有的 Amazon SAM ,没有 Amazon CloudFormation 等效属性。
-
OwnershipVerificationCertificateArn -
ACM 颁发的用于验证自定义域所有权的公有证书的 ARN。只有在配置双向 TLS 并且为
CertificateArn指定了 ACM 导入的或私有 CA 证书 ARN 时才需要。类型:字符串
必需:否
Amazon CloudFormation 兼容性:此属性直接传递给
AWS::ApiGateway::DomainName资源的OwnershipVerificationCertificateArn属性。 -
Policy -
要附加到 API Gateway 域名的 IAM 策略。仅在设置
EndpointConfiguration为时适用PRIVATE。类型:Json
必需:否
Amazon CloudFormation 兼容性:当设置为时
EndpointConfiguration,此Policy属性将直接传递给AWS::ApiGateway::DomainNameV2资源的属性PRIVATE。有关有效政策文件的示例,请参阅 AWS::ApiGateway::DomainNameV2。 -
Route53 -
定义 Amazon Route 53 配置。
必需:否
Amazon CloudFormation 兼容性:此属性是独有的 Amazon SAM ,没有 Amazon CloudFormation 等效属性。
-
SecurityPolicy -
此域名的 TLS 版本加密码套件。
类型:字符串
必需:否
Amazon CloudFormation 兼容性:此属性直接传递给
AWS::ApiGateway::DomainName资源的SecurityPolicy属性,或者在设置为AWS::ApiGateway::DomainNameV2时传递给EndpointConfiguration该属性PRIVATE。对于PRIVATE端点,仅支持 TLS_1_2。
示例
DomainName
DomainName 示例
YAML
Domain: DomainName: www.example.com CertificateArn: arn-example EndpointConfiguration: EDGE Route53: HostedZoneId: Z1PA6795UKMFR9 BasePath: - foo - bar