Skip to content

Commit

Permalink
Merge pull request #25 from emmanuelnk/feat/add-support-rds-postgres-…
Browse files Browse the repository at this point in the history
…instance

feat: add support for RDS postgres instances
  • Loading branch information
berenddeboer authored Jun 28, 2024
2 parents b57c7a5 + 24d6e8c commit aa111d2
Show file tree
Hide file tree
Showing 11 changed files with 459 additions and 416 deletions.
2 changes: 1 addition & 1 deletion .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
workflow: false,
},
constructsVersion: "10.3.0",
cdkVersion: "2.124.0",
cdkVersion: "2.144.0",
disableTsconfig: true,
tsconfigDev: {
compilerOptions: {
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# About

This CDK construct library makes it possible to create databases,
schemas, and roles in an Aurora Serverless or database cluster created
in that stack. Both Aurora Serverless v1 and v2 are supported.
schemas, and roles in an Aurora Serverless (v1 and v2 are supported), RDS Database Cluster or Database Instance created
in that stack.

This construct library is intended to be used in enterprise
environments, and works in isolated subnets.
Expand Down Expand Up @@ -55,7 +55,7 @@ const cluster = new rds.ServerlessCluster(this, "Cluster", {
})
```

Then create a provider which will connect to your database:
Then create a provider which will connect to your database. For a cluster:

```ts
import { Provider } from "cdk-rds-sql"
Expand All @@ -67,6 +67,17 @@ const provider = new Provider(this, "Provider", {
})
```

For an instance:
```ts
import { Provider } from "cdk-rds-sql"

const provider = new Provider(this, "Provider", {
vpc: vpc,
instance: instance,
secret: cluster.secret!,
})
```

The provider will setup a lambda, which normally lives in the same VPC
as the database. You can give a different VPC, as long as that VPC has
access to the VPC of the database. Only the provider lambda will talk
Expand Down Expand Up @@ -98,7 +109,7 @@ const provider = new Provider(this, "Provider", {

## Roles

Create a postgres role (user) as follows:
Create a postgres role (user) for a cluster as follows:

```ts
import { Role } from "cdk-rds-sql"
Expand Down
Loading

0 comments on commit aa111d2

Please sign in to comment.