Class DataSourceOptions
Optional configuration for data sources.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DataSourceOptions : IDataSourceOptions
Syntax (vb)
Public Class DataSourceOptions Implements IDataSourceOptions
Remarks
ExampleMetadata: infused
Examples
var schema = new SchemaFile(new SchemaProps { FilePath = "mySchemaFile" });
var api = new GraphqlApi(this, "api", new GraphqlApiProps {
Name = "myApi",
Definition = Definition.FromSchema(schema),
EnhancedMetricsConfig = new EnhancedMetricsConfig {
DataSourceLevelMetricsBehavior = DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS,
OperationLevelMetricsConfig = OperationLevelMetricsConfig.ENABLED,
ResolverLevelMetricsBehavior = ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS
}
});
var noneDS = api.AddNoneDataSource("none", new DataSourceOptions {
MetricsConfig = DataSourceMetricsConfig.ENABLED
});
noneDS.CreateResolver("noneResolver", new BaseResolverProps {
TypeName = "Mutation",
FieldName = "addDemoMetricsConfig",
MetricsConfig = ResolverMetricsConfig.ENABLED
});
Synopsis
Constructors
| DataSourceOptions() | Optional configuration for data sources. |
Properties
| Description | The description of the data source. |
| MetricsConfig | Whether to enable enhanced metrics of the data source Value will be ignored, if |
| Name | The name of the data source, overrides the id given by cdk. |
Constructors
DataSourceOptions()
Optional configuration for data sources.
public DataSourceOptions()
Remarks
ExampleMetadata: infused
Examples
var schema = new SchemaFile(new SchemaProps { FilePath = "mySchemaFile" });
var api = new GraphqlApi(this, "api", new GraphqlApiProps {
Name = "myApi",
Definition = Definition.FromSchema(schema),
EnhancedMetricsConfig = new EnhancedMetricsConfig {
DataSourceLevelMetricsBehavior = DataSourceLevelMetricsBehavior.PER_DATA_SOURCE_METRICS,
OperationLevelMetricsConfig = OperationLevelMetricsConfig.ENABLED,
ResolverLevelMetricsBehavior = ResolverLevelMetricsBehavior.PER_RESOLVER_METRICS
}
});
var noneDS = api.AddNoneDataSource("none", new DataSourceOptions {
MetricsConfig = DataSourceMetricsConfig.ENABLED
});
noneDS.CreateResolver("noneResolver", new BaseResolverProps {
TypeName = "Mutation",
FieldName = "addDemoMetricsConfig",
MetricsConfig = ResolverMetricsConfig.ENABLED
});
Properties
Description
The description of the data source.
public string? Description { get; set; }
Property Value
Remarks
Default: - No description
MetricsConfig
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.
public DataSourceMetricsConfig? MetricsConfig { get; set; }
Property Value
Remarks
Default: - Enhance metrics are disabled
Name
The name of the data source, overrides the id given by cdk.
public string? Name { get; set; }
Property Value
Remarks
Default: - generated by cdk given the id