Amazon CloudFormation resources generated when AWS::Serverless::Api is specified - Amazon Serverless Application Model
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon CloudFormation resources generated when AWS::Serverless::Api is specified

When an AWS::Serverless::Api is specified, Amazon Serverless Application Model (Amazon SAM) always generates an AWS::ApiGateway::RestApi base Amazon CloudFormation resource. In addition, it also always generates an AWS::ApiGateway::Stage and an AWS::ApiGateway::Deployment resource.

AWS::ApiGateway::RestApi

LogicalId: <api‑LogicalId>

Referenceable property: N/A (you must use the LogicalId to reference this Amazon CloudFormation resource)

AWS::ApiGateway::Stage

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

<stage‑name> is the string that the StageName property is set to. For example, if you set StageName to Gamma, the LogicalId is MyRestApiGammaStage.

Referenceable property: <api‑LogicalId>.Stage

AWS::ApiGateway::Deployment

LogicalId: <api‑LogicalId>Deployment<sha>

<sha> is a unique hash value that is generated when the stack is created. For example, MyRestApiDeployment926eeb5ff1.

Referenceable property: <api‑LogicalId>.Deployment

In addition to these Amazon CloudFormation resources, when AWS::Serverless::Api is specified, Amazon SAM generates additional Amazon CloudFormation resources for the following scenarios.

DomainName property is specified

When the DomainName property of the Domain property of an AWS::Serverless::Api is specified, Amazon SAM generates the AWS::ApiGateway::DomainName Amazon CloudFormation resource.

AWS::ApiGateway::DomainName

LogicalId: ApiGatewayDomainName<sha>

<sha> is a unique hash value that is generated when the stack is created. For example: ApiGatewayDomainName926eeb5ff1.

Referenceable property: <api‑LogicalId>.DomainName

UsagePlan property is specified

When the UsagePlan property of the Auth property of an AWS::Serverless::Api is specified, Amazon SAM generates the following Amazon CloudFormation resources: AWS::ApiGateway::UsagePlan, AWS::ApiGateway::UsagePlanKey, and AWS::ApiGateway::ApiKey.

AWS::ApiGateway::UsagePlan

LogicalId: <api‑LogicalId>UsagePlan

Referenceable property: <api‑LogicalId>.UsagePlan

AWS::ApiGateway::UsagePlanKey

LogicalId: <api‑LogicalId>UsagePlanKey

Referenceable property: <api‑LogicalId>.UsagePlanKey

AWS::ApiGateway::ApiKey

LogicalId: <api‑LogicalId>ApiKey

Referenceable property: <api‑LogicalId>.ApiKey