# CfnDataSourceProps

Properties for defining a `CfnDataSource`.

Extends: CfnDataSourceProps
Used as props by: CfnDataSource

- Source: Generated code
- Type last changed: v2.234.0 · 8 Jan 2026

## 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';
const cfnDataSourceProps: appsync.CfnDataSourceProps = {
  apiId: 'apiId',
  name: 'name',
  type: 'type',

  // the properties below are optional
  description: 'description',
  dynamoDbConfig: {
    awsRegion: 'awsRegion',
    tableName: 'tableName',

    // the properties below are optional
    deltaSyncConfig: {
      baseTableTtl: 'baseTableTtl',
      deltaSyncTableName: 'deltaSyncTableName',
      deltaSyncTableTtl: 'deltaSyncTableTtl',
    },
    useCallerCredentials: false,
    versioned: false,
  },
  elasticsearchConfig: {
    awsRegion: 'awsRegion',
    endpoint: 'endpoint',
  },
  eventBridgeConfig: {
    eventBusArn: 'eventBusArn',
  },
  httpConfig: {
    endpoint: 'endpoint',

    // the properties below are optional
    authorizationConfig: {
      authorizationType: 'authorizationType',

      // the properties below are optional
      awsIamConfig: {
        signingRegion: 'signingRegion',
        signingServiceName: 'signingServiceName',
      },
    },
  },
  lambdaConfig: {
    lambdaFunctionArn: 'lambdaFunctionArn',
  },
  metricsConfig: 'metricsConfig',
  openSearchServiceConfig: {
    awsRegion: 'awsRegion',
    endpoint: 'endpoint',
  },
  relationalDatabaseConfig: {
    relationalDatabaseSourceType: 'relationalDatabaseSourceType',

    // the properties below are optional
    rdsHttpEndpointConfig: {
      awsRegion: 'awsRegion',
      awsSecretStoreArn: 'awsSecretStoreArn',
      dbClusterIdentifier: 'dbClusterIdentifier',

      // the properties below are optional
      databaseName: 'databaseName',
      schema: 'schema',
    },
  },
  serviceRoleArn: 'serviceRoleArn',
};
```

## Properties

- `apiId`: string (required) — Unique AWS AppSync GraphQL API identifier where this data source will be created.

- `description`: string — The description of the data source.

- `dynamoDbConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.DynamoDBConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnDataSource.DynamoDBConfigProperty.html) — AWS Region and TableName for an Amazon DynamoDB table in your account.

- `elasticsearchConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.ElasticsearchConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnDataSource.ElasticsearchConfigProperty.html) — this property has been deprecated

- `eventBridgeConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.EventBridgeConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnDataSource.EventBridgeConfigProperty.html) — An EventBridge configuration that contains a valid ARN of an event bus.

- `httpConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.HttpConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnDataSource.HttpConfigProperty.html) — Endpoints for an HTTP data source.

- `lambdaConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.LambdaConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnDataSource.LambdaConfigProperty.html) — An ARN of a Lambda function in valid ARN format.

  This can be the ARN of a Lambda function that exists in the current account or in another account.

- `metricsConfig`: string — Enables or disables enhanced data source metrics for specified data sources.

  Note that `MetricsConfig` won't be used unless the `dataSourceLevelMetricsBehavior` value is set to `PER_DATA_SOURCE_METRICS` . If the `dataSourceLevelMetricsBehavior` is set to `FULL_REQUEST_DATA_SOURCE_METRICS` instead, `MetricsConfig` will be ignored. However, you can still set its value.

  `MetricsConfig` can be `ENABLED` or `DISABLED` .

- `name`: string (required) — Friendly name for you to identify your AppSync data source after creation.

- `openSearchServiceConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.OpenSearchServiceConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnDataSource.OpenSearchServiceConfigProperty.html) — AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.

- `relationalDatabaseConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.RelationalDatabaseConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnDataSource.RelationalDatabaseConfigProperty.html) — Relational Database configuration of the relational database data source.

- `serviceRoleArn`: string | [IRoleRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) — The AWS Identity and Access Management service role ARN for the data source.

  The system assumes this role when accessing the data source.

  Required if `Type` is specified as `AWS_LAMBDA` , `AMAZON_DYNAMODB` , `AMAZON_ELASTICSEARCH` , `AMAZON_EVENTBRIDGE` , `AMAZON_OPENSEARCH_SERVICE` , `RELATIONAL_DATABASE` , or `AMAZON_BEDROCK_RUNTIME` .

- `type`: string (required) — The type of the data source.

  - *AWS_LAMBDA* : The data source is an AWS Lambda function.
  - *AMAZON_DYNAMODB* : The data source is an Amazon DynamoDB table.
  - *AMAZON_ELASTICSEARCH* : The data source is an Amazon OpenSearch Service domain.
  - *AMAZON_EVENTBRIDGE* : The data source is an Amazon EventBridge event bus.
  - *AMAZON_OPENSEARCH_SERVICE* : The data source is an Amazon OpenSearch Service domain.
  - *AMAZON_BEDROCK_RUNTIME* : The data source is the Amazon Bedrock runtime.
  - *NONE* : There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked from a mutation.
  - *HTTP* : The data source is an HTTP endpoint.
  - *RELATIONAL_DATABASE* : The data source is a relational database.
