interface DataSourceOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.AppSync.DataSourceOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsappsync#DataSourceOptions |
Java | software.amazon.awscdk.services.appsync.DataSourceOptions |
Python | aws_cdk.aws_appsync.DataSourceOptions |
TypeScript (source) | aws-cdk-lib » aws_appsync » DataSourceOptions |
Optional configuration for data sources.
Example
const schema = new appsync.SchemaFile({ filePath: 'mySchemaFile' })
const api = new appsync.GraphqlApi(this, 'api', {
name: 'myApi',
definition: appsync.Definition.fromSchema(schema),
enhancedMetricsConfig: {
dataSourceLevelMetricsBehavior: appsync.DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS,
operationLevelMetricsConfig: appsync.OperationLevelMetricsConfig.ENABLED,
resolverLevelMetricsBehavior: appsync.ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS,
},
});
const noneDS = api.addNoneDataSource('none', {
metricsConfig: appsync.DataSourceMetricsConfig.ENABLED,
});
noneDS.createResolver('noneResolver', {
typeName: 'Mutation',
fieldName: 'addDemoMetricsConfig',
metricsConfig: appsync.ResolverMetricsConfig.ENABLED,
});
Properties
| Name | Type | Description |
|---|---|---|
| description? | string | The description of the data source. |
| metrics | Data | 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. |
| name? | string | The name of the data source, overrides the id given by cdk. |
description?
Type:
string
(optional, default: No description)
The description of the data source.
metricsConfig?
Type:
Data
(optional, default: Enhance metrics are disabled)
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.
name?
Type:
string
(optional, default: generated by cdk given the id)
The name of the data source, overrides the id given by cdk.

.NET
Go
Java
Python
TypeScript (