Define resources by using other supported properties in Amazon SAM - 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).

Define resources by using other supported properties in Amazon SAM

For both source and destination resources, when defined within the same template, use the Id property. Optionally, a Qualifier can be added to narrow the scope of your defined resource. When the resource is not within the same template, use a combination of supported properties.

When you define a source resource with a property other than Id, use the SourceReference property.

AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 ... Resources: <source-resource-logical-id>: Type: <resource-type> ... Connectors: <connector-name>: Properties: SourceReference: Qualifier: <optional-qualifier> <other-supported-properties> Destination: <properties-that-identify-destination-resource> Permissions: <permission-types-to-provision>

Here's an example, using a Qualifier to narrow the scope of an Amazon API Gateway resource:

AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 ... Resources: MyApi: Type: AWS::Serverless::Api Connectors: ApiToLambdaConn: Properties: SourceReference: Qualifier: Prod/GET/foobar Destination: Id: MyFunction Permissions: - Write ...

Here's an example, using a supported combination of Arn and Type to define a destination resource from another template:

AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 ... Resources: MyFunction: Type: AWS::Serverless::Function Connectors: TableConn: Properties: Destination: Type: AWS::DynamoDB::Table Arn: !GetAtt MyTable.Arn ...

For more information on using connectors, refer to Amazon SAM connector reference.