本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
DomainConfiguration
設定 API 的自訂網域。
語法
若要在 AWS Serverless Application Model (AWS SAM) 範本中宣告此實體,請使用下列語法。
YAML
BasePath:
List
NormalizeBasePath:Boolean
CertificateArn:String
DomainName:String
EndpointConfiguration:String
MutualTlsAuthentication:MutualTlsAuthentication
OwnershipVerificationCertificateArn:String
Route53:Route53Configuration
SecurityPolicy:String
屬性
-
BasePath
-
要使用 Amazon API Gateway 網域名稱設定的基本路徑清單。
類型:清單
必要:否
預設值:/
AWS CloudFormation兼容性:此屬性類似於
AWS::ApiGateway::BasePathMapping
資源的BasePath
屬性。 AWS SAM會建立多個AWS::ApiGateway::BasePathMapping
資源,每個在此屬性中BasePath
指定一個資源。 -
NormalizeBasePath
-
指出屬性定義的
BasePath
基本路徑中是否允許使用非英數字元。設定為時True
,會從基本路徑中移除非英數字元。NormalizeBasePath
與BasePath
屬性一起使用。類型:布林值
必要:否
預設值:真
AWS CloudFormation兼容性:此屬性是唯一的,AWS SAM並且沒有相AWS CloudFormation等的屬性。
-
CertificateArn
-
此網域名稱端點的AWS受管憑證的 Amazon 資源名稱 (ARN)。 AWS Certificate Manager是唯一受支援的來源。
類型:字串
必要:是
AWS CloudFormation兼容性:此屬性類似於
AWS::ApiGateway::DomainName
資源的CertificateArn
屬性。如果設定EndpointConfiguration
為REGIONAL
(預設值),則對CertificateArn
映至RegionalCertificateArn中AWS::ApiGateway::DomainName
。如果設定EndpointConfiguration
為EDGE
,則對CertificateArn
映至CertificateArn中AWS::ApiGateway::DomainName
。其他注意事項:對於
EDGE
端點,您必須在「us-east-1
AWS區域」中建立憑證。 -
DomainName
-
API Gateway API 的自訂網域名稱。不支援大寫字母。
AWS SAM設置此屬性時生成一個AWS::ApiGateway::DomainName資源。如需有關此案例的資訊,請參閱DomainName屬性已指定。如需有關已產生AWS CloudFormation資源的資訊,請參閱產生的 AWS CloudFormation 資源 AWS SAM。
類型:字串
必要:是
AWS CloudFormation兼容性:此屬性直接傳遞給
AWS::ApiGateway::DomainName
資源的DomainName
屬性。 -
EndpointConfiguration
-
定義要對應至自訂網域的 API Gateway 端點類型。此屬性的值決定了對應
CertificateArn
性質的方式AWS CloudFormation。有效值:
REGIONAL
或EDGE
類型:字串
必要:否
預設:
REGIONAL
AWS CloudFormation兼容性:此屬性是唯一的,AWS SAM並且沒有相AWS CloudFormation等的屬性。
-
MutualTlsAuthentication
-
自訂網域名稱的相互傳輸層安全性 (TLS) 驗證組態。
必要:否
AWS CloudFormation兼容性:此屬性直接傳遞給
AWS::ApiGateway::DomainName
資源的MutualTlsAuthentication
屬性。 -
OwnershipVerificationCertificateArn
-
ACM 核發之公有憑證的 ARN,用於驗證您的自訂網域的擁有權。只有當您設定相互 TLS,並指定 ACM 匯入或私有 CA 憑證 ARN 給.
CertificateArn
類型:字串
必要:否
AWS CloudFormation兼容性:此屬性直接傳遞給
AWS::ApiGateway::DomainName
資源的OwnershipVerificationCertificateArn
屬性。 -
Route53
-
定義 Amazon 路線 53 配置。
類型:路線 53 配置
必要:否
AWS CloudFormation兼容性:此屬性是唯一的,AWS SAM並且沒有相AWS CloudFormation等的屬性。
-
SecurityPolicy
-
TLS 版本加上此域名的密碼套件。
類型:字串
必要:否
AWS CloudFormation兼容性:此屬性直接傳遞給
AWS::ApiGateway::DomainName
資源的SecurityPolicy
屬性。
範例
DomainName
DomainName 例子
YAML
Domain: DomainName: www.example.com CertificateArn: arn-example EndpointConfiguration: EDGE Route53: HostedZoneId: Z1PA6795UKMFR9 BasePath: - foo - bar