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 Feb 22, 2022
1 parent b5ccea1 commit 36dff45
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/@aws-cdk/aws-rds/README.md
Expand Up @@ -635,11 +635,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 @@ -659,3 +656,11 @@ cluster.grantDataApiAccess(fn);
**Note**: To invoke the Data API, the resource will need to read the secret associated with the cluster.

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

### Default VPC

The `vpc` parameter is optional.

If not provided, the cluster will be created in the default VPC of the account and region.
As this VPC is not deployed with AWS CDK, you can't configure the `vpcSubnets`, `subnetGroup` or `securityGroups` of the Aurora Serverless Cluster.
If you want to provide one of `vpcSubnets`, `subnetGroup` or `securityGroups` parameter, please provide a `vpc`.

0 comments on commit 36dff45

Please sign in to comment.