Lambda
Configure an AWS Lambda function as a data source for your GraphQL API resolver.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
LogicalId: Description:StringFunctionArn:StringName:StringServiceRoleArn:String
Properties
Description-
The description of your data source.
Type: String
Required: No
CloudFormation compatibility: This property is passed directly to the
Descriptionproperty of anAWS::AppSync::DataSourceresource. FunctionArn-
The ARN for the Lambda function.
Type: String
Required: No
CloudFormation compatibility: This property is passed directly to the
LambdaFunctionArnproperty of anAWS::AppSync::DataSource LambdaConfigobject. LogicalId-
The unique name of your data source.
Type: String
Required: Yes
CloudFormation compatibility: This property is passed directly to the
Nameproperty of anAWS::AppSync::DataSourceresource. Name-
The name of your data source. Specify this property to override the
LogicalIdvalue.Type: String
Required: No
CloudFormation compatibility: This property is passed directly to the
Nameproperty of anAWS::AppSync::DataSourceresource. ServiceRoleArn-
The AWS Identity and Access Management (IAM) service role ARN for the data source. The system assumes this role when accessing the data source.
Note
To revoke access to your data source, remove the Lambda object from your AWS SAM template.
Type: String
Required: No. If not specified, AWS SAM will provision
Writepermissions using AWS SAM connectors.CloudFormation compatibility: This property is passed directly to the
ServiceRoleArnproperty of anAWS::AppSync::DataSourceresource.