# AppSyncRdsDataSourcePropsV2

Properties for an AppSync RDS datasource Aurora Serverless V2.

Extends: AppSyncRdsDataSourcePropsV2
Extends: AppSyncBackedDataSourceProps

- Source: [`aws-appsync/lib/data-source-common.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appsync/lib/data-source-common.ts#L431)
- Type last changed: v2.193.0 · 30 Apr 2025

## 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 apiRef: interfaces_appsync.IApiRef;
declare const databaseCluster: rds.DatabaseCluster;
declare const role: iam.Role;
declare const secret: secretsmanager.Secret;
const appSyncRdsDataSourcePropsV2: appsync.AppSyncRdsDataSourcePropsV2 = {
  api: apiRef,
  secretStore: secret,
  serverlessCluster: databaseCluster,

  // the properties below are optional
  databaseName: 'databaseName',
  description: 'description',
  name: 'name',
  serviceRole: role,
};
```

## Properties

- `api`: [IApiRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_appsync.IApiRef.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.

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

  **Default:** id of data source

  The only allowed pattern is: {[_A-Za-z][_0-9A-Za-z]*}.
  Any invalid characters will be automatically removed.

- `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) — The IAM service role to be assumed by AppSync to interact with the data source.

  **Default:** Create a new role
