Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Windows Tipps & SecurityThe Blood of Dawnwalker Director Says 60 FPS Is Enough for This RPG(23.09.2026 um 14:37 Uhr)
Windows Tipps & SecurityMeyer Sound ernennt John McMahon zum Chief Operating Officer(23.09.2026 um 11:19 Uhr)
Windows Tipps & SecurityTouchscreen erweitert Grill-Sortiment am Point of Sale(23.09.2026 um 13:45 Uhr)
Windows Tipps & Security„When Worlds Unite“: ISE 2027 erweitert Messe und Programm(23.09.2026 um 13:45 Uhr)
Sichere ProgrammierungWhat Full-Stack AI Engineering Means in Real Projects(23.09.2026 um 14:00 Uhr)
Sichere ProgrammierungThe Internet Changes Everything (Slowly)(23.09.2026 um 14:09 Uhr)
Sichere ProgrammierungMAUI vs React Native vs Flutter vs Ionic(23.09.2026 um 14:09 Uhr)
Sichere ProgrammierungAI Tools Used in Modern Software Development(23.09.2026 um 14:22 Uhr)
Sichere ProgrammierungHealthAuditor — Website Health & SEO Audit Tool(23.09.2026 um 14:24 Uhr)
Windows Tipps & SecurityThe Blood of Dawnwalker Director Says 60 FPS Is Enough for This RPG(23.09.2026 um 14:37 Uhr)
Windows Tipps & SecurityMeyer Sound ernennt John McMahon zum Chief Operating Officer(23.09.2026 um 11:19 Uhr)
Windows Tipps & SecurityTouchscreen erweitert Grill-Sortiment am Point of Sale(23.09.2026 um 13:45 Uhr)
Windows Tipps & Security„When Worlds Unite“: ISE 2027 erweitert Messe und Programm(23.09.2026 um 13:45 Uhr)
Sichere ProgrammierungWhat Full-Stack AI Engineering Means in Real Projects(23.09.2026 um 14:00 Uhr)
Sichere ProgrammierungThe Internet Changes Everything (Slowly)(23.09.2026 um 14:09 Uhr)
Sichere ProgrammierungMAUI vs React Native vs Flutter vs Ionic(23.09.2026 um 14:09 Uhr)
Sichere ProgrammierungAI Tools Used in Modern Software Development(23.09.2026 um 14:22 Uhr)
Sichere ProgrammierungHealthAuditor — Website Health & SEO Audit Tool(23.09.2026 um 14:24 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Aurora PostgreSQL Serverless (Express configuration) with CDK and Drizzle

Introduction This post documents a setup for Aurora PostgreSQL express configuration with: AWS CDK deployment an AWS SDK-based custom resource (because CloudFormation support is not available yet) Drizzle Kit and Drizzle Studio for…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Introduction



This post documents a setup for Aurora PostgreSQL express configuration with:




  • AWS CDK deployment

  • an AWS SDK-based custom resource (because CloudFormation support is not available yet)

  • Drizzle Kit and Drizzle Studio for schema and data verification



The setup is not production-ready, but it can be used as a starting point for further development.



AWS launch post:

Announcing Amazon Aurora PostgreSQL Serverless database creation in seconds





CDK Custom Resource



Aurora express configuration currently requires calling the RDS API directly. In this setup, CDK uses AwsCustomResource with CreateDBCluster and cleanup calls.



API reference:

CreateDBClusterCommand




import { Names, Stack } from "aws-cdk-lib";
import { Effect, PolicyStatement } from "aws-cdk-lib/aws-iam";
import {
AwsCustomResource,
AwsCustomResourcePolicy,
PhysicalResourceId,
} from "aws-cdk-lib/custom-resources";
import { NagSuppressions } from "cdk-nag";
import { Construct } from "constructs";

export type DbAuroraExpressDummyProps = {
databaseName: string;
maxCapacity: number;
minCapacity: number;
schemaName: string;
};

const toIdentifier = (value: string, maxLength: number): string => {
const normalized = value.toLowerCase().replace(/[^a-z0-9-]/g, "-");
const compacted = normalized.replace(/-+/g, "-").replace(/^-|-$/g, "");
if (compacted.length <= maxLength) {
return compacted;
}
return compacted.slice(0, maxLength).replace(/-+$/g, "");
};

export class DbAuroraExpressDummy extends Construct {
public readonly clusterArn: string;
public readonly databaseName: string;
public readonly schemaName: string;

constructor(scope: Construct, id: string, props: DbAuroraExpressDummyProps) {
super(scope, id);

this.databaseName = props.databaseName;
this.schemaName = props.schemaName;
const minCapacity = props.minCapacity;
const maxCapacity = props.maxCapacity;

const stack = Stack.of(this);
const baseIdentifier = toIdentifier(`${Names.uniqueId(this)}`, 63);
// Aurora Express creates an instance identifier from the cluster identifier
// (suffix like "-instance-1"), so keep the cluster id shorter than 63 chars.
const clusterIdentifier = toIdentifier(`${baseIdentifier}-aurora`, 52);

const instanceIdentifier = `${clusterIdentifier}-instance-1`;

const clusterResource = new AwsCustomResource(this, "ExpressClusterFallback", {
policy: AwsCustomResourcePolicy.fromStatements([
new PolicyStatement({
effect: Effect.ALLOW,
actions: [
"ec2:DescribeAvailabilityZones",
"iam:CreateServiceLinkedRole",
"rds:CreateDBCluster",
"rds:CreateDBInstance",
"rds:DeleteDBCluster",
"rds:DeleteDBInstance",
"rds:DescribeDBClusters",
"rds:EnableInternetAccessGateway",
],
resources: ["*"],
}),
]),
installLatestAwsSdk: true,
onCreate: {
action: "createDBCluster",
service: "RDS",
ignoreErrorCodesMatching: "DBClusterAlreadyExistsFault",
physicalResourceId: PhysicalResourceId.of(clusterIdentifier),
parameters: {
DBClusterIdentifier: clusterIdentifier,
Engine: "aurora-postgresql",
WithExpressConfiguration: true,
// Keep explicit ACU limits while using Aurora express defaults.
ServerlessV2ScalingConfiguration: {
MinCapacity: minCapacity,
MaxCapacity: maxCapacity,
},
},
},
onUpdate: {
action: "describeDBClusters",
service: "RDS",
physicalResourceId: PhysicalResourceId.of(clusterIdentifier),
parameters: {
DBClusterIdentifier: clusterIdentifier,
Engine: "aurora-postgresql",
WithExpressConfiguration: true,
// Keep explicit ACU limits while using Aurora express defaults.
ServerlessV2ScalingConfiguration: {
MinCapacity: minCapacity,
MaxCapacity: maxCapacity,
},
},
},
onDelete: {
action: "deleteDBCluster",
service: "RDS",
ignoreErrorCodesMatching: "DBClusterNotFoundFault",
parameters: {
DBClusterIdentifier: clusterIdentifier,
DeleteAutomatedBackups: true,
SkipFinalSnapshot: true,
},
},
});

const clusterLookupResource = new AwsCustomResource(this, "ExpressClusterLookup", {
policy: AwsCustomResourcePolicy.fromStatements([
new PolicyStatement({
effect: Effect.ALLOW,
actions: ["rds:DescribeDBClusters"],
resources: ["*"],
}),
]),
installLatestAwsSdk: true,
onCreate: {
action: "describeDBClusters",
service: "RDS",
physicalResourceId: PhysicalResourceId.of(`${clusterIdentifier}-lookup`),
parameters: {
DBClusterIdentifier: clusterIdentifier,
},
},
onUpdate: {
action: "describeDBClusters",
service: "RDS",
physicalResourceId: PhysicalResourceId.of(`${clusterIdentifier}-lookup`),
parameters: {
DBClusterIdentifier: clusterIdentifier,
},
},
});
clusterLookupResource.node.addDependency(clusterResource);

const instanceCleanupResource = new AwsCustomResource(this, "ExpressInstanceCleanup", {
policy: AwsCustomResourcePolicy.fromStatements([
new PolicyStatement({
effect: Effect.ALLOW,
actions: ["rds:DeleteDBInstance", "rds:DescribeDBInstances", "rds:DescribeDBClusters"],
resources: ["*"],
}),
]),
installLatestAwsSdk: true,
onCreate: {
action: "describeDBClusters",
service: "RDS",
physicalResourceId: PhysicalResourceId.of(`${clusterIdentifier}-instance-cleanup`),
parameters: {
DBClusterIdentifier: clusterIdentifier,
},
},
onUpdate: {
action: "describeDBClusters",
service: "RDS",
physicalResourceId: PhysicalResourceId.of(`${clusterIdentifier}-instance-cleanup`),
parameters: {
DBClusterIdentifier: clusterIdentifier,
},
},
onDelete: {
action: "deleteDBInstance",
service: "RDS",
ignoreErrorCodesMatching: "DBInstanceNotFoundFault|InvalidDBInstanceStateFault",
parameters: {
DBInstanceIdentifier: instanceIdentifier,
DeleteAutomatedBackups: true,
SkipFinalSnapshot: true,
},
},
});
instanceCleanupResource.node.addDependency(clusterResource);

this.clusterArn = clusterLookupResource.getResponseField("DBClusters.0.DBClusterArn");
}
}









Aurora deployment observations



From Aurora PostgreSQL express configuration documentation and deployment output:




  • The cluster is created without VPC association.

  • Internet access gateway is enabled for connectivity.

  • IAM authentication is required for gateway-based access.

  • Encryption uses an AWS/RDS managed key (a customer-managed KMS key cannot be selected at create time in this flow).

  • Data API is disabled by default at create time; it can be enabled later, with authentication constraints documented by AWS (Express configuration settings, enabling, usage and auth model). I have not managed to get Data API working with this express setup yet.



Aurora cluster deployed with express configuration






Teardown behavior



The custom resource includes explicit delete calls for both cluster and instance identifiers. During stack deletion, the cluster and instance cleanup sequence is visible in the AWS console. This is useful for ephemeral feature stacks where database infrastructure should be created and removed per branch or short-lived environment.



Aurora cluster deletion state






Drizzle integration



Drizzle is used for schema push, local studio inspection, and a simple seed script. Environment variables in this setup are managed with Varlock.



Varlock documentation



Drizzle ORM documentation



This setup was tested with the Drizzle beta track, which is expected to become v1 soon.






Required packages



Install these npm packages before running the examples:




  • Runtime dependencies:
    vp add @aws-sdk/rds-signer drizzle-orm pg varlock

  • Dev/tooling dependencies:
    vp add -D drizzle-kit @types/pg



Note: this repository uses Vite+, so commands in this post use vp wrappers (such as vp add, vp exec, and vp run) instead of direct npm or pnpm commands.






Configuration (drizzle-kit)






import { Signer } from "@aws-sdk/rds-signer";
import { defineConfig } from "drizzle-kit";
import { ENV } from "varlock/env";

const hostname = ENV.HOSTNAME;
const port = 5432;
const username = "postgres";
const database = "postgres";

const signer = new Signer({
region: ENV.AWS_REGION,
hostname,
port,
username,
});

const password = await signer.getAuthToken();

export default defineConfig({
dialect: "postgresql",
schema: "dummySchema.ts",
dbCredentials: {
host: hostname,
port,
user: username,
password,
database,
ssl: true,
},
});









Schema






import { integer, pgSchema, text } from "drizzle-orm/pg-core";

export const DUMMY_SCHEMA_NAME = "dummy";
export const dummySchema = pgSchema(DUMMY_SCHEMA_NAME);

export const dummyTable = dummySchema.table("dummy_table", {
id: integer("id").primaryKey(),
name: text("name").notNull(),
});






Run this command to apply schema changes:

vp exec varlock run -- vp exec drizzle-kit push --config=drizzle-user-password.config.ts



Run this command to open Drizzle Studio:

vp exec varlock run -- vp exec drizzle-kit studio --config=drizzle-user-password.config.ts



Studio before seeding (table exists, no rows):



Drizzle Studio before seeding






Seeding script






#!/usr/bin/env node
/* oxlint-disable no-console */

import { Signer } from "@aws-sdk/rds-signer";
import { drizzle } from "drizzle-orm/node-postgres";
import { ENV } from "varlock/env";
import { dummyTable } from "../dummySchema.ts";

const hostname = ENV.HOSTNAME;
const port = 5432;
const username = "postgres";
const database = "postgres";

const signer = new Signer({
region: ENV.AWS_REGION,
hostname,
port,
username,
});

const password = await signer.getAuthToken();

console.log(ENV.HOSTNAME);
console.log(ENV.AWS_REGION);

const db = drizzle({
connection: {
host: hostname,
port,
user: username,
password,
database,
ssl: true,
},
});

await db.delete(dummyTable);

const insertResult = await db.insert(dummyTable).values([
{ id: 1, name: "Dummy 1" },
{ id: 2, name: "Dummy 2" },
{ id: 3, name: "Dummy 3" },
]);

console.log(insertResult);






vp exec varlock run -- node scripts/seed-dummy.ts






Result




  • Schema dummy.dummy_table is created successfully via Drizzle Kit.

  • Seed script inserts three rows (id 1..3).

  • Drizzle Studio confirms data visibility through the IAM-authenticated Aurora Express connection.



Drizzle Studio after seeding with three rows






Conclusion



Aurora PostgreSQL express configuration can be integrated into a CDK workflow today by using AWS SDK custom resources for create/delete operations. Drizzle works with this setup when authentication tokens are generated through the RDS signer and passed to Drizzle tooling/runtime.






Sources and References



Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Aurora PostgreSQL Serverless (Express configuration) with CDK and Drizzle

Thematisch verwandte Begriffe: Aurora, PostgreSQL, Serverless, Express · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-5695 | Arbitrary file upload vulnerability due to a lack of proper validation in…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick