Skip to content
v2.274.0

BackedDataSource ​

Abstract AppSync datasource implementation.

Do not use directly but use subclasses for resource backed datasources

Initializer ​

ts
new BackedDataSource(scope: Construct, id: string, props: BackedDataSourceProps, extended: ExtendedDataSourceProps)
python
BackedDataSource(scope: Construct, id: str, props: BackedDataSourceProps, extended: ExtendedDataSourceProps)
java
new BackedDataSource(Construct scope, String id, BackedDataSourceProps props, ExtendedDataSourceProps extended)
csharp
new BackedDataSource(Construct scope, string id, BackedDataSourceProps props, ExtendedDataSourceProps extended)
go
NewBackedDataSource(Scope Construct, Id *string, Props BackedDataSourceProps, Extended ExtendedDataSourceProps)

Construct Props ​

The API to attach this data source to.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string= None#
the description of the data source.
metricsConfigoptionalDataSourceMetricsConfigmetrics_configoptionalDataSourceMetricsConfigmetricsConfigoptionalDataSourceMetricsConfigMetricsConfigoptionalDataSourceMetricsConfigMetricsConfigoptionalDataSourceMetricsConfig#
Whether to enable enhanced metrics of the data source Value will be ignored, if `enhancedMetricsConfig.dataSourceLevelMetricsBehavior` on AppSync GraphqlApi construct is set to `FULL_REQUEST_DATA_SOURCE_METRICS`.

Default: no metrics configuration

nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
The name of the data source.

Default: id of data source

serviceRoleoptionalIRoleservice_roleoptionalIRoleserviceRoleoptionalIRoleServiceRoleoptionalIRoleServiceRoleoptionalIRole#
The IAM service role to be assumed by AppSync to interact with the data source.

Default: Create a new role

Construct Props ​

dynamoDbConfigoptionalIResolvable | CfnDataSource.DynamoDBConfigPropertydynamo_db_configoptionaltyping.Union[IResolvable, DynamoDBConfigProperty]dynamoDbConfigoptionalIResolvableDynamoDbConfigoptionalIResolvableDynamoDbConfigoptionalinterface{}#
configuration for DynamoDB Datasource.

Default: No config

elasticsearchConfigoptionalIResolvable | CfnDataSource.ElasticsearchConfigPropertyelasticsearch_configoptionaltyping.Union[IResolvable, ElasticsearchConfigProperty]elasticsearchConfigoptionalIResolvableElasticsearchConfigoptionalIResolvableElasticsearchConfigoptionalinterface{}deprecated#
- use `openSearchConfig`

Default: No config

eventBridgeConfigoptionalIResolvable | CfnDataSource.EventBridgeConfigPropertyevent_bridge_configoptionaltyping.Union[IResolvable, EventBridgeConfigProperty]eventBridgeConfigoptionalIResolvableEventBridgeConfigoptionalIResolvableEventBridgeConfigoptionalinterface{}#
configuration for EventBridge Datasource.

Default: No config

httpConfigoptionalIResolvable | CfnDataSource.HttpConfigPropertyhttp_configoptionaltyping.Union[IResolvable, HttpConfigProperty]httpConfigoptionalIResolvableHttpConfigoptionalIResolvableHttpConfigoptionalinterface{}#
configuration for HTTP Datasource.

Default: No config

lambdaConfigoptionalIResolvable | CfnDataSource.LambdaConfigPropertylambda_configoptionaltyping.Union[IResolvable, LambdaConfigProperty]lambdaConfigoptionalIResolvableLambdaConfigoptionalIResolvableLambdaConfigoptionalinterface{}#
configuration for Lambda Datasource.

Default: No config

openSearchServiceConfigoptionalIResolvable | CfnDataSource.OpenSearchServiceConfigPropertyopen_search_service_configoptionaltyping.Union[IResolvable, OpenSearchServiceConfigProperty]openSearchServiceConfigoptionalIResolvableOpenSearchServiceConfigoptionalIResolvableOpenSearchServiceConfigoptionalinterface{}#
configuration for OpenSearch data source.

Default: No config

relationalDatabaseConfigoptionalIResolvable | CfnDataSource.RelationalDatabaseConfigPropertyrelational_database_configoptionaltyping.Union[IResolvable, RelationalDatabaseConfigProperty]relationalDatabaseConfigoptionalIResolvableRelationalDatabaseConfigoptionalIResolvableRelationalDatabaseConfigoptionalinterface{}#
configuration for RDS Datasource.

Default: No config

typestringtypestrtypeStringTypestringType*stringrequired#
the type of the AppSync datasource.

Properties ​

the underlying CFN data source resource.
grantPrincipalIPrincipalgrant_principalIPrincipalgrantPrincipalIPrincipalGrantPrincipalIPrincipalGrantPrincipalIPrincipalrequired#
the principal of the data source to be IGrantable.
namestringnamestrnameStringNamestringName*stringrequired#
the name of the data source.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.

Methods ​

createFunction(id: string, props: BaseAppsyncFunctionProps): AppsyncFunctiondef create_function(self, id: str, props: BaseAppsyncFunctionProps) -> AppsyncFunctionpublic AppsyncFunction createFunction(String id, BaseAppsyncFunctionProps props)public AppsyncFunction CreateFunction(string id, BaseAppsyncFunctionProps props)func CreateFunction(Id *string, Props BaseAppsyncFunctionProps) AppsyncFunction#
creates a new appsync function for this datasource and API using the given properties.
createResolver(id: string, props: BaseResolverProps): Resolverdef create_resolver(self, id: str, props: BaseResolverProps) -> Resolverpublic Resolver createResolver(String id, BaseResolverProps props)public Resolver CreateResolver(string id, BaseResolverProps props)func CreateResolver(Id *string, Props BaseResolverProps) Resolver#
creates a new resolver for this datasource and API using the given properties.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining