Skip to content
v2.274.0

AppSyncDynamoDbDataSourceProps Struct ​

Properties for an AppSync DynamoDB datasource.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
import { aws_dynamodb as dynamodb } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_appsync as interfaces_appsync } from 'aws-cdk-lib/interfaces';

declare const apiRef: interfaces_appsync.IApiRef;
declare const role: iam.Role;
declare const table: dynamodb.Table;
const appSyncDynamoDbDataSourceProps: appsync.AppSyncDynamoDbDataSourceProps = {
  api: apiRef,
  table: table,

  // the properties below are optional
  description: 'description',
  name: 'name',
  readOnlyAccess: false,
  serviceRole: role,
  useCallerCredentials: false,
};

Properties ​

The API to attach this data source to.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string= None#
The description of the data source.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
The name of the data source.

Default: id of data source

The only allowed pattern is: {[_A-Za-z][_0-9A-Za-z]*}. Any invalid characters will be automatically removed.

readOnlyAccessoptionalbooleanread_only_accessoptionalboolreadOnlyAccessoptionalBooleanReadOnlyAccessoptionalboolReadOnlyAccessoptional*bool= false#
Specify whether this Data Source is read only or has read and write permissions to the DynamoDB table.
serviceRoleoptionalIRoleservice_roleoptionalIRoleserviceRoleoptionalIRoleServiceRoleoptionalIRoleServiceRoleoptionalIRole#
The IAM service role to be assumed by AppSync to interact with the data source.

Default: Create a new role

tableITabletableITabletableITableTableITableTableITablerequired#
The DynamoDB table backing this data source.
useCallerCredentialsoptionalbooleanuse_caller_credentialsoptionalbooluseCallerCredentialsoptionalBooleanUseCallerCredentialsoptionalboolUseCallerCredentialsoptional*bool= false#
Use credentials of caller to access DynamoDB.