-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
81 lines (69 loc) · 2.08 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import * as pulumi from "@pulumi/pulumi";
import * as render from "@cloudyskysoftware/pulumi-render";
import type { services as servicesInputs } from "@cloudyskysoftware/pulumi-render/types/input";
const ownerId = render.owners
.listOwnersOutput()
.apply(
(result) =>
result.items.filter(
(i) => i.owner?.email === "[email protected]"
)[0].owner?.id || ""
);
const staticSiteDetails: servicesInputs.StaticSiteDetailsCreateArgs = {
publishPath: "public",
};
const staticSite = new render.services.StaticSite("staticsite", {
name: "My custom static site",
ownerId,
repo: "https://github.com/cloudy-sky-software/test-static-site",
autoDeploy: "no",
branch: "main",
serviceDetails: staticSiteDetails,
type: "static_site",
});
const port = "8080";
const webServiceDetails: servicesInputs.WebServiceDetailsCreateArgs = {
env: "node",
plan: "starter",
region: "oregon",
envSpecificDetails: {
buildCommand: "yarn",
startCommand: "node app.js",
},
runtime: "node",
};
const db = new render.postgres.Postgres("db", {
ownerId,
version: "16",
databaseUser: "myuser",
databaseName: "test",
plan: "basic_256mb",
diskSizeGB: 1,
});
export const connectionInfo = render.postgres.getPostgresConnectionInfoOutput({
postgresId: db.id,
});
const webService = new render.services.WebService("webservice", {
name: "An Express.js web service",
ownerId,
repo: "https://github.com/render-examples/express-hello-world",
autoDeploy: "yes",
branch: "master",
serviceDetails: webServiceDetails,
type: "web_service",
});
new render.services.EnvVarsForService("webServiceEnvVars", {
serviceId: webService.id,
envVars: [
{
key: "PORT",
value: port,
},
{
key: "DB_URL",
value: connectionInfo.internalConnectionString,
},
],
});
export const url = staticSite.serviceDetails.apply((s) => s?.url);
export const webServiceUrl = webService.serviceDetails.apply((s) => s?.url);