Skip to content

Commit

Permalink
docs(aws-rds): update serverless cluster doc
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinDoue committed Dec 15, 2021
1 parent 66e9b55 commit eff911d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-rds/README.md
Expand Up @@ -579,11 +579,8 @@ You can access your Aurora Serverless DB cluster using the built-in Data API. Th
The following example shows granting Data API access to a Lamba function.

```ts
declare const vpc: ec2.Vpc;

const cluster = new rds.ServerlessCluster(this, 'AnotherCluster', {
engine: rds.DatabaseClusterEngine.AURORA_MYSQL,
vpc,
enableDataApi: true, // Optional - will be automatically set if you call grantDataApiAccess()
});

Expand All @@ -602,4 +599,7 @@ cluster.grantDataApiAccess(fn);

**Note**: To invoke the Data API, the resource will need to read the secret associated with the cluster.

**Note**: Using the Data API, you can interact with a ServerlessCluster without using its VPC. Therefore, the parameter "vpc" is optional.
The cluster will be created in a VPC, but you will know nothing about it.

To learn more about using the Data API, see the [documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html).

0 comments on commit eff911d

Please sign in to comment.