Skip to main content

DataSource

Manages an AppSync DataSource.

Sample code#

provider.AppSync.makeDataSource({
name: "lambdaDatasource",
properties: ({ config }) => ({
type: "AWS_LAMBDA",
}),
dependencies: ({ resources }) => ({
serviceRole:
resources.IAM.Role
.appsyncCdkAppStackApilambdaDatasourceServiceRole2_1Bx1Mto4H3Kag,
graphqlApi: resources.AppSync.GraphqlApi.cdkNotesAppsyncApi,
lambdaFunction: resources.Lambda.Function.lambdaFns,
}),
});

Properties#

Dependencies#

Full Examples#

List#

The DataSources can be filtered with the DataSource type:

gc l -t DataSource
Listing resources on 1 provider: aws
✓ aws
✓ Initialising
✓ Listing 6/6
┌───────────────────────────────────────────────────────────────────────────────────┐
│ 1 AppSync::DataSource from aws │
├───────────────────────────────────────────────────────────────────────────────────┤
│ name: lambdaDatasource │
│ managedByUs: Yes │
│ live: │
│ dataSourceArn: arn:aws:appsync:eu-west-2:840541460064:apis/2lufvsvnrrhajlz2suw… │
│ name: lambdaDatasource │
│ description: null │
│ type: AWS_LAMBDA │
│ serviceRoleArn: arn:aws:iam::840541460064:role/AppsyncCdkAppStack-ApilambdaDat… │
│ lambdaConfig: │
│ lambdaFunctionArn: arn:aws:lambda:eu-west-2:840541460064:function:lambda-fns │
│ apiId: 2lufvsvnrrhajlz2suwx4nt6vy │
│ tags: │
│ gc-managed-by: grucloud │
│ gc-project-name: aws-appsync-graphql │
│ gc-stage: dev │
│ gc-created-by-provider: aws │
│ Name: cdk-notes-appsync-api │
│ name: lambdaDatasource │
│ │
└───────────────────────────────────────────────────────────────────────────────────┘
List Summary:
Provider: aws
┌──────────────────────────────────────────────────────────────────────────────────┐
│ aws │
├─────────────────────┬────────────────────────────────────────────────────────────┤
│ AppSync::DataSource │ lambdaDatasource │
└─────────────────────┴────────────────────────────────────────────────────────────┘
1 resource, 1 type, 1 provider
Command "gc l -t DataSource" executed in 13s