-
Notifications
You must be signed in to change notification settings - Fork 1
/
service.ts
53 lines (46 loc) · 1.78 KB
/
service.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
import * as awsx from "@pulumi/awsx";
import * as pulumi from "@pulumi/pulumi";
import { MinifluxDatabase } from "./database";
export class MinifluxService {
public endpoint: pulumi.Output<String>;
constructor(database: MinifluxDatabase, adminUsername: string, adminPassword: string) {
const listener = new awsx.lb.NetworkTargetGroup("miniflux", { port: 8080 })
.createListener("listener", { port: 80 });
const service = new awsx.ecs.FargateService("service", {
desiredCount: 1,
taskDefinitionArgs: {
containers: {
service: {
image: "miniflux/miniflux:latest",
portMappings: [
listener
],
environment: [
{
name: "DATABASE_URL",
value: database.connectionString,
},
{
name: "RUN_MIGRATIONS",
value: "1",
},
{
name: "CREATE_ADMIN",
value: "1",
},
{
name: "ADMIN_USERNAME",
value: adminUsername,
},
{
name: "ADMIN_PASSWORD",
value: adminPassword,
}
]
}
}
}
});
this.endpoint = listener.endpoint.hostname;
}
}