DBInstance
Source:
src/AWS/RDS/DBInstance.ts
An RDS database instance — either a standalone (non-Aurora) database or a
member of an Aurora DBCluster.
Exposes the full storage, backup, monitoring, performance-insights,
encryption, networking, and log-export surface of createDBInstance /
modifyDBInstance. Mutable fields are reconciled in place against the
observed cloud state; immutable fields (engine, dbName,
masterUsername, availabilityZone, storageEncrypted, kmsKeyId,
dbSubnetGroupName) force a replacement.
Standalone Instance
Section titled “Standalone Instance”const db = yield* DBInstance("Db", { engine: "mysql", dbInstanceClass: "db.t3.micro", allocatedStorage: 20, storageType: "gp3", masterUsername: "admin", masterUserPassword: Redacted.make("supersecret"), backupRetentionPeriod: 7, deletionProtection: false,});Cluster Member
Section titled “Cluster Member”const writer = yield* DBInstance("Writer", { dbClusterIdentifier: cluster.dbClusterIdentifier, dbInstanceClass: "db.serverless", engine: "aurora-postgresql",});Monitoring & Logs
Section titled “Monitoring & Logs”const db = yield* DBInstance("Db", { engine: "postgres", dbInstanceClass: "db.t3.micro", allocatedStorage: 20, monitoringInterval: 60, monitoringRoleArn: monitoringRole.roleArn, enablePerformanceInsights: true, enableCloudwatchLogsExports: ["postgresql", "upgrade"],});