dcl-ops-lib 5.18.0 → 5.20.0
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/acceptAlb.d.ts +4 -0
- package/acceptAlb.js +14 -1
- package/acceptBastion.d.ts +3 -0
- package/acceptBastion.js +19 -1
- package/accessTheInternet.d.ts +8 -0
- package/accessTheInternet.js +41 -1
- package/createFargateTask.js +22 -26
- package/exposePublicService.js +2 -2
- package/lambda.js +1 -1
- package/package.json +4 -4
- package/prometheus.d.ts +3 -1
- package/prometheus.js +14 -3
- package/values.d.ts +4 -0
- package/values.js +2 -0
package/acceptAlb.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import * as awsx from "@pulumi/awsx";
|
|
2
|
+
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlb instead */
|
|
2
3
|
export declare const acceptAlbSecurityGroup: () => Promise<awsx.ec2.SecurityGroup>;
|
|
4
|
+
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlb instead */
|
|
3
5
|
export declare function acceptAlbSecurityGroupId(): Promise<import("@pulumi/pulumi").Output<string>>;
|
|
6
|
+
/** Makes a given securityGropup accesible by the shared supra ALB */
|
|
7
|
+
export declare function makeSecurityGroupAccessibleFromSharedAlb(securityGroup: awsx.ec2.SecurityGroup): void;
|
|
4
8
|
export default acceptAlbSecurityGroup;
|
package/acceptAlb.js
CHANGED
|
@@ -9,19 +9,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.acceptAlbSecurityGroupId = exports.acceptAlbSecurityGroup = void 0;
|
|
12
|
+
exports.makeSecurityGroupAccessibleFromSharedAlb = exports.acceptAlbSecurityGroupId = exports.acceptAlbSecurityGroup = void 0;
|
|
13
13
|
const awsx = require("@pulumi/awsx");
|
|
14
14
|
const values_1 = require("./values");
|
|
15
15
|
const withCache_1 = require("./withCache");
|
|
16
|
+
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlb instead */
|
|
16
17
|
exports.acceptAlbSecurityGroup = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const config = yield (0, values_1.getEnvConfiguration)();
|
|
18
19
|
return awsx.ec2.SecurityGroup.fromExistingId(`accept-alb-sg-reference`, config.acceptAlb);
|
|
19
20
|
}));
|
|
21
|
+
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlb instead */
|
|
20
22
|
function acceptAlbSecurityGroupId() {
|
|
21
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
24
|
return (yield (0, exports.acceptAlbSecurityGroup)()).id;
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
exports.acceptAlbSecurityGroupId = acceptAlbSecurityGroupId;
|
|
28
|
+
/** Makes a given securityGropup accesible by the shared supra ALB */
|
|
29
|
+
function makeSecurityGroupAccessibleFromSharedAlb(securityGroup) {
|
|
30
|
+
new awsx.ec2.IngressSecurityGroupRule("accept-alb-ingress-rule", securityGroup, {
|
|
31
|
+
sourceSecurityGroupId: (0, values_1.getEnvConfiguration)().then(($) => $.albSecurityGroupId),
|
|
32
|
+
description: `Allow access from the supra ALB`,
|
|
33
|
+
fromPort: 0,
|
|
34
|
+
toPort: 0,
|
|
35
|
+
protocol: "-1",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
exports.makeSecurityGroupAccessibleFromSharedAlb = makeSecurityGroupAccessibleFromSharedAlb;
|
|
26
39
|
exports.default = exports.acceptAlbSecurityGroup;
|
|
27
40
|
//# sourceMappingURL=acceptAlb.js.map
|
package/acceptBastion.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as awsx from "@pulumi/awsx";
|
|
2
|
+
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
2
3
|
export declare const acceptBastionSecurityGroup: () => Promise<awsx.ec2.SecurityGroup>;
|
|
4
|
+
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
3
5
|
export declare function acceptBastionSecurityGroupId(): Promise<import("@pulumi/pulumi").Output<string>>;
|
|
6
|
+
export declare function makeSecurityGroupAccessibleFromBastion(securityGroup: awsx.ec2.SecurityGroup): void;
|
|
4
7
|
export default acceptBastionSecurityGroup;
|
package/acceptBastion.js
CHANGED
|
@@ -9,19 +9,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.acceptBastionSecurityGroupId = exports.acceptBastionSecurityGroup = void 0;
|
|
12
|
+
exports.makeSecurityGroupAccessibleFromBastion = exports.acceptBastionSecurityGroupId = exports.acceptBastionSecurityGroup = void 0;
|
|
13
13
|
const awsx = require("@pulumi/awsx");
|
|
14
|
+
const aws = require("@pulumi/aws");
|
|
14
15
|
const values_1 = require("./values");
|
|
15
16
|
const withCache_1 = require("./withCache");
|
|
17
|
+
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
16
18
|
exports.acceptBastionSecurityGroup = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
19
|
const config = yield (0, values_1.getEnvConfiguration)();
|
|
18
20
|
return awsx.ec2.SecurityGroup.fromExistingId(`accept-bastion-sg-reference`, config.acceptBastion);
|
|
19
21
|
}));
|
|
22
|
+
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
20
23
|
function acceptBastionSecurityGroupId() {
|
|
21
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
25
|
return (yield (0, exports.acceptBastionSecurityGroup)()).id;
|
|
23
26
|
});
|
|
24
27
|
}
|
|
25
28
|
exports.acceptBastionSecurityGroupId = acceptBastionSecurityGroupId;
|
|
29
|
+
const bastionSecurityGroupId = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
const config = yield (0, values_1.getEnvConfiguration)();
|
|
31
|
+
return config.bastionSecurityGroupId;
|
|
32
|
+
}));
|
|
33
|
+
function makeSecurityGroupAccessibleFromBastion(securityGroup) {
|
|
34
|
+
new aws.ec2.SecurityGroupRule("accesible-from-bastion", {
|
|
35
|
+
securityGroupId: securityGroup.id,
|
|
36
|
+
sourceSecurityGroupId: bastionSecurityGroupId(),
|
|
37
|
+
fromPort: -1,
|
|
38
|
+
toPort: -1,
|
|
39
|
+
type: "ingress",
|
|
40
|
+
protocol: "-1",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.makeSecurityGroupAccessibleFromBastion = makeSecurityGroupAccessibleFromBastion;
|
|
26
44
|
exports.default = exports.acceptBastionSecurityGroup;
|
|
27
45
|
//# sourceMappingURL=acceptBastion.js.map
|
package/accessTheInternet.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import * as awsx from "@pulumi/awsx";
|
|
2
|
+
/** @deprecated please use makeSecurityGroupAccessibleByCloudflare */
|
|
2
3
|
export declare const accessCloudflareSecurityGroup: () => Promise<awsx.ec2.SecurityGroup>;
|
|
4
|
+
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
3
5
|
export declare const accessTheInternetSecurityGroup: () => Promise<awsx.ec2.SecurityGroup>;
|
|
6
|
+
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
4
7
|
export declare function accessTheInternetSecurityGroupId(): Promise<import("@pulumi/pulumi").Output<string>>;
|
|
5
8
|
export default accessTheInternetSecurityGroup;
|
|
9
|
+
/** @deprecated please use makeSecurityGroupAccessibleByCloudflare */
|
|
6
10
|
export declare function accessFromCloudflareSecurityGroup(): Promise<import("@pulumi/pulumi").Output<string>>;
|
|
11
|
+
/** Enables egress traffic to 0.0.0.0/0/all */
|
|
12
|
+
export declare function makeSecurityGroupAccessTheInternet(securityGroup: awsx.ec2.SecurityGroup): void;
|
|
13
|
+
/** Enables ingress traffic from cloudflare CIDRs */
|
|
14
|
+
export declare function makeSecurityGroupAccessibleByCloudflare(securityGroup: awsx.ec2.SecurityGroup): Promise<void>;
|
package/accessTheInternet.js
CHANGED
|
@@ -9,19 +9,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.accessFromCloudflareSecurityGroup = exports.accessTheInternetSecurityGroupId = exports.accessTheInternetSecurityGroup = exports.accessCloudflareSecurityGroup = void 0;
|
|
12
|
+
exports.makeSecurityGroupAccessibleByCloudflare = exports.makeSecurityGroupAccessTheInternet = exports.accessFromCloudflareSecurityGroup = exports.accessTheInternetSecurityGroupId = exports.accessTheInternetSecurityGroup = exports.accessCloudflareSecurityGroup = void 0;
|
|
13
13
|
const awsx = require("@pulumi/awsx");
|
|
14
|
+
const cloudflare = require("@pulumi/cloudflare");
|
|
14
15
|
const supra_1 = require("./supra");
|
|
15
16
|
const values_1 = require("./values");
|
|
16
17
|
const withCache_1 = require("./withCache");
|
|
18
|
+
const utils_1 = require("./utils");
|
|
19
|
+
/** @deprecated please use makeSecurityGroupAccessibleByCloudflare */
|
|
17
20
|
exports.accessCloudflareSecurityGroup = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
21
|
const config = yield (0, values_1.getEnvConfiguration)(); // ?
|
|
19
22
|
return awsx.ec2.SecurityGroup.fromExistingId(`accept-cloudflare-web-sg-reference`, supra_1.supra.getOutputValue(`cloudflareAcceptWeb`));
|
|
20
23
|
}));
|
|
24
|
+
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
21
25
|
exports.accessTheInternetSecurityGroup = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
26
|
const config = yield (0, values_1.getEnvConfiguration)(); // ?
|
|
23
27
|
return awsx.ec2.SecurityGroup.fromExistingId(`access-the-internet-sg-reference`, supra_1.supra.getOutputValue(`accessTheInternet`));
|
|
24
28
|
}));
|
|
29
|
+
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
25
30
|
function accessTheInternetSecurityGroupId() {
|
|
26
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
32
|
return (yield (0, exports.accessTheInternetSecurityGroup)()).id;
|
|
@@ -29,10 +34,45 @@ function accessTheInternetSecurityGroupId() {
|
|
|
29
34
|
}
|
|
30
35
|
exports.accessTheInternetSecurityGroupId = accessTheInternetSecurityGroupId;
|
|
31
36
|
exports.default = exports.accessTheInternetSecurityGroup;
|
|
37
|
+
/** @deprecated please use makeSecurityGroupAccessibleByCloudflare */
|
|
32
38
|
function accessFromCloudflareSecurityGroup() {
|
|
33
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
40
|
return (yield (0, exports.accessCloudflareSecurityGroup)()).id;
|
|
35
41
|
});
|
|
36
42
|
}
|
|
37
43
|
exports.accessFromCloudflareSecurityGroup = accessFromCloudflareSecurityGroup;
|
|
44
|
+
/** Enables egress traffic to 0.0.0.0/0/all */
|
|
45
|
+
function makeSecurityGroupAccessTheInternet(securityGroup) {
|
|
46
|
+
securityGroup.createEgressRule("access-the-internet", {
|
|
47
|
+
cidrBlocks: ["0.0.0.0/0"],
|
|
48
|
+
fromPort: -1,
|
|
49
|
+
toPort: -1,
|
|
50
|
+
protocol: "-1",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.makeSecurityGroupAccessTheInternet = makeSecurityGroupAccessTheInternet;
|
|
54
|
+
/** Enables ingress traffic from cloudflare CIDRs */
|
|
55
|
+
function makeSecurityGroupAccessibleByCloudflare(securityGroup) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const ips = yield cloudflare.getIpRanges({});
|
|
58
|
+
for (let block of ips.ipv4CidrBlocks) {
|
|
59
|
+
const hash = (0, utils_1.sha256hash)(block).substr(0, 6);
|
|
60
|
+
securityGroup.createIngressRule(`accept-cf-80-${hash}`, {
|
|
61
|
+
protocol: "tcp",
|
|
62
|
+
fromPort: 80,
|
|
63
|
+
toPort: 80,
|
|
64
|
+
cidrBlocks: [block],
|
|
65
|
+
description: `pulumi-supra-${hash}`,
|
|
66
|
+
});
|
|
67
|
+
securityGroup.createIngressRule(`accept-cf-443-${hash}`, {
|
|
68
|
+
protocol: "tcp",
|
|
69
|
+
fromPort: 443,
|
|
70
|
+
toPort: 443,
|
|
71
|
+
cidrBlocks: [block],
|
|
72
|
+
description: `pulumi-supra-${hash}`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
exports.makeSecurityGroupAccessibleByCloudflare = makeSecurityGroupAccessibleByCloudflare;
|
|
38
78
|
//# sourceMappingURL=accessTheInternet.js.map
|
package/createFargateTask.js
CHANGED
|
@@ -15,7 +15,6 @@ const awsx = require("@pulumi/awsx");
|
|
|
15
15
|
const pulumi = require("@pulumi/pulumi");
|
|
16
16
|
const acceptAlb_1 = require("./acceptAlb");
|
|
17
17
|
const acceptBastion_1 = require("./acceptBastion");
|
|
18
|
-
const accessTheInternet_1 = require("./accessTheInternet");
|
|
19
18
|
const domain_1 = require("./domain");
|
|
20
19
|
const exposePublicService_1 = require("./exposePublicService");
|
|
21
20
|
const network_1 = require("./network");
|
|
@@ -24,6 +23,7 @@ const vpc_1 = require("./vpc");
|
|
|
24
23
|
const supra_1 = require("./supra");
|
|
25
24
|
const stack_1 = require("./stack");
|
|
26
25
|
const prometheus_1 = require("./prometheus");
|
|
26
|
+
const accessTheInternet_1 = require("./accessTheInternet");
|
|
27
27
|
const getDefaultLogs = (serviceName, logGroup) => pulumi.all([logGroup.id]).apply(([logGroupId]) => ({
|
|
28
28
|
logDriver: "awslogs",
|
|
29
29
|
options: {
|
|
@@ -157,12 +157,20 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
|
|
|
157
157
|
}
|
|
158
158
|
// this port should be the internal port used for administrative purposes
|
|
159
159
|
let serviceDiscoveryPort = dockerListeningPort;
|
|
160
|
+
const vpc = yield (0, vpc_1.getVpc)();
|
|
161
|
+
const taskSecurityGroup = new awsx.ec2.SecurityGroup(`${serviceName}-${version}`, {
|
|
162
|
+
vpc,
|
|
163
|
+
});
|
|
160
164
|
if (dockerLabels.ECS_PROMETHEUS_EXPORTER_PORT) {
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
let fromPort = 0;
|
|
166
|
+
let toPort = 0;
|
|
163
167
|
new Set(dockerLabels.ECS_PROMETHEUS_EXPORTER_PORT.split(/;/g).map(($) => parseInt($))).forEach((port) => {
|
|
168
|
+
if (fromPort == 0 || fromPort > port)
|
|
169
|
+
fromPort = port;
|
|
170
|
+
if (toPort == 0 || toPort < port)
|
|
171
|
+
toPort = port;
|
|
164
172
|
// create a security group to enable metrics access by cwagent from inside the VPC
|
|
165
|
-
|
|
173
|
+
taskSecurityGroup.createIngressRule(`metrics-${port}`, {
|
|
166
174
|
fromPort: port,
|
|
167
175
|
toPort: port,
|
|
168
176
|
protocol: "tcp",
|
|
@@ -177,18 +185,13 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
|
|
|
177
185
|
}
|
|
178
186
|
serviceDiscoveryPort = port;
|
|
179
187
|
});
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
vpcId: vpc.id,
|
|
183
|
-
ingress,
|
|
184
|
-
});
|
|
185
|
-
securityGroups.push(sg.id);
|
|
186
|
-
}
|
|
187
|
-
const prometheusSg = yield (0, prometheus_1.acceptPrometheusSgId)();
|
|
188
|
-
if (!securityGroups.includes(prometheusSg)) {
|
|
189
|
-
securityGroups.push(prometheusSg);
|
|
190
|
-
}
|
|
188
|
+
// enable prometheus to access fromPort-toPort
|
|
189
|
+
(0, prometheus_1.makeSecurityGroupAccessibleByPrometheus)(taskSecurityGroup, fromPort, toPort);
|
|
191
190
|
}
|
|
191
|
+
// enable egress traffic from the task to the internet
|
|
192
|
+
(0, accessTheInternet_1.makeSecurityGroupAccessTheInternet)(taskSecurityGroup);
|
|
193
|
+
// make the container fully accessible from the bastion of the environment
|
|
194
|
+
(0, acceptBastion_1.makeSecurityGroupAccessibleFromBastion)(taskSecurityGroup);
|
|
192
195
|
if (dontExpose) {
|
|
193
196
|
const service = yield createInternalService({
|
|
194
197
|
serviceName,
|
|
@@ -197,11 +200,7 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
|
|
|
197
200
|
assignPublicIp: !dontAssignPublicIp,
|
|
198
201
|
serviceDiscoveryPort,
|
|
199
202
|
ignoreServiceDiscovery,
|
|
200
|
-
securityGroups: [
|
|
201
|
-
...securityGroups,
|
|
202
|
-
yield (0, accessTheInternet_1.accessTheInternetSecurityGroupId)(),
|
|
203
|
-
yield (0, acceptBastion_1.acceptBastionSecurityGroupId)(),
|
|
204
|
-
],
|
|
203
|
+
securityGroups: [taskSecurityGroup.id, ...securityGroups],
|
|
205
204
|
containerInfo: {
|
|
206
205
|
secrets,
|
|
207
206
|
environment,
|
|
@@ -230,6 +229,8 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
|
|
|
230
229
|
extraALBMappingsExposed.push(exposedExtra.targetGroup);
|
|
231
230
|
}
|
|
232
231
|
const portMapping = exposed.targetGroup;
|
|
232
|
+
// make the service accesible by the ALB
|
|
233
|
+
(0, acceptAlb_1.makeSecurityGroupAccessibleFromSharedAlb)(taskSecurityGroup);
|
|
233
234
|
const service = yield createInternalService({
|
|
234
235
|
serviceName,
|
|
235
236
|
cluster,
|
|
@@ -238,12 +239,7 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
|
|
|
238
239
|
taskRole,
|
|
239
240
|
assignPublicIp: !dontAssignPublicIp,
|
|
240
241
|
ignoreServiceDiscovery,
|
|
241
|
-
securityGroups: [
|
|
242
|
-
...securityGroups,
|
|
243
|
-
yield (0, accessTheInternet_1.accessTheInternetSecurityGroupId)(),
|
|
244
|
-
yield (0, acceptAlb_1.acceptAlbSecurityGroupId)(),
|
|
245
|
-
yield (0, acceptBastion_1.acceptBastionSecurityGroupId)(),
|
|
246
|
-
],
|
|
242
|
+
securityGroups: [taskSecurityGroup.id, ...securityGroups],
|
|
247
243
|
serviceDiscoveryPort,
|
|
248
244
|
containerInfo: {
|
|
249
245
|
secrets,
|
package/exposePublicService.js
CHANGED
|
@@ -44,12 +44,12 @@ function exposePublicService(name, domain, port, healthCheck = {}, vpc, extraOpt
|
|
|
44
44
|
const slug = name;
|
|
45
45
|
const targetVpc = vpc ? vpc : awsx.ec2.Vpc.getDefault();
|
|
46
46
|
const targetDeregistrationDelay = deregistrationDelay ? deregistrationDelay : 300;
|
|
47
|
-
const targetGroup = alb.createTargetGroup(
|
|
47
|
+
const targetGroup = alb.createTargetGroup("tg-" + slug.substr(-32 + 12) /* last 32 chars, and take 7 chars for the -hash appended by pulumi */, {
|
|
48
48
|
protocol: "HTTP",
|
|
49
49
|
port,
|
|
50
50
|
healthCheck: healthCheckValue,
|
|
51
51
|
vpc: targetVpc,
|
|
52
|
-
deregistrationDelay: targetDeregistrationDelay
|
|
52
|
+
deregistrationDelay: targetDeregistrationDelay,
|
|
53
53
|
});
|
|
54
54
|
const domainParts = (0, getDomainAndSubdomain_1.getDomainAndSubdomain)(domain);
|
|
55
55
|
const enabledHostnames = [];
|
package/lambda.js
CHANGED
|
@@ -66,7 +66,7 @@ function createLambda(fullyQualifiedDomainName, config) {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
const name = (0, stack_1.getStackScopedName)((subdomain || "ROOTDOMAIN") + "-" + lambdaName);
|
|
69
|
-
const lambda = new aws.lambda.Function(name, Object.assign({ name: name, handler: `${(0, path_1.basename)(file, ".js")}.handler`, timeout: 900, memorySize: 1024, runtime: "
|
|
69
|
+
const lambda = new aws.lambda.Function(name, Object.assign({ name: name, handler: `${(0, path_1.basename)(file, ".js")}.handler`, timeout: 900, memorySize: 1024, runtime: "nodejs14.x", code: (extra === null || extra === void 0 ? void 0 : extra.code) ||
|
|
70
70
|
new pulumi.asset.AssetArchive({
|
|
71
71
|
[(0, path_1.basename)(file)]: new pulumi.asset.FileAsset(file),
|
|
72
72
|
}), role: (extra === null || extra === void 0 ? void 0 : extra.role) || lambdaApiGatewayRole.arn }, extra));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcl-ops-lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.20.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "tsc && cp bin/* .",
|
|
6
6
|
"clean": "rm *.d.ts *.js *.js.map"
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"typescript": "^4.4.3"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@pulumi/aws": "^4.
|
|
30
|
+
"@pulumi/aws": "^4.22.0",
|
|
31
31
|
"@pulumi/awsx": "^0.31.0",
|
|
32
|
-
"@pulumi/cloudflare": "^
|
|
32
|
+
"@pulumi/cloudflare": "^4.0.0",
|
|
33
33
|
"@pulumi/docker": "^3.1.0",
|
|
34
|
-
"@pulumi/pulumi": "^3.13.
|
|
34
|
+
"@pulumi/pulumi": "^3.13.2",
|
|
35
35
|
"mime": "^2.5.2"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/prometheus.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import * as awsx from "@pulumi/awsx";
|
|
2
3
|
export declare const prometheusStack: () => Promise<pulumi.StackReference>;
|
|
3
|
-
export declare const
|
|
4
|
+
export declare const prometheusSecurityGroupId: () => Promise<string>;
|
|
5
|
+
export declare function makeSecurityGroupAccessibleByPrometheus(securityGroup: awsx.ec2.SecurityGroup, fromPort?: number, toPort?: number): void;
|
package/prometheus.js
CHANGED
|
@@ -9,15 +9,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.makeSecurityGroupAccessibleByPrometheus = exports.prometheusSecurityGroupId = exports.prometheusStack = void 0;
|
|
13
13
|
const pulumi = require("@pulumi/pulumi");
|
|
14
|
+
const awsx = require("@pulumi/awsx");
|
|
14
15
|
const domain_1 = require("./domain");
|
|
15
16
|
const withCache_1 = require("./withCache");
|
|
16
17
|
exports.prometheusStack = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
return new pulumi.StackReference(`prometheus-${domain_1.env}`);
|
|
18
19
|
}));
|
|
19
|
-
exports.
|
|
20
|
+
exports.prometheusSecurityGroupId = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
21
|
const prom = yield (0, exports.prometheusStack)();
|
|
21
|
-
return (yield prom.requireOutputValue("
|
|
22
|
+
return (yield prom.requireOutputValue("prometheusSecurityGroupId"));
|
|
22
23
|
}));
|
|
24
|
+
function makeSecurityGroupAccessibleByPrometheus(securityGroup, fromPort = 0, toPort = 0) {
|
|
25
|
+
new awsx.ec2.IngressSecurityGroupRule(`accept-prom-${fromPort}-${toPort}`, securityGroup, {
|
|
26
|
+
sourceSecurityGroupId: (0, exports.prometheusSecurityGroupId)(),
|
|
27
|
+
description: `Allow access from prometheus`,
|
|
28
|
+
fromPort,
|
|
29
|
+
toPort,
|
|
30
|
+
protocol: "-1",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.makeSecurityGroupAccessibleByPrometheus = makeSecurityGroupAccessibleByPrometheus;
|
|
23
34
|
//# sourceMappingURL=prometheus.js.map
|
package/values.d.ts
CHANGED
|
@@ -4,8 +4,12 @@ export declare type EnvironmentValues = {
|
|
|
4
4
|
publicSubnets: Subnet[];
|
|
5
5
|
privateSubnets: Subnet[];
|
|
6
6
|
internalSubnets: Subnet[];
|
|
7
|
+
/** @deprecated */
|
|
7
8
|
acceptAlb: string;
|
|
9
|
+
/** @deprecated */
|
|
8
10
|
acceptBastion: string;
|
|
9
11
|
dbSecurity: string;
|
|
12
|
+
albSecurityGroupId: string;
|
|
13
|
+
bastionSecurityGroupId: string;
|
|
10
14
|
};
|
|
11
15
|
export declare const getEnvConfiguration: () => Promise<EnvironmentValues>;
|
package/values.js
CHANGED
|
@@ -23,6 +23,8 @@ exports.getEnvConfiguration = (0, withCache_1.default)(function () {
|
|
|
23
23
|
acceptAlb: yield supra_1.supra.getOutputValue("acceptAlbSecurityGroupId"),
|
|
24
24
|
acceptBastion: yield supra_1.supra.getOutputValue("acceptBastionSecurityGroupId"),
|
|
25
25
|
dbSecurity: yield supra_1.supra.getOutputValue("acceptDbSecurityGroupId"),
|
|
26
|
+
albSecurityGroupId: yield supra_1.supra.getOutputValue("albSecurityGroupId"),
|
|
27
|
+
bastionSecurityGroupId: yield supra_1.supra.getOutputValue("bastionSecurityGroupId"),
|
|
26
28
|
};
|
|
27
29
|
});
|
|
28
30
|
});
|