dcl-ops-lib 5.23.0 → 5.23.1
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.js +2 -1
- package/acceptBastion.js +4 -3
- package/accessTheInternet.js +1 -1
- package/package.json +1 -1
- package/prometheus.js +2 -1
- package/utils.d.ts +1 -0
- package/utils.js +8 -1
package/acceptAlb.js
CHANGED
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.makeSecurityGroupAccessibleFromSharedAlb = exports.acceptAlbSecurityGroupId = exports.acceptAlbSecurityGroup = void 0;
|
|
13
13
|
const awsx = require("@pulumi/awsx");
|
|
14
|
+
const utils_1 = require("./utils");
|
|
14
15
|
const values_1 = require("./values");
|
|
15
16
|
const withCache_1 = require("./withCache");
|
|
16
17
|
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlb instead */
|
|
@@ -27,7 +28,7 @@ function acceptAlbSecurityGroupId() {
|
|
|
27
28
|
exports.acceptAlbSecurityGroupId = acceptAlbSecurityGroupId;
|
|
28
29
|
/** Makes a given securityGropup accesible by the shared supra ALB */
|
|
29
30
|
function makeSecurityGroupAccessibleFromSharedAlb(securityGroup, ruleName = "") {
|
|
30
|
-
new awsx.ec2.IngressSecurityGroupRule(
|
|
31
|
+
new awsx.ec2.IngressSecurityGroupRule((0, utils_1.withRuleName)("accept-alb-ingress-rule", ruleName), securityGroup, {
|
|
31
32
|
sourceSecurityGroupId: (0, values_1.getEnvConfiguration)().then(($) => $.albSecurityGroupId),
|
|
32
33
|
description: `Allow access from the supra ALB`,
|
|
33
34
|
fromPort: 0,
|
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, ruleName =
|
|
34
|
-
new aws.ec2.SecurityGroupRule(
|
|
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.js
CHANGED
|
@@ -43,7 +43,7 @@ function accessFromCloudflareSecurityGroup() {
|
|
|
43
43
|
exports.accessFromCloudflareSecurityGroup = accessFromCloudflareSecurityGroup;
|
|
44
44
|
/** Enables egress traffic to 0.0.0.0/0/all */
|
|
45
45
|
function makeSecurityGroupAccessTheInternet(securityGroup, ruleName = "") {
|
|
46
|
-
securityGroup.createEgressRule(
|
|
46
|
+
securityGroup.createEgressRule((0, utils_1.withRuleName)("access-the-internet", ruleName), {
|
|
47
47
|
cidrBlocks: ["0.0.0.0/0"],
|
|
48
48
|
fromPort: -1,
|
|
49
49
|
toPort: -1,
|
package/package.json
CHANGED
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
|
}));
|
|
@@ -22,7 +23,7 @@ exports.prometheusSecurityGroupId = (0, withCache_1.default)(() => __awaiter(voi
|
|
|
22
23
|
return (yield prom.requireOutputValue("prometheusSecurityGroupId"));
|
|
23
24
|
}));
|
|
24
25
|
function makeSecurityGroupAccessibleByPrometheus(securityGroup, fromPort = 0, toPort = 0, ruleName = "") {
|
|
25
|
-
new awsx.ec2.IngressSecurityGroupRule(
|
|
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
|