DataSourceOptions

class aws_cdk.aws_appsync.DataSourceOptions(*, description=None, metrics_config=None, name=None)

Bases: object

Optional configuration for data sources.

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

  • metrics_config (Optional[DataSourceMetricsConfig]) – 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

  • name (Optional[str]) – The name of the data source, overrides the id given by cdk. Default: - generated by cdk given the id

ExampleMetadata:

infused

Example:

schema = appsync.SchemaFile(file_path="mySchemaFile")
api = appsync.GraphqlApi(self, "api",
    name="myApi",
    definition=appsync.Definition.from_schema(schema),
    enhanced_metrics_config=appsync.EnhancedMetricsConfig(
        data_source_level_metrics_behavior=appsync.DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS,
        operation_level_metrics_config=appsync.OperationLevelMetricsConfig.ENABLED,
        resolver_level_metrics_behavior=appsync.ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS
    )
)

none_dS = api.add_none_data_source("none",
    metrics_config=appsync.DataSourceMetricsConfig.ENABLED
)

none_dS.create_resolver("noneResolver",
    type_name="Mutation",
    field_name="addDemoMetricsConfig",
    metrics_config=appsync.ResolverMetricsConfig.ENABLED
)

Attributes

description

The description of the data source.

Default:
  • No description

metrics_config

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

name

The name of the data source, overrides the id given by cdk.

Default:
  • generated by cdk given the id