dcl-ops-lib 5.22.0 → 5.23.2
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 +3 -2
- package/acceptAlb.js +18 -4
- package/acceptBastion.d.ts +1 -1
- package/acceptBastion.js +4 -3
- package/accessTheInternet.d.ts +3 -1
- package/accessTheInternet.js +16 -3
- package/createFargateTask.js +4 -4
- package/package.json +1 -1
- package/prometheus.d.ts +1 -1
- package/prometheus.js +3 -2
- package/utils.d.ts +1 -0
- package/utils.js +8 -1
package/acceptAlb.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as awsx from "@pulumi/awsx";
|
|
|
3
3
|
export declare const acceptAlbSecurityGroup: () => Promise<awsx.ec2.SecurityGroup>;
|
|
4
4
|
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlb instead */
|
|
5
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;
|
|
6
|
+
/** @deprecated Makes a given securityGropup accesible by the shared supra ALB */
|
|
7
|
+
export declare function makeSecurityGroupAccessibleFromSharedAlb(securityGroup: awsx.ec2.SecurityGroup, ruleName?: string): void;
|
|
8
|
+
export declare function makeSecurityGroupAccessibleFromSharedAlbV2(securityGroup: awsx.ec2.SecurityGroup, ruleName?: string): void;
|
|
8
9
|
export default acceptAlbSecurityGroup;
|
package/acceptAlb.js
CHANGED
|
@@ -9,8 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.makeSecurityGroupAccessibleFromSharedAlb = exports.acceptAlbSecurityGroupId = exports.acceptAlbSecurityGroup = void 0;
|
|
12
|
+
exports.makeSecurityGroupAccessibleFromSharedAlbV2 = exports.makeSecurityGroupAccessibleFromSharedAlb = exports.acceptAlbSecurityGroupId = exports.acceptAlbSecurityGroup = void 0;
|
|
13
13
|
const awsx = require("@pulumi/awsx");
|
|
14
|
+
const aws = require("@pulumi/aws");
|
|
15
|
+
const utils_1 = require("./utils");
|
|
14
16
|
const values_1 = require("./values");
|
|
15
17
|
const withCache_1 = require("./withCache");
|
|
16
18
|
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlb instead */
|
|
@@ -25,9 +27,9 @@ function acceptAlbSecurityGroupId() {
|
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
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, {
|
|
30
|
+
/** @deprecated Makes a given securityGropup accesible by the shared supra ALB */
|
|
31
|
+
function makeSecurityGroupAccessibleFromSharedAlb(securityGroup, ruleName = "") {
|
|
32
|
+
new awsx.ec2.IngressSecurityGroupRule((0, utils_1.withRuleName)("accept-alb-ingress-rule", ruleName), securityGroup, {
|
|
31
33
|
sourceSecurityGroupId: (0, values_1.getEnvConfiguration)().then(($) => $.albSecurityGroupId),
|
|
32
34
|
description: `Allow access from the supra ALB`,
|
|
33
35
|
fromPort: 0,
|
|
@@ -36,5 +38,17 @@ function makeSecurityGroupAccessibleFromSharedAlb(securityGroup) {
|
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
exports.makeSecurityGroupAccessibleFromSharedAlb = makeSecurityGroupAccessibleFromSharedAlb;
|
|
41
|
+
function makeSecurityGroupAccessibleFromSharedAlbV2(securityGroup, ruleName = "") {
|
|
42
|
+
new aws.ec2.SecurityGroupRule((0, utils_1.withRuleName)("accept-alb-ingress-rule-v2", ruleName), {
|
|
43
|
+
securityGroupId: securityGroup.id,
|
|
44
|
+
sourceSecurityGroupId: (0, values_1.getEnvConfiguration)().then(($) => $.albSecurityGroupId),
|
|
45
|
+
description: `Allow access from the supra ALB`,
|
|
46
|
+
fromPort: 65000,
|
|
47
|
+
toPort: 0,
|
|
48
|
+
protocol: "-1",
|
|
49
|
+
type: "egress",
|
|
50
|
+
}, { deleteBeforeReplace: true });
|
|
51
|
+
}
|
|
52
|
+
exports.makeSecurityGroupAccessibleFromSharedAlbV2 = makeSecurityGroupAccessibleFromSharedAlbV2;
|
|
39
53
|
exports.default = exports.acceptAlbSecurityGroup;
|
|
40
54
|
//# sourceMappingURL=acceptAlb.js.map
|
package/acceptBastion.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import * as awsx from "@pulumi/awsx";
|
|
|
3
3
|
export declare const acceptBastionSecurityGroup: () => Promise<awsx.ec2.SecurityGroup>;
|
|
4
4
|
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
5
5
|
export declare function acceptBastionSecurityGroupId(): Promise<import("@pulumi/pulumi").Output<string>>;
|
|
6
|
-
export declare function makeSecurityGroupAccessibleFromBastion(securityGroup: awsx.ec2.SecurityGroup): void;
|
|
6
|
+
export declare function makeSecurityGroupAccessibleFromBastion(securityGroup: awsx.ec2.SecurityGroup, ruleName?: string): void;
|
|
7
7
|
export default acceptBastionSecurityGroup;
|
package/acceptBastion.js
CHANGED
|
@@ -14,6 +14,7 @@ const awsx = require("@pulumi/awsx");
|
|
|
14
14
|
const aws = require("@pulumi/aws");
|
|
15
15
|
const values_1 = require("./values");
|
|
16
16
|
const withCache_1 = require("./withCache");
|
|
17
|
+
const utils_1 = require("./utils");
|
|
17
18
|
/** @deprecated please use makeSecurityGroupAccessTheInternet */
|
|
18
19
|
exports.acceptBastionSecurityGroup = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
20
|
const config = yield (0, values_1.getEnvConfiguration)();
|
|
@@ -30,15 +31,15 @@ const bastionSecurityGroupId = (0, withCache_1.default)(() => __awaiter(void 0,
|
|
|
30
31
|
const config = yield (0, values_1.getEnvConfiguration)();
|
|
31
32
|
return config.bastionSecurityGroupId;
|
|
32
33
|
}));
|
|
33
|
-
function makeSecurityGroupAccessibleFromBastion(securityGroup) {
|
|
34
|
-
new aws.ec2.SecurityGroupRule("accesible-from-bastion", {
|
|
34
|
+
function makeSecurityGroupAccessibleFromBastion(securityGroup, ruleName = "") {
|
|
35
|
+
new aws.ec2.SecurityGroupRule((0, utils_1.withRuleName)("accesible-from-bastion", ruleName), {
|
|
35
36
|
securityGroupId: securityGroup.id,
|
|
36
37
|
sourceSecurityGroupId: bastionSecurityGroupId(),
|
|
37
38
|
fromPort: -1,
|
|
38
39
|
toPort: -1,
|
|
39
40
|
type: "ingress",
|
|
40
41
|
protocol: "-1",
|
|
41
|
-
});
|
|
42
|
+
}, { deleteBeforeReplace: true });
|
|
42
43
|
}
|
|
43
44
|
exports.makeSecurityGroupAccessibleFromBastion = makeSecurityGroupAccessibleFromBastion;
|
|
44
45
|
exports.default = exports.acceptBastionSecurityGroup;
|
package/accessTheInternet.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export default accessTheInternetSecurityGroup;
|
|
|
9
9
|
/** @deprecated please use makeSecurityGroupAccessibleByCloudflare */
|
|
10
10
|
export declare function accessFromCloudflareSecurityGroup(): Promise<import("@pulumi/pulumi").Output<string>>;
|
|
11
11
|
/** Enables egress traffic to 0.0.0.0/0/all */
|
|
12
|
-
export declare function makeSecurityGroupAccessTheInternet(securityGroup: awsx.ec2.SecurityGroup): void;
|
|
12
|
+
export declare function makeSecurityGroupAccessTheInternet(securityGroup: awsx.ec2.SecurityGroup, ruleName?: string): void;
|
|
13
|
+
/** Enables egress traffic to 0.0.0.0/0/all */
|
|
14
|
+
export declare function makeSecurityGroupAccessTheInternetV2(securityGroup: awsx.ec2.SecurityGroup, ruleName?: string): void;
|
|
13
15
|
/** Enables ingress traffic from cloudflare CIDRs */
|
|
14
16
|
export declare function makeSecurityGroupAccessibleByCloudflare(securityGroup: awsx.ec2.SecurityGroup): Promise<void>;
|
package/accessTheInternet.js
CHANGED
|
@@ -9,8 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.makeSecurityGroupAccessibleByCloudflare = exports.makeSecurityGroupAccessTheInternet = exports.accessFromCloudflareSecurityGroup = exports.accessTheInternetSecurityGroupId = exports.accessTheInternetSecurityGroup = exports.accessCloudflareSecurityGroup = void 0;
|
|
12
|
+
exports.makeSecurityGroupAccessibleByCloudflare = exports.makeSecurityGroupAccessTheInternetV2 = exports.makeSecurityGroupAccessTheInternet = exports.accessFromCloudflareSecurityGroup = exports.accessTheInternetSecurityGroupId = exports.accessTheInternetSecurityGroup = exports.accessCloudflareSecurityGroup = void 0;
|
|
13
13
|
const awsx = require("@pulumi/awsx");
|
|
14
|
+
const aws = require("@pulumi/aws");
|
|
14
15
|
const cloudflare = require("@pulumi/cloudflare");
|
|
15
16
|
const supra_1 = require("./supra");
|
|
16
17
|
const values_1 = require("./values");
|
|
@@ -42,8 +43,8 @@ function accessFromCloudflareSecurityGroup() {
|
|
|
42
43
|
}
|
|
43
44
|
exports.accessFromCloudflareSecurityGroup = accessFromCloudflareSecurityGroup;
|
|
44
45
|
/** Enables egress traffic to 0.0.0.0/0/all */
|
|
45
|
-
function makeSecurityGroupAccessTheInternet(securityGroup) {
|
|
46
|
-
securityGroup.createEgressRule("access-the-internet", {
|
|
46
|
+
function makeSecurityGroupAccessTheInternet(securityGroup, ruleName = "") {
|
|
47
|
+
securityGroup.createEgressRule((0, utils_1.withRuleName)("access-the-internet", ruleName), {
|
|
47
48
|
cidrBlocks: ["0.0.0.0/0"],
|
|
48
49
|
fromPort: -1,
|
|
49
50
|
toPort: -1,
|
|
@@ -51,6 +52,18 @@ function makeSecurityGroupAccessTheInternet(securityGroup) {
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
exports.makeSecurityGroupAccessTheInternet = makeSecurityGroupAccessTheInternet;
|
|
55
|
+
/** Enables egress traffic to 0.0.0.0/0/all */
|
|
56
|
+
function makeSecurityGroupAccessTheInternetV2(securityGroup, ruleName = "") {
|
|
57
|
+
new aws.ec2.SecurityGroupRule((0, utils_1.withRuleName)("access-the-internet-v2", ruleName), {
|
|
58
|
+
securityGroupId: securityGroup.id,
|
|
59
|
+
cidrBlocks: ["0.0.0.0/0"],
|
|
60
|
+
fromPort: 65000,
|
|
61
|
+
toPort: 0,
|
|
62
|
+
protocol: "-1",
|
|
63
|
+
type: "egress",
|
|
64
|
+
}, { deleteBeforeReplace: true });
|
|
65
|
+
}
|
|
66
|
+
exports.makeSecurityGroupAccessTheInternetV2 = makeSecurityGroupAccessTheInternetV2;
|
|
54
67
|
/** Enables ingress traffic from cloudflare CIDRs */
|
|
55
68
|
function makeSecurityGroupAccessibleByCloudflare(securityGroup) {
|
|
56
69
|
return __awaiter(this, void 0, void 0, function* () {
|
package/createFargateTask.js
CHANGED
|
@@ -186,12 +186,12 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
|
|
|
186
186
|
serviceDiscoveryPort = port;
|
|
187
187
|
});
|
|
188
188
|
// enable prometheus to access fromPort-toPort
|
|
189
|
-
(0, prometheus_1.makeSecurityGroupAccessibleByPrometheus)(taskSecurityGroup, fromPort, toPort);
|
|
189
|
+
(0, prometheus_1.makeSecurityGroupAccessibleByPrometheus)(taskSecurityGroup, fromPort, toPort, serviceName);
|
|
190
190
|
}
|
|
191
191
|
// enable egress traffic from the task to the internet
|
|
192
|
-
(0, accessTheInternet_1.makeSecurityGroupAccessTheInternet)(taskSecurityGroup);
|
|
192
|
+
(0, accessTheInternet_1.makeSecurityGroupAccessTheInternet)(taskSecurityGroup, serviceName);
|
|
193
193
|
// make the container fully accessible from the bastion of the environment
|
|
194
|
-
(0, acceptBastion_1.makeSecurityGroupAccessibleFromBastion)(taskSecurityGroup);
|
|
194
|
+
(0, acceptBastion_1.makeSecurityGroupAccessibleFromBastion)(taskSecurityGroup, serviceName);
|
|
195
195
|
if (dontExpose) {
|
|
196
196
|
const service = yield createInternalService({
|
|
197
197
|
serviceName,
|
|
@@ -230,7 +230,7 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
|
|
|
230
230
|
}
|
|
231
231
|
const portMapping = exposed.targetGroup;
|
|
232
232
|
// make the service accesible by the ALB
|
|
233
|
-
(0, acceptAlb_1.makeSecurityGroupAccessibleFromSharedAlb)(taskSecurityGroup);
|
|
233
|
+
(0, acceptAlb_1.makeSecurityGroupAccessibleFromSharedAlb)(taskSecurityGroup, serviceName);
|
|
234
234
|
const service = yield createInternalService({
|
|
235
235
|
serviceName,
|
|
236
236
|
cluster,
|
package/package.json
CHANGED
package/prometheus.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import * as pulumi from "@pulumi/pulumi";
|
|
|
2
2
|
import * as awsx from "@pulumi/awsx";
|
|
3
3
|
export declare const prometheusStack: () => Promise<pulumi.StackReference>;
|
|
4
4
|
export declare const prometheusSecurityGroupId: () => Promise<string>;
|
|
5
|
-
export declare function makeSecurityGroupAccessibleByPrometheus(securityGroup: awsx.ec2.SecurityGroup, fromPort?: number, toPort?: number): void;
|
|
5
|
+
export declare function makeSecurityGroupAccessibleByPrometheus(securityGroup: awsx.ec2.SecurityGroup, fromPort?: number, toPort?: number, ruleName?: string): void;
|
package/prometheus.js
CHANGED
|
@@ -14,6 +14,7 @@ const pulumi = require("@pulumi/pulumi");
|
|
|
14
14
|
const awsx = require("@pulumi/awsx");
|
|
15
15
|
const domain_1 = require("./domain");
|
|
16
16
|
const withCache_1 = require("./withCache");
|
|
17
|
+
const utils_1 = require("./utils");
|
|
17
18
|
exports.prometheusStack = (0, withCache_1.default)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
19
|
return new pulumi.StackReference(`prometheus-${domain_1.env}`);
|
|
19
20
|
}));
|
|
@@ -21,8 +22,8 @@ exports.prometheusSecurityGroupId = (0, withCache_1.default)(() => __awaiter(voi
|
|
|
21
22
|
const prom = yield (0, exports.prometheusStack)();
|
|
22
23
|
return (yield prom.requireOutputValue("prometheusSecurityGroupId"));
|
|
23
24
|
}));
|
|
24
|
-
function makeSecurityGroupAccessibleByPrometheus(securityGroup, fromPort = 0, toPort = 0) {
|
|
25
|
-
new awsx.ec2.IngressSecurityGroupRule(`accept-prom-${fromPort}-${toPort}`, securityGroup, {
|
|
25
|
+
function makeSecurityGroupAccessibleByPrometheus(securityGroup, fromPort = 0, toPort = 0, ruleName = "") {
|
|
26
|
+
new awsx.ec2.IngressSecurityGroupRule((0, utils_1.withRuleName)(`accept-prom-${fromPort}-${toPort}`, ruleName), securityGroup, {
|
|
26
27
|
sourceSecurityGroupId: (0, exports.prometheusSecurityGroupId)(),
|
|
27
28
|
description: `Allow access from prometheus`,
|
|
28
29
|
fromPort,
|
package/utils.d.ts
CHANGED
package/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sha256hash = void 0;
|
|
3
|
+
exports.withRuleName = exports.sha256hash = void 0;
|
|
4
4
|
const crypto = require("crypto");
|
|
5
5
|
function sha256hash(s) {
|
|
6
6
|
const shasum = crypto.createHash("sha256");
|
|
@@ -8,4 +8,11 @@ function sha256hash(s) {
|
|
|
8
8
|
return shasum.digest("hex").substring(0, 8);
|
|
9
9
|
}
|
|
10
10
|
exports.sha256hash = sha256hash;
|
|
11
|
+
function withRuleName(name, ruleName) {
|
|
12
|
+
if (ruleName === null || ruleName === void 0 ? void 0 : ruleName.length) {
|
|
13
|
+
return `${ruleName}-${name}`;
|
|
14
|
+
}
|
|
15
|
+
return name;
|
|
16
|
+
}
|
|
17
|
+
exports.withRuleName = withRuleName;
|
|
11
18
|
//# sourceMappingURL=utils.js.map
|