Interface DataSourceOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
HttpDataSourceOptions
All Known Implementing Classes:
DataSourceOptions.Jsii$Proxy, HttpDataSourceOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-19T12:54:58.966Z") @Stability(Stable) public interface DataSourceOptions extends software.amazon.jsii.JsiiSerializable
Optional configuration for data sources.

Example:

 SchemaFile schema = SchemaFile.Builder.create().filePath("mySchemaFile").build();
 GraphqlApi api = GraphqlApi.Builder.create(this, "api")
         .name("myApi")
         .definition(Definition.fromSchema(schema))
         .enhancedMetricsConfig(EnhancedMetricsConfig.builder()
                 .dataSourceLevelMetricsBehavior(DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS)
                 .operationLevelMetricsConfig(OperationLevelMetricsConfig.ENABLED)
                 .resolverLevelMetricsBehavior(ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS)
                 .build())
         .build();
 NoneDataSource noneDS = api.addNoneDataSource("none", DataSourceOptions.builder()
         .metricsConfig(DataSourceMetricsConfig.ENABLED)
         .build());
 noneDS.createResolver("noneResolver", BaseResolverProps.builder()
         .typeName("Mutation")
         .fieldName("addDemoMetricsConfig")
         .metricsConfig(ResolverMetricsConfig.ENABLED)
         .build());
 
  • Method Details

    • getDescription

      @Stability(Stable) @Nullable default String getDescription()
      The description of the data source.

      Default: - No description

    • getMetricsConfig

      @Stability(Stable) @Nullable default DataSourceMetricsConfig getMetricsConfig()
      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: - Enhance metrics are disabled

    • getName

      @Stability(Stable) @Nullable default String getName()
      The name of the data source, overrides the id given by cdk.

      Default: - generated by cdk given the id

    • builder

      @Stability(Stable) static DataSourceOptions.Builder builder()
      Returns:
      a DataSourceOptions.Builder of DataSourceOptions