From 4bce97cd2472c3c2084de07aa9e1207b505f5b31 Mon Sep 17 00:00:00 2001 From: Daniel Naab Date: Sat, 17 Aug 2024 10:52:09 -0500 Subject: [PATCH] Add Postgres RDS to cloud.gov environment --- infra/cdktf/src/lib/cloud.gov/node-astro.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/infra/cdktf/src/lib/cloud.gov/node-astro.ts b/infra/cdktf/src/lib/cloud.gov/node-astro.ts index a7ed8ed4..c93a1bc6 100644 --- a/infra/cdktf/src/lib/cloud.gov/node-astro.ts +++ b/infra/cdktf/src/lib/cloud.gov/node-astro.ts @@ -41,6 +41,19 @@ export class AstroService extends Construct { } ); + const dbInstance = new cloudfoundry.serviceInstance.ServiceInstance( + this, + `${id}-db`, + { + name: `${id}-db`, + servicePlan: 'micro-psql', + space: spaceId, + lifecycle: { + preventDestroy: true, + }, + } + ); + new cloudfoundry.app.App(this, `${id}-app`, { name: `${id}-app`, space: spaceId, @@ -55,6 +68,9 @@ export class AstroService extends Construct { }, ], serviceBinding: [ + { + serviceInstance: dbInstance.id, + }, { serviceInstance: loginGovService.id, },