# RdsDataSourcePropsV2

Properties for an AppSync RDS datasource Aurora Serverless V2.

Extends: RdsDataSourcePropsV2
Extends: BackedDataSourceProps

- Source: [`aws-appsync/lib/data-source.ts`](https://github.com/aws/aws-cdk/blob/v2.273.0/packages/aws-cdk-lib/aws-appsync/lib/data-source.ts#L435)
- Type last changed: v2.138.0 · 18 Apr 2024

## 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_iam as iam } from 'aws-cdk-lib';
import { aws_rds as rds } from 'aws-cdk-lib';
import { aws_secretsmanager as secretsmanager } from 'aws-cdk-lib';
import { aws_appsync as interfaces_appsync } from 'aws-cdk-lib/interfaces';

declare const databaseCluster: rds.DatabaseCluster;
declare const graphQLApiRef: interfaces_appsync.IGraphQLApiRef;
declare const role: iam.Role;
declare const secret: secretsmanager.Secret;
const rdsDataSourcePropsV2: appsync.RdsDataSourcePropsV2 = {
  api: graphQLApiRef,
  secretStore: secret,
  serverlessCluster: databaseCluster,

  // the properties below are optional
  databaseName: 'databaseName',
  description: 'description',
  metricsConfig: appsync.DataSourceMetricsConfig.ENABLED,
  name: 'name',
  serviceRole: role,
};
```

## Properties

- `api`: [IGraphQLApiRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_appsync.IGraphQLApiRef.html) (required) — The API to attach this data source to.

- `databaseName`: string = None — The name of the database to use within the cluster.

- `description`: string = None — the description of the data source.

- `metricsConfig`: [DataSourceMetricsConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.DataSourceMetricsConfig.html) = no metrics configuration — 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`.

- `name`: string = id of data source — The name of the data source.

- `secretStore`: [ISecret](/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) (required) — The secret containing the credentials for the database.

- `serverlessCluster`: [IDatabaseCluster](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.IDatabaseCluster.html) (required) — The serverless cluster to call to interact with this data source.

- `serviceRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) = Create a new role — The IAM service role to be assumed by AppSync to interact with the data source.
