dcl-ops-lib 5.23.0 → 5.23.3
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 -2
- package/acceptAlb.js +19 -4
- package/acceptBastion.d.ts +3 -1
- package/acceptBastion.js +17 -4
- package/accessTheInternet.d.ts +3 -1
- package/accessTheInternet.js +17 -4
- package/createFargateTask.js +4 -4
- package/package.json +1 -1
- package/prometheus.d.ts +5 -1
- package/prometheus.js +17 -3
- package/utils.d.ts +1 -0
- package/utils.js +8 -1
package/acceptAlb.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ 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
|
-
/**
|
|
7
|
-
export declare function makeSecurityGroupAccessibleFromSharedAlb(securityGroup: awsx.ec2.SecurityGroup
|
|
6
|
+
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlbV2 */
|
|
7
|
+
export declare function makeSecurityGroupAccessibleFromSharedAlb(securityGroup: awsx.ec2.SecurityGroup): void;
|
|
8
|
+
/** @deprecated Makes a given securityGropup accesible by the shared supra ALB */
|
|
9
|
+
export declare function makeSecurityGroupAccessibleFromSharedAlbV2(securityGroup: awsx.ec2.SecurityGroup, ruleName?: string): void;
|
|
8
10
|
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
|
-
/**
|
|
29
|
-
function makeSecurityGroupAccessibleFromSharedAlb(securityGroup
|
|
30
|
-
new awsx.ec2.IngressSecurityGroupRule(
|
|
30
|
+
/** @deprecated use makeSecurityGroupAccessibleFromSharedAlbV2 */
|
|
31
|
+
function makeSecurityGroupAccessibleFromSharedAlb(securityGroup) {
|
|
32
|
+
new awsx.ec2.IngressSecurityGroupRule("accept-alb-ingress-rule", 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,18 @@ function makeSecurityGroupAccessibleFromSharedAlb(securityGroup, ruleName = "")
|
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
exports.makeSecurityGroupAccessibleFromSharedAlb = makeSecurityGroupAccessibleFromSharedAlb;
|
|
41
|
+
/** @deprecated Makes a given securityGropup accesible by the shared supra ALB */
|
|
42
|
+
function makeSecurityGroupAccessibleFromSharedAlbV2(securityGroup, ruleName = "") {
|
|
43
|
+
new aws.ec2.SecurityGroupRule((0, utils_1.withRuleName)("accept-alb-ingress-rule-v2", ruleName), {
|
|
44
|
+
securityGroupId: securityGroup.id,
|
|
45
|
+
sourceSecurityGroupId: (0, values_1.getEnvConfiguration)().then(($) => $.albSecurityGroupId),
|
|
46
|
+
description: `Allow access from the supra ALB`,
|
|
47
|
+
fromPort: 65000,
|
|
48
|
+
toPort: 0,
|
|
49
|
+
protocol: "-1",
|
|
50
|
+
type: "egress",
|
|
51
|
+
}, { deleteBeforeReplace: true });
|
|
52
|
+
}
|
|
53
|
+
exports.makeSecurityGroupAccessibleFromSharedAlbV2 = makeSecurityGroupAccessibleFromSharedAlbV2;
|
|
39
54
|
exports.default = exports.acceptAlbSecurityGroup;
|
|
40
55
|
//# sourceMappingURL=acceptAlb.js.map
|
package/acceptBastion.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ 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
|
-
|
|
6
|
+
/** @deprecated use makeSecurityGroupAccessibleFromBastionV2 */
|
|
7
|
+
export declare function makeSecurityGroupAccessibleFromBastion(securityGroup: awsx.ec2.SecurityGroup): void;
|
|
8
|
+
export declare function makeSecurityGroupAccessibleFromBastionV2(securityGroup: awsx.ec2.SecurityGroup, ruleName?: string): void;
|
|
7
9
|
export default acceptBastionSecurityGroup;
|
package/acceptBastion.js
CHANGED
|
@@ -9,11 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.makeSecurityGroupAccessibleFromBastion = exports.acceptBastionSecurityGroupId = exports.acceptBastionSecurityGroup = void 0;
|
|
12
|
+
exports.makeSecurityGroupAccessibleFromBastionV2 = exports.makeSecurityGroupAccessibleFromBastion = exports.acceptBastionSecurityGroupId = exports.acceptBastionSecurityGroup = void 0;
|
|
13
13
|
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,16 +31,28 @@ 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
|
-
|
|
34
|
-
|
|
34
|
+
/** @deprecated use makeSecurityGroupAccessibleFromBastionV2 */
|
|
35
|
+
function makeSecurityGroupAccessibleFromBastion(securityGroup) {
|
|
36
|
+
new aws.ec2.SecurityGroupRule("accesible-from-bastion", {
|
|
35
37
|
securityGroupId: securityGroup.id,
|
|
36
38
|
sourceSecurityGroupId: bastionSecurityGroupId(),
|
|
37
39
|
fromPort: -1,
|
|
38
40
|
toPort: -1,
|
|
39
41
|
type: "ingress",
|
|
40
42
|
protocol: "-1",
|
|
41
|
-
});
|
|
43
|
+
}, { deleteBeforeReplace: true });
|
|
42
44
|
}
|
|
43
45
|
exports.makeSecurityGroupAccessibleFromBastion = makeSecurityGroupAccessibleFromBastion;
|
|
46
|
+
function makeSecurityGroupAccessibleFromBastionV2(securityGroup, ruleName = "") {
|
|
47
|
+
new aws.ec2.SecurityGroupRule((0, utils_1.withRuleName)("accesible-from-bastion-v2", ruleName), {
|
|
48
|
+
securityGroupId: securityGroup.id,
|
|
49
|
+
sourceSecurityGroupId: bastionSecurityGroupId(),
|
|
50
|
+
fromPort: -1,
|
|
51
|
+
toPort: -1,
|
|
52
|
+
type: "ingress",
|
|
53
|
+
protocol: "-1",
|
|
54
|
+
}, { deleteBeforeReplace: true });
|
|
55
|
+
}
|
|
56
|
+
exports.makeSecurityGroupAccessibleFromBastionV2 = makeSecurityGroupAccessibleFromBastionV2;
|
|
44
57
|
exports.default = exports.acceptBastionSecurityGroup;
|
|
45
58
|
//# sourceMappingURL=acceptBastion.js.map
|
package/accessTheInternet.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export declare function accessTheInternetSecurityGroupId(): Promise<import("@pul
|
|
|
8
8
|
export default accessTheInternetSecurityGroup;
|
|
9
9
|
/** @deprecated please use makeSecurityGroupAccessibleByCloudflare */
|
|
10
10
|
export declare function accessFromCloudflareSecurityGroup(): Promise<import("@pulumi/pulumi").Output<string>>;
|
|
11
|
+
/** @deprecated use makeSecurityGroupAccessTheInternetV2 */
|
|
12
|
+
export declare function makeSecurityGroupAccessTheInternet(securityGroup: awsx.ec2.SecurityGroup): void;
|
|
11
13
|
/** Enables egress traffic to 0.0.0.0/0/all */
|
|
12
|
-
export declare function
|
|
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");
|
|
@@ -41,9 +42,9 @@ function accessFromCloudflareSecurityGroup() {
|
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
exports.accessFromCloudflareSecurityGroup = accessFromCloudflareSecurityGroup;
|
|
44
|
-
/**
|
|
45
|
-
function makeSecurityGroupAccessTheInternet(securityGroup
|
|
46
|
-
securityGroup.createEgressRule(
|
|
45
|
+
/** @deprecated use makeSecurityGroupAccessTheInternetV2 */
|
|
46
|
+
function makeSecurityGroupAccessTheInternet(securityGroup) {
|
|
47
|
+
securityGroup.createEgressRule("access-the-internet", {
|
|
47
48
|
cidrBlocks: ["0.0.0.0/0"],
|
|
48
49
|
fromPort: -1,
|
|
49
50
|
toPort: -1,
|
|
@@ -51,6 +52,18 @@ function makeSecurityGroupAccessTheInternet(securityGroup, ruleName = "") {
|
|
|
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);
|
|
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);
|
|
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);
|
|
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);
|
|
234
234
|
const service = yield createInternalService({
|
|
235
235
|
serviceName,
|
|
236
236
|
cluster,
|
package/package.json
CHANGED
package/prometheus.d.ts
CHANGED
|
@@ -2,4 +2,8 @@ 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
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use makeSecurityGroupAccessibleByPrometheusV2
|
|
7
|
+
*/
|
|
8
|
+
export declare function makeSecurityGroupAccessibleByPrometheus(securityGroup: awsx.ec2.SecurityGroup, fromPort?: number, toPort?: number): void;
|
|
9
|
+
export declare function makeSecurityGroupAccessibleByPrometheusV2(securityGroup: awsx.ec2.SecurityGroup, fromPort?: number, toPort?: number, ruleName?: string): void;
|
package/prometheus.js
CHANGED
|
@@ -9,11 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.makeSecurityGroupAccessibleByPrometheus = exports.prometheusSecurityGroupId = exports.prometheusStack = void 0;
|
|
12
|
+
exports.makeSecurityGroupAccessibleByPrometheusV2 = exports.makeSecurityGroupAccessibleByPrometheus = exports.prometheusSecurityGroupId = exports.prometheusStack = void 0;
|
|
13
13
|
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,11 @@ 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
|
-
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated use makeSecurityGroupAccessibleByPrometheusV2
|
|
27
|
+
*/
|
|
28
|
+
function makeSecurityGroupAccessibleByPrometheus(securityGroup, fromPort = 0, toPort = 0) {
|
|
29
|
+
new awsx.ec2.IngressSecurityGroupRule(`accept-prom-${fromPort}-${toPort}`, securityGroup, {
|
|
26
30
|
sourceSecurityGroupId: (0, exports.prometheusSecurityGroupId)(),
|
|
27
31
|
description: `Allow access from prometheus`,
|
|
28
32
|
fromPort,
|
|
@@ -31,4 +35,14 @@ function makeSecurityGroupAccessibleByPrometheus(securityGroup, fromPort = 0, to
|
|
|
31
35
|
});
|
|
32
36
|
}
|
|
33
37
|
exports.makeSecurityGroupAccessibleByPrometheus = makeSecurityGroupAccessibleByPrometheus;
|
|
38
|
+
function makeSecurityGroupAccessibleByPrometheusV2(securityGroup, fromPort = 0, toPort = 0, ruleName = "") {
|
|
39
|
+
new awsx.ec2.IngressSecurityGroupRule((0, utils_1.withRuleName)(`accept-prom-${fromPort}-${toPort}-v2`, ruleName), securityGroup, {
|
|
40
|
+
sourceSecurityGroupId: (0, exports.prometheusSecurityGroupId)(),
|
|
41
|
+
description: `Allow access from prometheus`,
|
|
42
|
+
fromPort,
|
|
43
|
+
toPort,
|
|
44
|
+
protocol: "-1",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.makeSecurityGroupAccessibleByPrometheusV2 = makeSecurityGroupAccessibleByPrometheusV2;
|
|
34
48
|
//# sourceMappingURL=prometheus.js.map
|
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
|