@datadog/datadog-ci 0.17.9 → 0.17.13
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/LICENSE-3rdparty.csv +2 -0
- package/README.md +9 -2
- package/dist/{commands/dependencies/index.d.ts → cli.d.ts} +0 -0
- package/dist/cli.js +34 -0
- package/dist/commands/{dsyms/index.d.ts → dependencies/cli.d.ts} +0 -0
- package/dist/commands/dependencies/{index.js → cli.js} +0 -0
- package/dist/commands/dependencies/upload.d.ts +1 -1
- package/dist/commands/{git-metadata/index.d.ts → dsyms/cli.d.ts} +0 -0
- package/dist/commands/dsyms/{index.js → cli.js} +0 -0
- package/dist/commands/dsyms/upload.d.ts +1 -1
- package/dist/commands/{junit/index.d.ts → git-metadata/cli.d.ts} +0 -0
- package/dist/commands/git-metadata/{index.js → cli.js} +0 -0
- package/dist/commands/git-metadata/upload.d.ts +1 -1
- package/dist/commands/git-metadata/upload.js +6 -1
- package/dist/commands/{lambda/index.d.ts → junit/cli.d.ts} +0 -0
- package/dist/commands/junit/{index.js → cli.js} +0 -0
- package/dist/commands/junit/upload.d.ts +1 -1
- package/dist/commands/junit/upload.js +1 -1
- package/dist/commands/lambda/__tests__/fixtures.d.ts +5 -1
- package/dist/commands/lambda/__tests__/fixtures.js +13 -2
- package/dist/commands/lambda/__tests__/functions/commons.test.js +400 -0
- package/dist/commands/lambda/__tests__/functions/instrument.test.js +229 -117
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.js +80 -7
- package/dist/commands/lambda/__tests__/instrument.test.js +542 -111
- package/dist/commands/{sourcemaps/index.d.ts → lambda/__tests__/prompt.test.d.ts} +0 -0
- package/dist/commands/lambda/__tests__/prompt.test.js +216 -0
- package/dist/commands/lambda/__tests__/uninstrument.test.js +381 -17
- package/dist/commands/{trace/index.d.ts → lambda/cli.d.ts} +0 -0
- package/dist/commands/lambda/{index.js → cli.js} +0 -0
- package/dist/commands/lambda/constants.d.ts +27 -6
- package/dist/commands/lambda/constants.js +63 -6
- package/dist/commands/lambda/functions/commons.d.ts +49 -4
- package/dist/commands/lambda/functions/commons.js +198 -7
- package/dist/commands/lambda/functions/instrument.d.ts +5 -14
- package/dist/commands/lambda/functions/instrument.js +63 -80
- package/dist/commands/lambda/functions/uninstrument.d.ts +3 -2
- package/dist/commands/lambda/functions/uninstrument.js +23 -11
- package/dist/commands/lambda/instrument.d.ts +2 -1
- package/dist/commands/lambda/instrument.js +112 -58
- package/dist/commands/lambda/interfaces.d.ts +4 -1
- package/dist/commands/lambda/loggroup.js +3 -1
- package/dist/commands/lambda/prompt.d.ts +9 -0
- package/dist/commands/lambda/prompt.js +187 -0
- package/dist/commands/lambda/uninstrument.d.ts +2 -0
- package/dist/commands/lambda/uninstrument.js +107 -30
- package/dist/commands/sourcemaps/cli.d.ts +1 -0
- package/dist/commands/sourcemaps/{index.js → cli.js} +0 -0
- package/dist/commands/sourcemaps/upload.d.ts +1 -1
- package/dist/commands/synthetics/__tests__/cli.test.js +36 -13
- package/dist/commands/synthetics/__tests__/fixtures.js +1 -0
- package/dist/commands/synthetics/__tests__/run-test.test.js +48 -2
- package/dist/commands/synthetics/__tests__/utils.test.js +11 -4
- package/dist/commands/synthetics/__tests__/websocket.test.js +3 -3
- package/dist/commands/synthetics/cli.d.ts +1 -26
- package/dist/commands/synthetics/cli.js +2 -227
- package/dist/commands/synthetics/command.d.ts +27 -0
- package/dist/commands/synthetics/command.js +236 -0
- package/dist/commands/synthetics/index.d.ts +5 -1
- package/dist/commands/synthetics/index.js +31 -2
- package/dist/commands/synthetics/interfaces.d.ts +8 -3
- package/dist/commands/synthetics/interfaces.js +7 -3
- package/dist/commands/synthetics/reporters/default.js +5 -1
- package/dist/commands/synthetics/run-test.js +3 -1
- package/dist/commands/synthetics/utils.d.ts +3 -3
- package/dist/commands/synthetics/utils.js +17 -8
- package/dist/commands/trace/api.js +1 -1
- package/dist/commands/trace/cli.d.ts +1 -0
- package/dist/commands/trace/{index.js → cli.js} +0 -0
- package/dist/commands/trace/trace.d.ts +1 -1
- package/dist/helpers/__tests__/ci.test.js +97 -136
- package/dist/helpers/__tests__/user-provided-git.test.js +81 -27
- package/dist/helpers/__tests__/utils.test.js +4 -0
- package/dist/helpers/ci.js +54 -95
- package/dist/helpers/interfaces.d.ts +28 -2
- package/dist/helpers/user-provided-git.d.ts +2 -1
- package/dist/helpers/user-provided-git.js +29 -5
- package/dist/helpers/utils.d.ts +4 -0
- package/dist/helpers/utils.js +18 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +23 -31
- package/package.json +10 -8
|
File without changes
|
|
@@ -1,30 +1,41 @@
|
|
|
1
|
+
export declare const DD_LAMBDA_EXTENSION_LAYER_NAME = "Datadog-Extension";
|
|
2
|
+
export declare const EXTENSION_LAYER_KEY = "extension";
|
|
1
3
|
export declare const RUNTIME_LAYER_LOOKUP: {
|
|
2
|
-
readonly
|
|
4
|
+
readonly extension: "Datadog-Extension";
|
|
3
5
|
readonly 'nodejs12.x': "Datadog-Node12-x";
|
|
4
6
|
readonly 'nodejs14.x': "Datadog-Node14-x";
|
|
5
|
-
readonly 'python2.7': "Datadog-Python27";
|
|
6
7
|
readonly 'python3.6': "Datadog-Python36";
|
|
7
8
|
readonly 'python3.7': "Datadog-Python37";
|
|
8
9
|
readonly 'python3.8': "Datadog-Python38";
|
|
9
10
|
readonly 'python3.9': "Datadog-Python39";
|
|
10
11
|
};
|
|
11
|
-
export declare type Runtime = keyof typeof RUNTIME_LAYER_LOOKUP
|
|
12
|
+
export declare type Runtime = Exclude<keyof typeof RUNTIME_LAYER_LOOKUP, typeof EXTENSION_LAYER_KEY>;
|
|
13
|
+
export declare const ARM_RUNTIMES: string[];
|
|
14
|
+
export declare const ARM64_ARCHITECTURE = "arm64";
|
|
15
|
+
export declare const ARM_LAYER_SUFFIX = "-ARM";
|
|
16
|
+
export declare enum RuntimeType {
|
|
17
|
+
NODE = 0,
|
|
18
|
+
PYTHON = 1
|
|
19
|
+
}
|
|
20
|
+
export declare const RUNTIME_LOOKUP: {
|
|
21
|
+
[key: string]: RuntimeType;
|
|
22
|
+
};
|
|
12
23
|
export declare const HANDLER_LOCATION: {
|
|
13
|
-
'nodejs10.x': string;
|
|
14
24
|
'nodejs12.x': string;
|
|
15
25
|
'nodejs14.x': string;
|
|
16
|
-
'python2.7': string;
|
|
17
26
|
'python3.6': string;
|
|
18
27
|
'python3.7': string;
|
|
19
28
|
'python3.8': string;
|
|
20
29
|
'python3.9': string;
|
|
21
30
|
};
|
|
31
|
+
export declare const SITES: string[];
|
|
32
|
+
export declare const AWS_REGIONS: string[];
|
|
22
33
|
export declare const DEFAULT_LAYER_AWS_ACCOUNT = "464622532012";
|
|
23
34
|
export declare const GOVCLOUD_LAYER_AWS_ACCOUNT = "002406178527";
|
|
24
35
|
export declare const SUBSCRIPTION_FILTER_NAME = "datadog-ci-filter";
|
|
25
36
|
export declare const TAG_VERSION_NAME = "dd_sls_ci";
|
|
26
|
-
export declare const DD_LAMBDA_EXTENSION_LAYER_NAME = "Datadog-Extension";
|
|
27
37
|
export declare const API_KEY_ENV_VAR = "DD_API_KEY";
|
|
38
|
+
export declare const API_KEY_SECRET_ARN_ENV_VAR = "DD_API_KEY_SECRET_ARN";
|
|
28
39
|
export declare const KMS_API_KEY_ENV_VAR = "DD_KMS_API_KEY";
|
|
29
40
|
export declare const SITE_ENV_VAR = "DD_SITE";
|
|
30
41
|
export declare const TRACE_ENABLED_ENV_VAR = "DD_TRACE_ENABLED";
|
|
@@ -36,9 +47,19 @@ export declare const SERVICE_ENV_VAR = "DD_SERVICE";
|
|
|
36
47
|
export declare const VERSION_ENV_VAR = "DD_VERSION";
|
|
37
48
|
export declare const ENVIRONMENT_ENV_VAR = "DD_ENV";
|
|
38
49
|
export declare const EXTRA_TAGS_ENV_VAR = "DD_TAGS";
|
|
50
|
+
export declare const CAPTURE_LAMBDA_PAYLOAD_ENV_VAR = "DD_CAPTURE_LAMBDA_PAYLOAD";
|
|
39
51
|
export declare const CI_SITE_ENV_VAR = "DATADOG_SITE";
|
|
40
52
|
export declare const CI_API_KEY_ENV_VAR = "DATADOG_API_KEY";
|
|
53
|
+
export declare const CI_API_KEY_SECRET_ARN_ENV_VAR = "DATADOG_API_KEY_SECRET_ARN";
|
|
41
54
|
export declare const CI_KMS_API_KEY_ENV_VAR = "DATADOG_KMS_API_KEY";
|
|
55
|
+
export declare const AWS_ACCESS_KEY_ID_ENV_VAR = "AWS_ACCESS_KEY_ID";
|
|
56
|
+
export declare const AWS_SECRET_ACCESS_KEY_ENV_VAR = "AWS_SECRET_ACCESS_KEY";
|
|
57
|
+
export declare const AWS_DEFAULT_REGION_ENV_VAR = "AWS_DEFAULT_REGION";
|
|
58
|
+
export declare const AWS_SESSION_TOKEN_ENV_VAR = "AWS_SESSION_TOKEN";
|
|
42
59
|
export declare const LIST_FUNCTIONS_MAX_RETRY_COUNT = 2;
|
|
43
60
|
export declare const MAX_LAMBDA_STATE_CHECK_ATTEMPTS = 3;
|
|
44
61
|
export declare const EXTRA_TAGS_REG_EXP: RegExp;
|
|
62
|
+
export declare const AWS_ACCESS_KEY_ID_REG_EXP: RegExp;
|
|
63
|
+
export declare const AWS_SECRET_ACCESS_KEY_REG_EXP: RegExp;
|
|
64
|
+
export declare const DATADOG_API_KEY_REG_EXP: RegExp;
|
|
65
|
+
export declare const DATADOG_APP_KEY_REG_EXP: RegExp;
|
|
@@ -1,35 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EXTRA_TAGS_REG_EXP = exports.MAX_LAMBDA_STATE_CHECK_ATTEMPTS = exports.LIST_FUNCTIONS_MAX_RETRY_COUNT = exports.CI_KMS_API_KEY_ENV_VAR = exports.CI_API_KEY_ENV_VAR = exports.CI_SITE_ENV_VAR = exports.EXTRA_TAGS_ENV_VAR = exports.ENVIRONMENT_ENV_VAR = exports.VERSION_ENV_VAR = exports.SERVICE_ENV_VAR = exports.LAMBDA_HANDLER_ENV_VAR = exports.LOG_LEVEL_ENV_VAR = exports.FLUSH_TO_LOG_ENV_VAR = exports.MERGE_XRAY_TRACES_ENV_VAR = exports.TRACE_ENABLED_ENV_VAR = exports.SITE_ENV_VAR = exports.KMS_API_KEY_ENV_VAR = exports.
|
|
3
|
+
exports.DATADOG_APP_KEY_REG_EXP = exports.DATADOG_API_KEY_REG_EXP = exports.AWS_SECRET_ACCESS_KEY_REG_EXP = exports.AWS_ACCESS_KEY_ID_REG_EXP = exports.EXTRA_TAGS_REG_EXP = exports.MAX_LAMBDA_STATE_CHECK_ATTEMPTS = exports.LIST_FUNCTIONS_MAX_RETRY_COUNT = exports.AWS_SESSION_TOKEN_ENV_VAR = exports.AWS_DEFAULT_REGION_ENV_VAR = exports.AWS_SECRET_ACCESS_KEY_ENV_VAR = exports.AWS_ACCESS_KEY_ID_ENV_VAR = exports.CI_KMS_API_KEY_ENV_VAR = exports.CI_API_KEY_SECRET_ARN_ENV_VAR = exports.CI_API_KEY_ENV_VAR = exports.CI_SITE_ENV_VAR = exports.CAPTURE_LAMBDA_PAYLOAD_ENV_VAR = exports.EXTRA_TAGS_ENV_VAR = exports.ENVIRONMENT_ENV_VAR = exports.VERSION_ENV_VAR = exports.SERVICE_ENV_VAR = exports.LAMBDA_HANDLER_ENV_VAR = exports.LOG_LEVEL_ENV_VAR = exports.FLUSH_TO_LOG_ENV_VAR = exports.MERGE_XRAY_TRACES_ENV_VAR = exports.TRACE_ENABLED_ENV_VAR = exports.SITE_ENV_VAR = exports.KMS_API_KEY_ENV_VAR = exports.API_KEY_SECRET_ARN_ENV_VAR = exports.API_KEY_ENV_VAR = exports.TAG_VERSION_NAME = exports.SUBSCRIPTION_FILTER_NAME = exports.GOVCLOUD_LAYER_AWS_ACCOUNT = exports.DEFAULT_LAYER_AWS_ACCOUNT = exports.AWS_REGIONS = exports.SITES = exports.HANDLER_LOCATION = exports.RUNTIME_LOOKUP = exports.RuntimeType = exports.ARM_LAYER_SUFFIX = exports.ARM64_ARCHITECTURE = exports.ARM_RUNTIMES = exports.RUNTIME_LAYER_LOOKUP = exports.EXTENSION_LAYER_KEY = exports.DD_LAMBDA_EXTENSION_LAYER_NAME = void 0;
|
|
4
|
+
exports.DD_LAMBDA_EXTENSION_LAYER_NAME = 'Datadog-Extension';
|
|
5
|
+
exports.EXTENSION_LAYER_KEY = 'extension';
|
|
4
6
|
exports.RUNTIME_LAYER_LOOKUP = {
|
|
5
|
-
|
|
7
|
+
[exports.EXTENSION_LAYER_KEY]: exports.DD_LAMBDA_EXTENSION_LAYER_NAME,
|
|
6
8
|
'nodejs12.x': 'Datadog-Node12-x',
|
|
7
9
|
'nodejs14.x': 'Datadog-Node14-x',
|
|
8
|
-
'python2.7': 'Datadog-Python27',
|
|
9
10
|
'python3.6': 'Datadog-Python36',
|
|
10
11
|
'python3.7': 'Datadog-Python37',
|
|
11
12
|
'python3.8': 'Datadog-Python38',
|
|
12
13
|
'python3.9': 'Datadog-Python39',
|
|
13
14
|
};
|
|
15
|
+
exports.ARM_RUNTIMES = [exports.EXTENSION_LAYER_KEY, 'python3.8', 'python3.9'];
|
|
16
|
+
exports.ARM64_ARCHITECTURE = 'arm64';
|
|
17
|
+
exports.ARM_LAYER_SUFFIX = '-ARM';
|
|
18
|
+
var RuntimeType;
|
|
19
|
+
(function (RuntimeType) {
|
|
20
|
+
RuntimeType[RuntimeType["NODE"] = 0] = "NODE";
|
|
21
|
+
RuntimeType[RuntimeType["PYTHON"] = 1] = "PYTHON";
|
|
22
|
+
})(RuntimeType = exports.RuntimeType || (exports.RuntimeType = {}));
|
|
23
|
+
exports.RUNTIME_LOOKUP = {
|
|
24
|
+
'nodejs12.x': RuntimeType.NODE,
|
|
25
|
+
'nodejs14.x': RuntimeType.NODE,
|
|
26
|
+
'python3.6': RuntimeType.PYTHON,
|
|
27
|
+
'python3.7': RuntimeType.PYTHON,
|
|
28
|
+
'python3.8': RuntimeType.PYTHON,
|
|
29
|
+
'python3.9': RuntimeType.PYTHON,
|
|
30
|
+
};
|
|
14
31
|
const PYTHON_HANDLER_LOCATION = 'datadog_lambda.handler.handler';
|
|
15
32
|
const NODE_HANDLER_LOCATION = '/opt/nodejs/node_modules/datadog-lambda-js/handler.handler';
|
|
16
33
|
exports.HANDLER_LOCATION = {
|
|
17
|
-
'nodejs10.x': NODE_HANDLER_LOCATION,
|
|
18
34
|
'nodejs12.x': NODE_HANDLER_LOCATION,
|
|
19
35
|
'nodejs14.x': NODE_HANDLER_LOCATION,
|
|
20
|
-
'python2.7': PYTHON_HANDLER_LOCATION,
|
|
21
36
|
'python3.6': PYTHON_HANDLER_LOCATION,
|
|
22
37
|
'python3.7': PYTHON_HANDLER_LOCATION,
|
|
23
38
|
'python3.8': PYTHON_HANDLER_LOCATION,
|
|
24
39
|
'python3.9': PYTHON_HANDLER_LOCATION,
|
|
25
40
|
};
|
|
41
|
+
exports.SITES = [
|
|
42
|
+
'datadoghq.com',
|
|
43
|
+
'datadoghq.eu',
|
|
44
|
+
'us3.datadoghq.com',
|
|
45
|
+
'us5.datadoghq.com',
|
|
46
|
+
'ddog-gov.com',
|
|
47
|
+
];
|
|
48
|
+
exports.AWS_REGIONS = [
|
|
49
|
+
'us-east-1',
|
|
50
|
+
'us-east-2',
|
|
51
|
+
'us-west-1',
|
|
52
|
+
'us-west-2',
|
|
53
|
+
'af-south-1',
|
|
54
|
+
'ap-east-1',
|
|
55
|
+
'ap-south-1',
|
|
56
|
+
'ap-northeast-3',
|
|
57
|
+
'ap-northeast-2',
|
|
58
|
+
'ap-southeast-1',
|
|
59
|
+
'ap-southeast-2',
|
|
60
|
+
'ap-northeast-1',
|
|
61
|
+
'ca-central-1',
|
|
62
|
+
'eu-central-1',
|
|
63
|
+
'eu-west-1',
|
|
64
|
+
'eu-west-2',
|
|
65
|
+
'eu-south-1',
|
|
66
|
+
'eu-west-3',
|
|
67
|
+
'eu-north-1',
|
|
68
|
+
'me-south-1',
|
|
69
|
+
'sa-east-1',
|
|
70
|
+
'us-gov-east-1',
|
|
71
|
+
'us-gov-west-1',
|
|
72
|
+
];
|
|
26
73
|
exports.DEFAULT_LAYER_AWS_ACCOUNT = '464622532012';
|
|
27
74
|
exports.GOVCLOUD_LAYER_AWS_ACCOUNT = '002406178527';
|
|
28
75
|
exports.SUBSCRIPTION_FILTER_NAME = 'datadog-ci-filter';
|
|
29
76
|
exports.TAG_VERSION_NAME = 'dd_sls_ci';
|
|
30
|
-
exports.DD_LAMBDA_EXTENSION_LAYER_NAME = 'Datadog-Extension';
|
|
31
77
|
// Environment variables used in the Lambda environment
|
|
32
78
|
exports.API_KEY_ENV_VAR = 'DD_API_KEY';
|
|
79
|
+
exports.API_KEY_SECRET_ARN_ENV_VAR = 'DD_API_KEY_SECRET_ARN';
|
|
33
80
|
exports.KMS_API_KEY_ENV_VAR = 'DD_KMS_API_KEY';
|
|
34
81
|
exports.SITE_ENV_VAR = 'DD_SITE';
|
|
35
82
|
exports.TRACE_ENABLED_ENV_VAR = 'DD_TRACE_ENABLED';
|
|
@@ -41,10 +88,16 @@ exports.SERVICE_ENV_VAR = 'DD_SERVICE';
|
|
|
41
88
|
exports.VERSION_ENV_VAR = 'DD_VERSION';
|
|
42
89
|
exports.ENVIRONMENT_ENV_VAR = 'DD_ENV';
|
|
43
90
|
exports.EXTRA_TAGS_ENV_VAR = 'DD_TAGS';
|
|
91
|
+
exports.CAPTURE_LAMBDA_PAYLOAD_ENV_VAR = 'DD_CAPTURE_LAMBDA_PAYLOAD';
|
|
44
92
|
// Environment variables used by Datadog CI
|
|
45
93
|
exports.CI_SITE_ENV_VAR = 'DATADOG_SITE';
|
|
46
94
|
exports.CI_API_KEY_ENV_VAR = 'DATADOG_API_KEY';
|
|
95
|
+
exports.CI_API_KEY_SECRET_ARN_ENV_VAR = 'DATADOG_API_KEY_SECRET_ARN';
|
|
47
96
|
exports.CI_KMS_API_KEY_ENV_VAR = 'DATADOG_KMS_API_KEY';
|
|
97
|
+
exports.AWS_ACCESS_KEY_ID_ENV_VAR = 'AWS_ACCESS_KEY_ID';
|
|
98
|
+
exports.AWS_SECRET_ACCESS_KEY_ENV_VAR = 'AWS_SECRET_ACCESS_KEY';
|
|
99
|
+
exports.AWS_DEFAULT_REGION_ENV_VAR = 'AWS_DEFAULT_REGION';
|
|
100
|
+
exports.AWS_SESSION_TOKEN_ENV_VAR = 'AWS_SESSION_TOKEN';
|
|
48
101
|
exports.LIST_FUNCTIONS_MAX_RETRY_COUNT = 2;
|
|
49
102
|
exports.MAX_LAMBDA_STATE_CHECK_ATTEMPTS = 3;
|
|
50
103
|
// DD_TAGS Regular Expression
|
|
@@ -52,3 +105,7 @@ exports.MAX_LAMBDA_STATE_CHECK_ATTEMPTS = 3;
|
|
|
52
105
|
// matches a list of <key>:<value> separated by commas
|
|
53
106
|
// such as: layer:api,team:intake
|
|
54
107
|
exports.EXTRA_TAGS_REG_EXP = /^(([a-zA-Z]+)\w+:[\w\-/\.]+)+((\,)([a-zA-Z]+)\w+:[\w\-/\.]+)*$/g;
|
|
108
|
+
exports.AWS_ACCESS_KEY_ID_REG_EXP = /(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])/g;
|
|
109
|
+
exports.AWS_SECRET_ACCESS_KEY_REG_EXP = /(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])/g;
|
|
110
|
+
exports.DATADOG_API_KEY_REG_EXP = /(?<![a-f0-9])[a-f0-9]{32}(?![a-f0-9])/g;
|
|
111
|
+
exports.DATADOG_APP_KEY_REG_EXP = /(?<![a-f0-9])[a-f0-9]{40}(?![a-f0-9])/g;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CloudWatchLogs, Lambda } from 'aws-sdk';
|
|
2
|
-
import {
|
|
2
|
+
import { Runtime } from '../constants';
|
|
3
|
+
import { FunctionConfiguration, InstrumentationSettings } from '../interfaces';
|
|
3
4
|
/**
|
|
4
5
|
* Returns an array of merged layer ARNs if given a Full Layer ARN,
|
|
5
6
|
* if not, it justs returns the layer ARNs provided.
|
|
@@ -9,9 +10,18 @@ import { FunctionConfiguration } from '../interfaces';
|
|
|
9
10
|
* @param layerARNs an array of layer ARNs.
|
|
10
11
|
* @returns an array of layer ARNs.
|
|
11
12
|
*/
|
|
12
|
-
export declare const
|
|
13
|
+
export declare const addLayerArn: (fullLayerArn: string | undefined, previousLayerName: string, layerARNs: string[]) => string[];
|
|
13
14
|
/**
|
|
14
|
-
* Returns
|
|
15
|
+
* Returns a coerced boolean given string booleans or booleans in
|
|
16
|
+
* an spread array. Every other value will be ignored.
|
|
17
|
+
*
|
|
18
|
+
* @param fallback default value if none of the provided `values` comply.
|
|
19
|
+
* @param values an spread array of string booleans or booleans.
|
|
20
|
+
* @returns a coerced boolean.
|
|
21
|
+
*/
|
|
22
|
+
export declare const coerceBoolean: (fallback: boolean, ...values: any[]) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Returns an array of functions grouped by its region, it
|
|
15
25
|
* throws an error if there are functions without a region.
|
|
16
26
|
*
|
|
17
27
|
* @param functions an array of strings comprised by
|
|
@@ -22,6 +32,28 @@ export declare const addLayerARN: (fullLayerARN: string | undefined, partialLaye
|
|
|
22
32
|
export declare const collectFunctionsByRegion: (functions: string[], defaultRegion: string | undefined) => {
|
|
23
33
|
[key: string]: string[];
|
|
24
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Given a layer runtime, return its latest version.
|
|
37
|
+
*
|
|
38
|
+
* @param runtime the runtime of the layer.
|
|
39
|
+
* @param region the region where the layer is stored.
|
|
40
|
+
* @returns the latest version of the layer to find.
|
|
41
|
+
*/
|
|
42
|
+
export declare const findLatestLayerVersion: (runtime: Runtime, region: string) => Promise<number>;
|
|
43
|
+
export declare const isMissingAWSCredentials: () => boolean;
|
|
44
|
+
export declare const isMissingDatadogSiteEnvVar: () => boolean;
|
|
45
|
+
export declare const isMissingAnyDatadogApiKeyEnvVar: () => boolean;
|
|
46
|
+
export declare const isMissingDatadogEnvVars: () => boolean;
|
|
47
|
+
export declare const getAllLambdaFunctionConfigs: (lambda: Lambda) => Promise<Lambda.FunctionConfiguration[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Given a Lambda instance and a regular expression,
|
|
50
|
+
* returns all the Function Configurations that match.
|
|
51
|
+
*
|
|
52
|
+
* @param lambda an instance of Lambda from aws-sdk.
|
|
53
|
+
* @param pattern a regular expression
|
|
54
|
+
* @returns an array of Lambda FunctionConfiguration's that match the pattern above.
|
|
55
|
+
*/
|
|
56
|
+
export declare const getLambdaFunctionConfigsFromRegex: (lambda: Lambda, pattern: string) => Promise<Lambda.FunctionConfiguration[]>;
|
|
25
57
|
/**
|
|
26
58
|
* Given a Lambda instance and an array of Lambda names,
|
|
27
59
|
* return all the Lambda Function Configurations.
|
|
@@ -32,6 +64,18 @@ export declare const collectFunctionsByRegion: (functions: string[], defaultRegi
|
|
|
32
64
|
* @returns an array of Lambda FunctionConfiguration's.
|
|
33
65
|
*/
|
|
34
66
|
export declare const getLambdaFunctionConfigs: (lambda: Lambda, functionARNs: string[]) => Promise<Lambda.FunctionConfiguration[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the correct ARN of a **Specific Runtime Layer** given its configuration, region,
|
|
69
|
+
* and settings (optional).
|
|
70
|
+
*
|
|
71
|
+
* @param config a Lambda FunctionConfiguration.
|
|
72
|
+
* @param region a region where the layer is hosted.
|
|
73
|
+
* @param settings instrumentation settings, mainly used to change the AWS account that contains the Layer.
|
|
74
|
+
* @returns the ARN of a **Specific Runtime Layer** with the correct region, account, architecture, and name.
|
|
75
|
+
*/
|
|
76
|
+
export declare const getLayerArn: (config: Lambda.FunctionConfiguration, runtime: Runtime, region: string, settings?: InstrumentationSettings | undefined) => string;
|
|
77
|
+
export declare const getLayerNameWithVersion: (layerArn: string) => string | undefined;
|
|
78
|
+
export declare const getLayers: (config: Lambda.FunctionConfiguration) => string[];
|
|
35
79
|
/**
|
|
36
80
|
* Call the aws-sdk Lambda api to get a Function given
|
|
37
81
|
* an ARN and then return its Configuration.
|
|
@@ -66,6 +110,7 @@ export declare const isLambdaActive: (lambda: Lambda, config: Lambda.FunctionCon
|
|
|
66
110
|
* @param runtime a string representing a Lambda FunctionConfiguration Runtime.
|
|
67
111
|
* @returns if a runtime is supported.
|
|
68
112
|
*/
|
|
69
|
-
export declare const isSupportedRuntime: (runtime?: string | undefined) => runtime is
|
|
113
|
+
export declare const isSupportedRuntime: (runtime?: string | undefined) => runtime is Runtime;
|
|
70
114
|
export declare const sentenceMatchesRegEx: (sentence: string, regex: RegExp) => RegExpMatchArray | null;
|
|
71
115
|
export declare const updateLambdaFunctionConfigs: (lambda: Lambda, cloudWatch: CloudWatchLogs, configs: FunctionConfiguration[]) => Promise<void>;
|
|
116
|
+
export declare const willUpdateFunctionConfigs: (configs: FunctionConfiguration[]) => boolean;
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.updateLambdaFunctionConfigs = exports.sentenceMatchesRegEx = exports.isSupportedRuntime = exports.isLambdaActive = exports.getRegion = exports.getLambdaFunctionConfig = exports.getLambdaFunctionConfigs = exports.collectFunctionsByRegion = exports.
|
|
12
|
+
exports.willUpdateFunctionConfigs = exports.updateLambdaFunctionConfigs = exports.sentenceMatchesRegEx = exports.isSupportedRuntime = exports.isLambdaActive = exports.getRegion = exports.getLambdaFunctionConfig = exports.getLayers = exports.getLayerNameWithVersion = exports.getLayerArn = exports.getLambdaFunctionConfigs = exports.getLambdaFunctionConfigsFromRegex = exports.getAllLambdaFunctionConfigs = exports.isMissingDatadogEnvVars = exports.isMissingAnyDatadogApiKeyEnvVar = exports.isMissingDatadogSiteEnvVar = exports.isMissingAWSCredentials = exports.findLatestLayerVersion = exports.collectFunctionsByRegion = exports.coerceBoolean = exports.addLayerArn = void 0;
|
|
13
|
+
const aws_sdk_1 = require("aws-sdk");
|
|
13
14
|
const constants_1 = require("../constants");
|
|
14
15
|
const loggroup_1 = require("../loggroup");
|
|
15
16
|
const tags_1 = require("../tags");
|
|
@@ -22,18 +23,46 @@ const tags_1 = require("../tags");
|
|
|
22
23
|
* @param layerARNs an array of layer ARNs.
|
|
23
24
|
* @returns an array of layer ARNs.
|
|
24
25
|
*/
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
if (!layerARNs.includes(
|
|
26
|
+
const addLayerArn = (fullLayerArn, previousLayerName, layerARNs) => {
|
|
27
|
+
if (fullLayerArn) {
|
|
28
|
+
if (!layerARNs.includes(fullLayerArn)) {
|
|
28
29
|
// Remove any other versions of the layer
|
|
29
|
-
layerARNs = [...layerARNs.filter((
|
|
30
|
+
layerARNs = [...layerARNs.filter((layer) => !layer.includes(previousLayerName)), fullLayerArn];
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
return layerARNs;
|
|
33
34
|
};
|
|
34
|
-
exports.
|
|
35
|
+
exports.addLayerArn = addLayerArn;
|
|
35
36
|
/**
|
|
36
|
-
* Returns
|
|
37
|
+
* Returns a coerced boolean given string booleans or booleans in
|
|
38
|
+
* an spread array. Every other value will be ignored.
|
|
39
|
+
*
|
|
40
|
+
* @param fallback default value if none of the provided `values` comply.
|
|
41
|
+
* @param values an spread array of string booleans or booleans.
|
|
42
|
+
* @returns a coerced boolean.
|
|
43
|
+
*/
|
|
44
|
+
const coerceBoolean = (fallback, ...values) => {
|
|
45
|
+
for (const value of values) {
|
|
46
|
+
switch (typeof value) {
|
|
47
|
+
case 'boolean':
|
|
48
|
+
return value;
|
|
49
|
+
case 'string':
|
|
50
|
+
if (value.toString().toLowerCase() === 'true') {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
else if (value.toString().toLowerCase() === 'false') {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
default:
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return fallback;
|
|
62
|
+
};
|
|
63
|
+
exports.coerceBoolean = coerceBoolean;
|
|
64
|
+
/**
|
|
65
|
+
* Returns an array of functions grouped by its region, it
|
|
37
66
|
* throws an error if there are functions without a region.
|
|
38
67
|
*
|
|
39
68
|
* @param functions an array of strings comprised by
|
|
@@ -63,6 +92,122 @@ const collectFunctionsByRegion = (functions, defaultRegion) => {
|
|
|
63
92
|
return groups;
|
|
64
93
|
};
|
|
65
94
|
exports.collectFunctionsByRegion = collectFunctionsByRegion;
|
|
95
|
+
/**
|
|
96
|
+
* Given a layer runtime, return its latest version.
|
|
97
|
+
*
|
|
98
|
+
* @param runtime the runtime of the layer.
|
|
99
|
+
* @param region the region where the layer is stored.
|
|
100
|
+
* @returns the latest version of the layer to find.
|
|
101
|
+
*/
|
|
102
|
+
const findLatestLayerVersion = (runtime, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
103
|
+
let latestVersion = 0;
|
|
104
|
+
let searchStep = latestVersion > 0 ? 1 : 100;
|
|
105
|
+
let layerVersion = latestVersion + searchStep;
|
|
106
|
+
const account = region.startsWith('us-gov') ? constants_1.GOVCLOUD_LAYER_AWS_ACCOUNT : constants_1.DEFAULT_LAYER_AWS_ACCOUNT;
|
|
107
|
+
const layerName = constants_1.RUNTIME_LAYER_LOOKUP[runtime];
|
|
108
|
+
let foundLatestVersion = false;
|
|
109
|
+
const lambda = new aws_sdk_1.Lambda({ region });
|
|
110
|
+
while (!foundLatestVersion) {
|
|
111
|
+
try {
|
|
112
|
+
// Search next version
|
|
113
|
+
yield lambda
|
|
114
|
+
.getLayerVersion({
|
|
115
|
+
LayerName: `arn:aws:lambda:${region}:${account}:layer:${layerName}`,
|
|
116
|
+
VersionNumber: layerVersion,
|
|
117
|
+
})
|
|
118
|
+
.promise();
|
|
119
|
+
latestVersion = layerVersion;
|
|
120
|
+
// Increase layer version
|
|
121
|
+
layerVersion += searchStep;
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
// Search step is too big, reset target to previous version
|
|
125
|
+
// with a smaller search step
|
|
126
|
+
if (searchStep > 1) {
|
|
127
|
+
layerVersion -= searchStep;
|
|
128
|
+
searchStep /= 10;
|
|
129
|
+
layerVersion += searchStep;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
// Search step is 1, current version was not found.
|
|
133
|
+
// It is likely that the last checked is the latest.
|
|
134
|
+
// Check the next version to be certain, since
|
|
135
|
+
// current version could've been deleted by accident.
|
|
136
|
+
try {
|
|
137
|
+
layerVersion += searchStep;
|
|
138
|
+
yield lambda
|
|
139
|
+
.getLayerVersion({
|
|
140
|
+
LayerName: `arn:aws:lambda:${region}:${account}:layer:${layerName}`,
|
|
141
|
+
VersionNumber: layerVersion,
|
|
142
|
+
})
|
|
143
|
+
.promise();
|
|
144
|
+
latestVersion = layerVersion;
|
|
145
|
+
// Continue the search if the next version does exist (unlikely event)
|
|
146
|
+
layerVersion += searchStep;
|
|
147
|
+
}
|
|
148
|
+
catch (e) {
|
|
149
|
+
// The next version doesn't exist either, so the previous version is indeed the latest
|
|
150
|
+
foundLatestVersion = true;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return latestVersion;
|
|
156
|
+
});
|
|
157
|
+
exports.findLatestLayerVersion = findLatestLayerVersion;
|
|
158
|
+
const isMissingAWSCredentials = () => process.env[constants_1.AWS_ACCESS_KEY_ID_ENV_VAR] === undefined || process.env[constants_1.AWS_SECRET_ACCESS_KEY_ENV_VAR] === undefined;
|
|
159
|
+
exports.isMissingAWSCredentials = isMissingAWSCredentials;
|
|
160
|
+
const isMissingDatadogSiteEnvVar = () => {
|
|
161
|
+
const site = process.env[constants_1.CI_SITE_ENV_VAR];
|
|
162
|
+
if (site !== undefined) {
|
|
163
|
+
return !constants_1.SITES.includes(site);
|
|
164
|
+
}
|
|
165
|
+
return true;
|
|
166
|
+
};
|
|
167
|
+
exports.isMissingDatadogSiteEnvVar = isMissingDatadogSiteEnvVar;
|
|
168
|
+
const isMissingAnyDatadogApiKeyEnvVar = () => !(process.env[constants_1.CI_API_KEY_ENV_VAR] ||
|
|
169
|
+
process.env[constants_1.CI_KMS_API_KEY_ENV_VAR] ||
|
|
170
|
+
process.env[constants_1.CI_API_KEY_SECRET_ARN_ENV_VAR]);
|
|
171
|
+
exports.isMissingAnyDatadogApiKeyEnvVar = isMissingAnyDatadogApiKeyEnvVar;
|
|
172
|
+
const isMissingDatadogEnvVars = () => exports.isMissingDatadogSiteEnvVar() || exports.isMissingAnyDatadogApiKeyEnvVar();
|
|
173
|
+
exports.isMissingDatadogEnvVars = isMissingDatadogEnvVars;
|
|
174
|
+
const getAllLambdaFunctionConfigs = (lambda) => __awaiter(void 0, void 0, void 0, function* () { return exports.getLambdaFunctionConfigsFromRegex(lambda, '.'); });
|
|
175
|
+
exports.getAllLambdaFunctionConfigs = getAllLambdaFunctionConfigs;
|
|
176
|
+
/**
|
|
177
|
+
* Given a Lambda instance and a regular expression,
|
|
178
|
+
* returns all the Function Configurations that match.
|
|
179
|
+
*
|
|
180
|
+
* @param lambda an instance of Lambda from aws-sdk.
|
|
181
|
+
* @param pattern a regular expression
|
|
182
|
+
* @returns an array of Lambda FunctionConfiguration's that match the pattern above.
|
|
183
|
+
*/
|
|
184
|
+
const getLambdaFunctionConfigsFromRegex = (lambda, pattern) => __awaiter(void 0, void 0, void 0, function* () {
|
|
185
|
+
var _a;
|
|
186
|
+
const regEx = new RegExp(pattern);
|
|
187
|
+
const matchedFunctions = [];
|
|
188
|
+
let retryCount = 0;
|
|
189
|
+
let listFunctionsResponse;
|
|
190
|
+
let nextMarker;
|
|
191
|
+
while (true) {
|
|
192
|
+
try {
|
|
193
|
+
listFunctionsResponse = yield lambda.listFunctions({ Marker: nextMarker }).promise();
|
|
194
|
+
(_a = listFunctionsResponse.Functions) === null || _a === void 0 ? void 0 : _a.map((fn) => { var _a; return ((_a = fn.FunctionName) === null || _a === void 0 ? void 0 : _a.match(regEx)) && matchedFunctions.push(fn); });
|
|
195
|
+
nextMarker = listFunctionsResponse.NextMarker;
|
|
196
|
+
if (!nextMarker) {
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
retryCount = 0;
|
|
200
|
+
}
|
|
201
|
+
catch (e) {
|
|
202
|
+
retryCount++;
|
|
203
|
+
if (retryCount > constants_1.LIST_FUNCTIONS_MAX_RETRY_COUNT) {
|
|
204
|
+
throw Error('Max retry count exceeded.');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return matchedFunctions;
|
|
209
|
+
});
|
|
210
|
+
exports.getLambdaFunctionConfigsFromRegex = getLambdaFunctionConfigsFromRegex;
|
|
66
211
|
/**
|
|
67
212
|
* Given a Lambda instance and an array of Lambda names,
|
|
68
213
|
* return all the Lambda Function Configurations.
|
|
@@ -77,6 +222,36 @@ const getLambdaFunctionConfigs = (lambda, functionARNs) => {
|
|
|
77
222
|
return Promise.all(promises);
|
|
78
223
|
};
|
|
79
224
|
exports.getLambdaFunctionConfigs = getLambdaFunctionConfigs;
|
|
225
|
+
/**
|
|
226
|
+
* Returns the correct ARN of a **Specific Runtime Layer** given its configuration, region,
|
|
227
|
+
* and settings (optional).
|
|
228
|
+
*
|
|
229
|
+
* @param config a Lambda FunctionConfiguration.
|
|
230
|
+
* @param region a region where the layer is hosted.
|
|
231
|
+
* @param settings instrumentation settings, mainly used to change the AWS account that contains the Layer.
|
|
232
|
+
* @returns the ARN of a **Specific Runtime Layer** with the correct region, account, architecture, and name.
|
|
233
|
+
*/
|
|
234
|
+
const getLayerArn = (config, runtime, region, settings) => {
|
|
235
|
+
var _a, _b;
|
|
236
|
+
let layerName = constants_1.RUNTIME_LAYER_LOOKUP[runtime];
|
|
237
|
+
if (constants_1.ARM_RUNTIMES.includes(runtime) && ((_a = config.Architectures) === null || _a === void 0 ? void 0 : _a.includes(constants_1.ARM64_ARCHITECTURE))) {
|
|
238
|
+
layerName += constants_1.ARM_LAYER_SUFFIX;
|
|
239
|
+
}
|
|
240
|
+
const account = (_b = settings === null || settings === void 0 ? void 0 : settings.layerAWSAccount) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_LAYER_AWS_ACCOUNT;
|
|
241
|
+
const isGovCloud = region.startsWith('us-gov');
|
|
242
|
+
if (isGovCloud) {
|
|
243
|
+
return `arn:aws-us-gov:lambda:${region}:${constants_1.GOVCLOUD_LAYER_AWS_ACCOUNT}:layer:${layerName}`;
|
|
244
|
+
}
|
|
245
|
+
return `arn:aws:lambda:${region}:${account}:layer:${layerName}`;
|
|
246
|
+
};
|
|
247
|
+
exports.getLayerArn = getLayerArn;
|
|
248
|
+
const getLayerNameWithVersion = (layerArn) => {
|
|
249
|
+
const [, , , , , , name, version] = layerArn.split(':');
|
|
250
|
+
return name && version ? `${name}:${version}` : undefined;
|
|
251
|
+
};
|
|
252
|
+
exports.getLayerNameWithVersion = getLayerNameWithVersion;
|
|
253
|
+
const getLayers = (config) => { var _a; return ((_a = config.Layers) !== null && _a !== void 0 ? _a : []).map((layer) => layer.Arn); };
|
|
254
|
+
exports.getLayers = getLayers;
|
|
80
255
|
/**
|
|
81
256
|
* Call the aws-sdk Lambda api to get a Function given
|
|
82
257
|
* an ARN and then return its Configuration.
|
|
@@ -162,6 +337,22 @@ const updateLambdaFunctionConfigs = (lambda, cloudWatch, configs) => __awaiter(v
|
|
|
162
337
|
yield Promise.all(results);
|
|
163
338
|
});
|
|
164
339
|
exports.updateLambdaFunctionConfigs = updateLambdaFunctionConfigs;
|
|
340
|
+
const willUpdateFunctionConfigs = (configs) => {
|
|
341
|
+
var _a, _b, _c;
|
|
342
|
+
let willUpdate = false;
|
|
343
|
+
for (const config of configs) {
|
|
344
|
+
if (config.updateRequest !== undefined ||
|
|
345
|
+
((_a = config.logGroupConfiguration) === null || _a === void 0 ? void 0 : _a.createLogGroupRequest) !== undefined ||
|
|
346
|
+
((_b = config.logGroupConfiguration) === null || _b === void 0 ? void 0 : _b.deleteSubscriptionFilterRequest) !== undefined ||
|
|
347
|
+
((_c = config.logGroupConfiguration) === null || _c === void 0 ? void 0 : _c.subscriptionFilterRequest) !== undefined ||
|
|
348
|
+
(config === null || config === void 0 ? void 0 : config.tagConfiguration) !== undefined) {
|
|
349
|
+
willUpdate = true;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return willUpdate;
|
|
354
|
+
};
|
|
355
|
+
exports.willUpdateFunctionConfigs = willUpdateFunctionConfigs;
|
|
165
356
|
/**
|
|
166
357
|
* Waits for n ms
|
|
167
358
|
*
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { CloudWatchLogs, Lambda } from 'aws-sdk';
|
|
2
2
|
import { Runtime } from '../constants';
|
|
3
|
-
import { FunctionConfiguration, InstrumentationSettings
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
lambdaLibraryLayerArn: string;
|
|
9
|
-
logGroupConfiguration: LogGroupConfiguration | undefined;
|
|
10
|
-
tagConfiguration: TagConfiguration | undefined;
|
|
11
|
-
updateRequest: Lambda.UpdateFunctionConfigurationRequest | undefined;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const getLambdaConfigsFromRegEx: (lambda: Lambda, cloudWatch: CloudWatchLogs, region: string, pattern: string, settings: InstrumentationSettings) => Promise<FunctionConfiguration[]>;
|
|
14
|
-
export declare const getLayerArn: (runtime: Runtime, settings: InstrumentationSettings, region: string) => string;
|
|
15
|
-
export declare const getExtensionArn: (settings: InstrumentationSettings, region: string) => string;
|
|
16
|
-
export declare const calculateUpdateRequest: (config: Lambda.FunctionConfiguration, settings: InstrumentationSettings, lambdaLibraryLayerArn: string, lambdaExtensionLayerArn: string, runtime: Runtime) => Lambda.UpdateFunctionConfigurationRequest | undefined;
|
|
3
|
+
import { FunctionConfiguration, InstrumentationSettings } from '../interfaces';
|
|
4
|
+
export declare const getInstrumentedFunctionConfigs: (lambda: Lambda, cloudWatch: CloudWatchLogs, region: string, functionARNs: string[], settings: InstrumentationSettings) => Promise<FunctionConfiguration[]>;
|
|
5
|
+
export declare const getInstrumentedFunctionConfig: (lambda: Lambda, cloudWatch: CloudWatchLogs, config: Lambda.FunctionConfiguration, region: string, settings: InstrumentationSettings) => Promise<FunctionConfiguration>;
|
|
6
|
+
export declare const getInstrumentedFunctionConfigsFromRegEx: (lambda: Lambda, cloudWatch: CloudWatchLogs, region: string, pattern: string, settings: InstrumentationSettings) => Promise<FunctionConfiguration[]>;
|
|
7
|
+
export declare const calculateUpdateRequest: (config: Lambda.FunctionConfiguration, settings: InstrumentationSettings, region: string, runtime: Runtime) => Promise<Lambda.UpdateFunctionConfigurationRequest | undefined>;
|