LambdaDataSourceProps

class aws_cdk.aws_appsync.LambdaDataSourceProps(*, api, description=None, name=None, service_role=None, lambda_function)

Bases: aws_cdk.aws_appsync.BackedDataSourceProps

(experimental) Properties for an AppSync Lambda datasource.

Parameters
  • api (IGraphqlApi) – (experimental) The API to attach this data source to.

  • description (Optional[str]) – (experimental) the description of the data source. Default: - None

  • name (Optional[str]) – (experimental) The name of the data source. Default: - id of data source

  • service_role (Optional[IRole]) – (experimental) The IAM service role to be assumed by AppSync to interact with the data source. Default: - Create a new role

  • lambda_function (IFunction) – (experimental) The Lambda function to call to interact with this data source.

Stability

experimental

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_appsync as appsync
import aws_cdk.aws_iam as iam
import aws_cdk.aws_lambda as lambda_

# function_ is of type Function
# graphql_api is of type GraphqlApi
# role is of type Role

lambda_data_source_props = appsync.LambdaDataSourceProps(
    api=graphql_api,
    lambda_function=function_,

    # the properties below are optional
    description="description",
    name="name",
    service_role=role
)

Attributes

api

(experimental) The API to attach this data source to.

Stability

experimental

Return type

IGraphqlApi

description

(experimental) the description of the data source.

Default
  • None

Stability

experimental

Return type

Optional[str]

lambda_function

(experimental) The Lambda function to call to interact with this data source.

Stability

experimental

Return type

IFunction

name

(experimental) The name of the data source.

Default
  • id of data source

Stability

experimental

Return type

Optional[str]

service_role

(experimental) The IAM service role to be assumed by AppSync to interact with the data source.

Default
  • Create a new role

Stability

experimental

Return type

Optional[IRole]