Skip to main content

DataSource

Manages an AppSync DataSource.

Sample code

exports.createResources = () => [
{
type: "DataSource",
group: "AppSync",
properties: ({}) => ({
name: "lambdaDatasource",
type: "AWS_LAMBDA",
}),
dependencies: () => ({
graphqlApi: "cdk-notes-appsync-api",
serviceRole:
"AppsyncCdkAppStack-ApilambdaDatasourceServiceRole2-1BX1MTO4H3KAG",
lambdaFunction: "lambda-fns",
}),
},
];

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