@mstuercke/pulumi-modules 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/postgres/Postgres.d.ts +16 -0
- package/dist/postgres/Postgres.js +31 -0
- package/dist/postgres/index.d.ts +6 -0
- package/dist/postgres/index.js +5 -0
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './domain/index.ts';
|
|
|
3
3
|
export * from './iam/index.ts';
|
|
4
4
|
export * from './lambda/index.ts';
|
|
5
5
|
export * from './mongodb/index.ts';
|
|
6
|
+
export * from './postgres/index.ts';
|
|
6
7
|
export * from './rest/index.ts';
|
|
7
8
|
export * from './s3/index.ts';
|
|
8
9
|
export * from './website/index.ts';
|
|
@@ -25,6 +26,9 @@ export declare const mstuercke: {
|
|
|
25
26
|
MongoDBDefaultInstance: typeof import("./mongodb/MongoDBDefaultInstance.ts").MongoDBDefaultInstance;
|
|
26
27
|
MongoDBUser: typeof import("./mongodb/MongoDBUser.ts").MongoDBUser;
|
|
27
28
|
};
|
|
29
|
+
postgres: {
|
|
30
|
+
Postgres: typeof import("./postgres/Postgres.ts").Postgres;
|
|
31
|
+
};
|
|
28
32
|
rest: {
|
|
29
33
|
RestApi: typeof import("./rest/RestApi.ts").RestApi;
|
|
30
34
|
};
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { iam } from "./iam/index.js";
|
|
|
4
4
|
import { rest } from "./rest/index.js";
|
|
5
5
|
import { lambda } from "./lambda/index.js";
|
|
6
6
|
import { mongodb } from "./mongodb/index.js";
|
|
7
|
+
import { postgres } from "./postgres/index.js";
|
|
7
8
|
import { s3 } from "./s3/index.js";
|
|
8
9
|
import { website } from "./website/index.js";
|
|
9
10
|
import { websocket } from "./websocket/index.js";
|
|
@@ -12,6 +13,7 @@ export * from "./domain/index.js";
|
|
|
12
13
|
export * from "./iam/index.js";
|
|
13
14
|
export * from "./lambda/index.js";
|
|
14
15
|
export * from "./mongodb/index.js";
|
|
16
|
+
export * from "./postgres/index.js";
|
|
15
17
|
export * from "./rest/index.js";
|
|
16
18
|
export * from "./s3/index.js";
|
|
17
19
|
export * from "./website/index.js";
|
|
@@ -22,6 +24,7 @@ export const mstuercke = {
|
|
|
22
24
|
iam,
|
|
23
25
|
lambda,
|
|
24
26
|
mongodb,
|
|
27
|
+
postgres,
|
|
25
28
|
rest,
|
|
26
29
|
s3,
|
|
27
30
|
website,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Input, Resource } from '@pulumi/pulumi';
|
|
2
|
+
export type PostgresOptions = {
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
neonProjectId: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
environmentName: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class Postgres extends Resource {
|
|
9
|
+
readonly connectionUrl: Input<string>;
|
|
10
|
+
readonly host: Input<string>;
|
|
11
|
+
readonly databaseName: Input<string>;
|
|
12
|
+
readonly username: Input<string>;
|
|
13
|
+
readonly password: Input<string>;
|
|
14
|
+
constructor(name: string, options: PostgresOptions);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Postgres.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { interpolate, Resource } from '@pulumi/pulumi';
|
|
2
|
+
import { Database, Project, Provider, Role } from '@mstuercke/pulumi-neon';
|
|
3
|
+
export class Postgres extends Resource {
|
|
4
|
+
connectionUrl;
|
|
5
|
+
host;
|
|
6
|
+
databaseName;
|
|
7
|
+
username;
|
|
8
|
+
password;
|
|
9
|
+
constructor(name, options) {
|
|
10
|
+
super(`mstuercke:postgres:Postgres`, name, false);
|
|
11
|
+
const { apiKey, neonProjectId, projectId, environmentName } = options;
|
|
12
|
+
new Provider('provider', { apiKey });
|
|
13
|
+
const project = Project.get(name, neonProjectId);
|
|
14
|
+
const role = new Role(name, {
|
|
15
|
+
name: `${projectId}-${environmentName}`,
|
|
16
|
+
projectId: project.id,
|
|
17
|
+
branchId: project.defaultBranchId,
|
|
18
|
+
}, { parent: this });
|
|
19
|
+
const database = new Database(name, {
|
|
20
|
+
name: environmentName,
|
|
21
|
+
projectId: project.id,
|
|
22
|
+
branchId: project.defaultBranchId,
|
|
23
|
+
ownerName: role.name,
|
|
24
|
+
}, { parent: this });
|
|
25
|
+
this.connectionUrl = interpolate `postgresql://${role.name}:${role.password}@${project.databaseHost}/${database.name}?sslmode=require`;
|
|
26
|
+
this.host = project.databaseHost;
|
|
27
|
+
this.databaseName = database.name;
|
|
28
|
+
this.username = role.name;
|
|
29
|
+
this.password = role.password;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mstuercke/pulumi-modules",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/**/!(*.test|*.fixture){.d.ts,.js}",
|
|
6
6
|
"README.md"
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
"release": "node --no-warnings --loader ts-node/esm scripts/release.ts"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
+
"@mstuercke/pulumi-neon": "0.0.1",
|
|
19
20
|
"@pulumi/archive": "^0.3.0",
|
|
20
21
|
"@pulumi/auth0": "^3.8.1",
|
|
21
22
|
"@pulumi/aws": "^6.56.1",
|
|
22
23
|
"@pulumi/mongodbatlas": "^3.20.2",
|
|
23
|
-
"@pulumi/pulumi": "^3.
|
|
24
|
+
"@pulumi/pulumi": "^3.142.0",
|
|
24
25
|
"@pulumi/random": "^4.16.7",
|
|
25
26
|
"@pulumiverse/sentry": "^0.0.9",
|
|
26
27
|
"@types/mime": "^3.0.4",
|