Skip to content

Commit d3d4907

Browse files
authored
Merge pull request #23 from ExtensionEngine/feature/add-custom-postgres-version-support
Add engineVersion property to database resource for custom PostgreSQL
2 parents ae46742 + 53009af commit d3d4907

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ type DatabaseArgs = {
377377
instanceClass?: pulumi.Input<string>;
378378
enableMonitoring?: pulumi.Input<boolean>;
379379
parameterGroupName?: pulumi.Input<string>;
380+
engineVersion?: pulumi.Input<string>;
380381
tags?: pulumi.Input<{
381382
[key: string]: pulumi.Input<string>;
382383
}>;
@@ -420,6 +421,7 @@ type DatabaseReplicaArgs = {
420421
maxAllocatedStorage?: pulumi.Input<number>;
421422
instanceClass?: pulumi.Input<string>;
422423
parameterGroupName?: pulumi.Input<string>;
424+
engineVersion?: pulumi.Input<string>;
423425
tags?: pulumi.Input<{
424426
[key: string]: pulumi.Input<string>;
425427
}>;

src/components/database-replica.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export type DatabaseReplicaArgs = {
5050
* DB parameters to this instance.
5151
*/
5252
parameterGroupName?: pulumi.Input<string>;
53+
/**
54+
* The DB engine version. Defaults to '15.5'.
55+
*/
56+
engineVersion?: pulumi.Input<string>;
5357
/**
5458
* A map of tags to assign to the resource.
5559
*/
@@ -65,6 +69,7 @@ const defaults = {
6569
maxAllocatedStorage: 100,
6670
instanceClass: 'db.t4g.micro',
6771
enableMonitoring: false,
72+
engineVersion: '15.5',
6873
};
6974

7075
export class DatabaseReplica extends pulumi.ComponentResource {
@@ -107,7 +112,7 @@ export class DatabaseReplica extends pulumi.ComponentResource {
107112
{
108113
identifierPrefix: `${this.name}-`,
109114
engine: 'postgres',
110-
engineVersion: '15.5',
115+
engineVersion: argsWithDefaults.engineVersion,
111116
allocatedStorage: argsWithDefaults.allocatedStorage,
112117
maxAllocatedStorage: argsWithDefaults.maxAllocatedStorage,
113118
instanceClass: argsWithDefaults.instanceClass,

src/components/database.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,15 @@ export type DatabaseArgs = {
6565
*/
6666
parameterGroupName?: pulumi.Input<string>;
6767
/**
68-
* Specifies whether or not to create this database from a snapshot.
68+
* Specifies whether to create this database from a snapshot.
6969
* This correlates to the snapshot ID you'd find in the RDS console,
7070
* e.g: rds:production-2015-06-26-06-05.
7171
*/
7272
snapshotIdentifier?: pulumi.Input<string>;
73+
/**
74+
* The DB engine version. Defaults to '15.5'.
75+
*/
76+
engineVersion?: pulumi.Input<string>;
7377
/**
7478
* A map of tags to assign to the resource.
7579
*/
@@ -87,6 +91,7 @@ const defaults = {
8791
instanceClass: 'db.t4g.micro',
8892
enableMonitoring: false,
8993
allowMajorVersionUpgrade: false,
94+
engineVersion: '15.5',
9095
};
9196

9297
export class Database extends pulumi.ComponentResource {
@@ -252,7 +257,7 @@ export class Database extends pulumi.ComponentResource {
252257
{
253258
identifierPrefix: `${this.name}-`,
254259
engine: 'postgres',
255-
engineVersion: '15.5',
260+
engineVersion: argsWithDefaults.engineVersion,
256261
allocatedStorage: argsWithDefaults.allocatedStorage,
257262
maxAllocatedStorage: argsWithDefaults.maxAllocatedStorage,
258263
instanceClass: argsWithDefaults.instanceClass,

0 commit comments

Comments
 (0)