AWS CloudFormation 指定时 AWS::Serverless::HttpApi 生成的资源 - AWS Serverless Application Model

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

AWS CloudFormation 指定时 AWS::Serverless::HttpApi 生成的资源

当指定AWS::Serverless::HttpApi时, AWS Serverless Application Model (AWS SAM) 会生成AWS::ApiGatewayV2::Api基础 AWS CloudFormation 资源。

AWS::ApiGatewayV2::Api

LogicalId: <httpapi‑LogicalId>

可引用的属性:N/A(必须使用LogicalId来引用此 AWS CloudFormation 资源)

除此 AWS CloudFormation 资源外,如果指定了AWS::Serverless::HttpApi此资源, AWS SAM 还会生成用于以下场景的 AWS CloudFormation 资源:

StageName属性已指定

当指定了的StageName属性AWS::Serverless::HttpApi时, AWS SAM 会生成AWS::ApiGatewayV2::Stage AWS CloudFormation 资源。

AWS::ApiGatewayV2::Stage

LogicalId: <httpapi‑LogicalId><stage‑name>Stage

<stage‑name>StageName 属性将被设置为的字符串。例如,如果设置为 StageNameGamma,则LogicalId为:MyHttpApiGamma舞台。

可引用属性:<httpapi‑LogicalId>.Stage

StageName指定属性

如果指定 a AWS::Serverless::HttpApiStageName属性,则 AWS SAM 生成AWS::ApiGatewayV2::Stage AWS CloudFormation 资源。

AWS::ApiGatewayV2::Stage

LogicalId: <httpapi‑LogicalId>ApiGatewayDefaultStage

可引用属性:<httpapi‑LogicalId>.Stage

DomainName属性已指定

当指定了Domain属性的属性AWS::Serverless::HttpApi时, AWS SAM 会生成AWS::ApiGatewayV2::DomainName AWS CloudFormation 资源。DomainName

AWS::ApiGatewayV2::DomainName

LogicalId: ApiGatewayDomainNameV2<sha>

<sha> 是在创建堆栈时生成的唯一哈希值。例如,ApiGatewayDomainNameV2926eeb5ff1

可引用属性:<httpapi‑LogicalId>.DomainName