dcl-ops-lib 8.3.3 → 9.1.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/acceptBastion.js +3 -12
- package/acceptDb.js +6 -15
- package/accessTheInternet.js +23 -34
- package/alb.js +7 -16
- package/buildStatic.js +1 -2
- package/cloudflare.js +47 -57
- package/createFargateTask.d.ts +3 -2
- package/createFargateTask.js +233 -252
- package/createImageFromContext.js +6 -2
- package/createSQSTriggeredFargateTask.d.ts +63 -0
- package/createSQSTriggeredFargateTask.js +110 -0
- package/createScheduledFargateTask.d.ts +75 -0
- package/createScheduledFargateTask.js +108 -0
- package/exposePublicService.js +74 -85
- package/fargateHelpers.d.ts +220 -0
- package/fargateHelpers.js +178 -0
- package/getAmi.js +14 -25
- package/getImageRegistryAndCredentials.js +3 -12
- package/index.d.ts +32 -0
- package/index.js +52 -0
- package/lambda.js +124 -132
- package/package.json +13 -9
- package/prometheus.js +6 -15
- package/scheduledTaskBase.d.ts +142 -0
- package/scheduledTaskBase.js +146 -0
- package/slack.d.ts +4 -0
- package/slack.js +21 -0
- package/utils.js +1 -1
- package/values.js +12 -23
- package/vpc.js +7 -18
package/slack.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSlackNotificationLambdaArn = exports.getSlackNotificationTopicArn = exports.slackStack = void 0;
|
|
4
|
+
const pulumi = require("@pulumi/pulumi");
|
|
5
|
+
const domain_1 = require("./domain");
|
|
6
|
+
const withCache_1 = require("./withCache");
|
|
7
|
+
// Stack reference to the ops-lambdas stack that contains the Slack notifier infrastructure
|
|
8
|
+
exports.slackStack = (0, withCache_1.default)(async () => {
|
|
9
|
+
return new pulumi.StackReference(`ops-lambdas-${domain_1.env}`);
|
|
10
|
+
});
|
|
11
|
+
// Get the SNS topic ARN for Slack notifications
|
|
12
|
+
exports.getSlackNotificationTopicArn = (0, withCache_1.default)(async () => {
|
|
13
|
+
const stack = await (0, exports.slackStack)();
|
|
14
|
+
return (await stack.requireOutputValue("slackNotifierTopicArn"));
|
|
15
|
+
});
|
|
16
|
+
// Get the Lambda ARN for direct invocation (optional, prefer SNS topic)
|
|
17
|
+
exports.getSlackNotificationLambdaArn = (0, withCache_1.default)(async () => {
|
|
18
|
+
const stack = await (0, exports.slackStack)();
|
|
19
|
+
return (await stack.requireOutputValue("slackNotifierLambdaArn"));
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=slack.js.map
|
package/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ function sha256hash(s) {
|
|
|
9
9
|
}
|
|
10
10
|
exports.sha256hash = sha256hash;
|
|
11
11
|
function withRuleName(name, ruleName) {
|
|
12
|
-
if (ruleName
|
|
12
|
+
if (ruleName?.length) {
|
|
13
13
|
return `${ruleName}-${name}`;
|
|
14
14
|
}
|
|
15
15
|
return name;
|
package/values.js
CHANGED
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.getEnvConfiguration = void 0;
|
|
13
4
|
const aws = require("@pulumi/aws");
|
|
14
5
|
const supra_1 = require("./supra");
|
|
15
6
|
const withCache_1 = require("./withCache");
|
|
16
|
-
exports.getEnvConfiguration = (0, withCache_1.default)(function () {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
});
|
|
7
|
+
exports.getEnvConfiguration = (0, withCache_1.default)(async function () {
|
|
8
|
+
return {
|
|
9
|
+
defaultSecurityGroupId: await supra_1.supra.getOutputValue("acceptBastionSecurityGroupId"),
|
|
10
|
+
publicSubnets: (await aws.ec2.getSubnets({ filters: [{ name: "tag:type", values: ["public"] }] })).ids,
|
|
11
|
+
privateSubnets: (await aws.ec2.getSubnets({ filters: [{ name: "tag:type", values: ["private"] }] })).ids,
|
|
12
|
+
internalSubnets: (await aws.ec2.getSubnets({ filters: [{ name: "tag:type", values: ["internal"] }] })).ids,
|
|
13
|
+
acceptAlb: await supra_1.supra.getOutputValue("acceptAlbSecurityGroupId"),
|
|
14
|
+
acceptBastion: await supra_1.supra.getOutputValue("acceptBastionSecurityGroupId"),
|
|
15
|
+
dbSecurity: await supra_1.supra.getOutputValue("acceptDbSecurityGroupId"),
|
|
16
|
+
albSecurityGroupId: await supra_1.supra.getOutputValue("albSecurityGroupId"),
|
|
17
|
+
bastionSecurityGroupId: await supra_1.supra.getOutputValue("bastionSecurityGroupId"),
|
|
18
|
+
};
|
|
30
19
|
});
|
|
31
20
|
//# sourceMappingURL=values.js.map
|
package/vpc.js
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.getVpc = exports.vpc = void 0;
|
|
13
4
|
const aws = require("@pulumi/aws");
|
|
14
5
|
const supra_1 = require("./supra");
|
|
15
6
|
let vpcReference;
|
|
16
|
-
function vpc() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return vpcReference;
|
|
24
|
-
});
|
|
7
|
+
async function vpc() {
|
|
8
|
+
if (!vpcReference) {
|
|
9
|
+
vpcReference = await aws.ec2.getVpc({
|
|
10
|
+
id: await supra_1.supra.getOutputValue('vpcId')
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return vpcReference;
|
|
25
14
|
}
|
|
26
15
|
exports.vpc = vpc;
|
|
27
16
|
exports.getVpc = vpc;
|