DynamoDbDataSource

class aws_cdk.aws_appsync.DynamoDbDataSource(scope, id, *, table, read_only_access=None, use_caller_credentials=None, service_role=None, api, description=None, name=None)

Bases: aws_cdk.aws_appsync.BackedDataSource

An AppSync datasource backed by a DynamoDB table.

stability :stability: experimental

__init__(scope, id, *, table, read_only_access=None, use_caller_credentials=None, service_role=None, api, description=None, name=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • table (ITable) – The DynamoDB table backing this data source [disable-awslint:ref-via-interface].

  • read_only_access (Optional[bool]) – Specify whether this DS is read only or has read and write permissions to the DynamoDB table. Default: false

  • use_caller_credentials (Optional[bool]) – use credentials of caller to access DynamoDB. Default: false

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

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

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

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

stability :stability: experimental

Return type

None

Methods

create_resolver(*, field_name, type_name, pipeline_config=None, request_mapping_template=None, response_mapping_template=None)

creates a new resolver for this datasource and API using the given properties.

Parameters
  • field_name (str) – name of the GraphQL fiel din the given type this resolver is attached to.

  • type_name (str) – name of the GraphQL type this resolver is attached to.

  • pipeline_config (Optional[List[str]]) – configuration of the pipeline resolver. Default: - no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit

  • request_mapping_template (Optional[MappingTemplate]) – The request mapping template for this resolver. Default: - No mapping template

  • response_mapping_template (Optional[MappingTemplate]) – The response mapping template for this resolver. Default: - No mapping template

stability :stability: experimental

Return type

Resolver

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

ds

the underlying CFN data source resource.

stability :stability: experimental

Return type

CfnDataSource

grant_principal

the principal of the data source to be IGrantable.

stability :stability: experimental

Return type

IPrincipal

name

the name of the data source.

stability :stability: experimental

Return type

str

node

The construct tree node associated with this construct.

Return type

ConstructNode

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool