Skip to content
v2.277.0

BaseDataSourceProps Struct ​

Base properties for an AppSync 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_appsync as interfaces_appsync } from 'aws-cdk-lib/interfaces';

declare const graphQLApiRef: interfaces_appsync.IGraphQLApiRef;
const baseDataSourceProps: appsync.BaseDataSourceProps = {
  api: graphQLApiRef,

  // the properties below are optional
  description: 'description',
  metricsConfig: appsync.DataSourceMetricsConfig.ENABLED,
  name: 'name',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync
from aws_cdk.interfaces import aws_appsync as interfaces_appsync

# graph_ql_api_ref: interfaces_appsync.IGraphQLApiRef

base_data_source_props = appsync.BaseDataSourceProps(
    api=graph_ql_api_ref,

    # the properties below are optional
    description="description",
    metrics_config=appsync.DataSourceMetricsConfig.ENABLED,
    name="name"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appsync.*;
import software.amazon.awscdk.interfaces.appsync.*;

IGraphQLApiRef graphQLApiRef;

BaseDataSourceProps baseDataSourceProps = BaseDataSourceProps.builder()
        .api(graphQLApiRef)

        // the properties below are optional
        .description("description")
        .metricsConfig(DataSourceMetricsConfig.ENABLED)
        .name("name")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppSync;
using Amazon.CDK.Interfaces.AppSync;

IGraphQLApiRef graphQLApiRef;

var baseDataSourceProps = new BaseDataSourceProps {
    Api = graphQLApiRef,

    // the properties below are optional
    Description = "description",
    MetricsConfig = DataSourceMetricsConfig.ENABLED,
    Name = "name"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var graphQLApiRef IGraphQLApiRef

baseDataSourceProps := &BaseDataSourceProps{
	Api: graphQLApiRef,

	// the properties below are optional
	Description: jsii.String("description"),
	MetricsConfig: awscdk.Aws_appsync.DataSourceMetricsConfig_ENABLED,
	Name: jsii.String("name"),
}

Properties ​

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