cdk-cost-analyzer 0.1.35 → 0.1.37
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/.cdk-cost-analyzer-cache/metadata.json +8 -8
- package/README.md +193 -3
- package/action.yml +50 -0
- package/dist/action/136.index.js +936 -0
- package/dist/action/360.index.js +93 -0
- package/dist/action/443.index.js +780 -0
- package/dist/action/566.index.js +387 -0
- package/dist/action/579.index.js +270 -0
- package/dist/action/605.index.js +234 -0
- package/dist/action/762.index.js +632 -0
- package/dist/action/869.index.js +531 -0
- package/dist/action/956.index.js +1072 -0
- package/dist/action/998.index.js +1418 -0
- package/dist/action/action/index.d.ts +7 -0
- package/dist/action/analysis/SingleTemplateAnalyzer.d.ts +23 -0
- package/dist/action/analysis/index.d.ts +1 -0
- package/dist/action/api/index.d.ts +35 -0
- package/dist/action/api/single-template-types.d.ts +83 -0
- package/dist/action/api/types.d.ts +15 -0
- package/dist/action/cli/index.d.ts +2 -0
- package/dist/action/config/ConfigManager.d.ts +40 -0
- package/dist/action/config/index.d.ts +2 -0
- package/dist/action/config/types.d.ts +153 -0
- package/dist/action/diff/DiffEngine.d.ts +7 -0
- package/dist/action/diff/index.d.ts +2 -0
- package/dist/action/diff/types.d.ts +20 -0
- package/dist/action/index.d.ts +8 -0
- package/dist/action/index.js +4 -0
- package/dist/action/integrations/GitHubIntegration.d.ts +43 -0
- package/dist/action/integrations/GitLabIntegration.d.ts +7 -0
- package/dist/action/integrations/index.d.ts +3 -0
- package/dist/action/integrations/types.d.ts +40 -0
- package/dist/action/parser/TemplateParser.d.ts +8 -0
- package/dist/action/parser/index.d.ts +2 -0
- package/dist/action/parser/types.d.ts +30 -0
- package/dist/action/pipeline/PipelineOrchestrator.d.ts +23 -0
- package/dist/action/pipeline/index.d.ts +2 -0
- package/dist/action/pipeline/types.d.ts +41 -0
- package/dist/action/pricing/CacheManager.d.ts +75 -0
- package/dist/action/pricing/PricingClient.d.ts +17 -0
- package/dist/action/pricing/PricingService.d.ts +16 -0
- package/dist/action/pricing/RegionMapper.d.ts +14 -0
- package/dist/action/pricing/calculators/ALBCalculator.d.ts +15 -0
- package/dist/action/pricing/calculators/APIGatewayCalculator.d.ts +9 -0
- package/dist/action/pricing/calculators/AutoScalingGroupCalculator.d.ts +9 -0
- package/dist/action/pricing/calculators/CloudFrontCalculator.d.ts +49 -0
- package/dist/action/pricing/calculators/DynamoDBCalculator.d.ts +12 -0
- package/dist/action/pricing/calculators/EC2Calculator.d.ts +6 -0
- package/dist/action/pricing/calculators/ECSCalculator.d.ts +8 -0
- package/dist/action/pricing/calculators/EFSCalculator.d.ts +19 -0
- package/dist/action/pricing/calculators/ElastiCacheCalculator.d.ts +7 -0
- package/dist/action/pricing/calculators/LambdaCalculator.d.ts +14 -0
- package/dist/action/pricing/calculators/LaunchTemplateCalculator.d.ts +35 -0
- package/dist/action/pricing/calculators/NLBCalculator.d.ts +15 -0
- package/dist/action/pricing/calculators/NatGatewayCalculator.d.ts +10 -0
- package/dist/action/pricing/calculators/RDSCalculator.d.ts +8 -0
- package/dist/action/pricing/calculators/S3Calculator.d.ts +7 -0
- package/dist/action/pricing/calculators/SNSCalculator.d.ts +54 -0
- package/dist/action/pricing/calculators/SQSCalculator.d.ts +16 -0
- package/dist/action/pricing/calculators/SecretsManagerCalculator.d.ts +21 -0
- package/dist/action/pricing/calculators/StepFunctionsCalculator.d.ts +23 -0
- package/dist/action/pricing/calculators/VPCEndpointCalculator.d.ts +10 -0
- package/dist/action/pricing/index.d.ts +16 -0
- package/dist/action/pricing/types.d.ts +54 -0
- package/dist/action/reporter/GitHubActionReporter.d.ts +42 -0
- package/dist/action/reporter/Reporter.d.ts +18 -0
- package/dist/action/reporter/SingleTemplateReporter.d.ts +31 -0
- package/dist/action/reporter/index.d.ts +4 -0
- package/dist/action/reporter/types.d.ts +72 -0
- package/dist/action/synthesis/SynthesisOrchestrator.d.ts +26 -0
- package/dist/action/synthesis/index.d.ts +2 -0
- package/dist/action/synthesis/types.d.ts +17 -0
- package/dist/action/threshold/ThresholdEnforcer.d.ts +29 -0
- package/dist/action/threshold/index.d.ts +2 -0
- package/dist/action/threshold/types.d.ts +15 -0
- package/dist/action/utils/Logger.d.ts +39 -0
- package/dist/cli/index.js +56 -1
- package/dist/integrations/GitHubIntegration.d.ts +43 -0
- package/dist/integrations/GitHubIntegration.js +217 -0
- package/dist/integrations/index.d.ts +1 -0
- package/dist/integrations/index.js +4 -2
- package/dist/integrations/types.d.ts +29 -0
- package/dist/integrations/types.js +11 -2
- package/dist/releasetag.txt +1 -1
- package/dist/reporter/GitHubActionReporter.d.ts +42 -0
- package/dist/reporter/GitHubActionReporter.js +161 -0
- package/dist/reporter/index.d.ts +1 -0
- package/dist/reporter/index.js +4 -2
- package/package.json +5 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.id = 605;
|
|
3
|
+
exports.ids = [605];
|
|
4
|
+
exports.modules = {
|
|
5
|
+
|
|
6
|
+
/***/ 1509:
|
|
7
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11
|
+
exports.checkUrl = void 0;
|
|
12
|
+
const property_provider_1 = __webpack_require__(1238);
|
|
13
|
+
const LOOPBACK_CIDR_IPv4 = "127.0.0.0/8";
|
|
14
|
+
const LOOPBACK_CIDR_IPv6 = "::1/128";
|
|
15
|
+
const ECS_CONTAINER_HOST = "169.254.170.2";
|
|
16
|
+
const EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
|
|
17
|
+
const EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
|
|
18
|
+
const checkUrl = (url, logger) => {
|
|
19
|
+
if (url.protocol === "https:") {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (url.hostname === ECS_CONTAINER_HOST ||
|
|
23
|
+
url.hostname === EKS_CONTAINER_HOST_IPv4 ||
|
|
24
|
+
url.hostname === EKS_CONTAINER_HOST_IPv6) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (url.hostname.includes("[")) {
|
|
28
|
+
if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
if (url.hostname === "localhost") {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const ipComponents = url.hostname.split(".");
|
|
37
|
+
const inRange = (component) => {
|
|
38
|
+
const num = parseInt(component, 10);
|
|
39
|
+
return 0 <= num && num <= 255;
|
|
40
|
+
};
|
|
41
|
+
if (ipComponents[0] === "127" &&
|
|
42
|
+
inRange(ipComponents[1]) &&
|
|
43
|
+
inRange(ipComponents[2]) &&
|
|
44
|
+
inRange(ipComponents[3]) &&
|
|
45
|
+
ipComponents.length === 4) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
50
|
+
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
51
|
+
- ECS container host 169.254.170.2
|
|
52
|
+
- EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger });
|
|
53
|
+
};
|
|
54
|
+
exports.checkUrl = checkUrl;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/***/ }),
|
|
58
|
+
|
|
59
|
+
/***/ 8712:
|
|
60
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
64
|
+
exports.fromHttp = void 0;
|
|
65
|
+
const tslib_1 = __webpack_require__(1860);
|
|
66
|
+
const client_1 = __webpack_require__(5152);
|
|
67
|
+
const node_http_handler_1 = __webpack_require__(1279);
|
|
68
|
+
const property_provider_1 = __webpack_require__(1238);
|
|
69
|
+
const promises_1 = tslib_1.__importDefault(__webpack_require__(1943));
|
|
70
|
+
const checkUrl_1 = __webpack_require__(1509);
|
|
71
|
+
const requestHelpers_1 = __webpack_require__(8914);
|
|
72
|
+
const retry_wrapper_1 = __webpack_require__(1122);
|
|
73
|
+
const AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
|
|
74
|
+
const DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2";
|
|
75
|
+
const AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
|
|
76
|
+
const AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE";
|
|
77
|
+
const AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
|
|
78
|
+
const fromHttp = (options = {}) => {
|
|
79
|
+
options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
|
|
80
|
+
let host;
|
|
81
|
+
const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
|
|
82
|
+
const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
|
|
83
|
+
const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
|
|
84
|
+
const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
|
|
85
|
+
const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn
|
|
86
|
+
? console.warn
|
|
87
|
+
: options.logger.warn.bind(options.logger);
|
|
88
|
+
if (relative && full) {
|
|
89
|
+
warn("@aws-sdk/credential-provider-http: " +
|
|
90
|
+
"you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
|
|
91
|
+
warn("awsContainerCredentialsFullUri will take precedence.");
|
|
92
|
+
}
|
|
93
|
+
if (token && tokenFile) {
|
|
94
|
+
warn("@aws-sdk/credential-provider-http: " +
|
|
95
|
+
"you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.");
|
|
96
|
+
warn("awsContainerAuthorizationToken will take precedence.");
|
|
97
|
+
}
|
|
98
|
+
if (full) {
|
|
99
|
+
host = full;
|
|
100
|
+
}
|
|
101
|
+
else if (relative) {
|
|
102
|
+
host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
106
|
+
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
|
|
107
|
+
}
|
|
108
|
+
const url = new URL(host);
|
|
109
|
+
(0, checkUrl_1.checkUrl)(url, options.logger);
|
|
110
|
+
const requestHandler = node_http_handler_1.NodeHttpHandler.create({
|
|
111
|
+
requestTimeout: options.timeout ?? 1000,
|
|
112
|
+
connectionTimeout: options.timeout ?? 1000,
|
|
113
|
+
});
|
|
114
|
+
return (0, retry_wrapper_1.retryWrapper)(async () => {
|
|
115
|
+
const request = (0, requestHelpers_1.createGetRequest)(url);
|
|
116
|
+
if (token) {
|
|
117
|
+
request.headers.Authorization = token;
|
|
118
|
+
}
|
|
119
|
+
else if (tokenFile) {
|
|
120
|
+
request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString();
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
const result = await requestHandler.handle(request);
|
|
124
|
+
return (0, requestHelpers_1.getCredentials)(result.response).then((creds) => (0, client_1.setCredentialFeature)(creds, "CREDENTIALS_HTTP", "z"));
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
throw new property_provider_1.CredentialsProviderError(String(e), { logger: options.logger });
|
|
128
|
+
}
|
|
129
|
+
}, options.maxRetries ?? 3, options.timeout ?? 1000);
|
|
130
|
+
};
|
|
131
|
+
exports.fromHttp = fromHttp;
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
/***/ }),
|
|
135
|
+
|
|
136
|
+
/***/ 8914:
|
|
137
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
141
|
+
exports.createGetRequest = createGetRequest;
|
|
142
|
+
exports.getCredentials = getCredentials;
|
|
143
|
+
const property_provider_1 = __webpack_require__(1238);
|
|
144
|
+
const protocol_http_1 = __webpack_require__(2356);
|
|
145
|
+
const smithy_client_1 = __webpack_require__(1411);
|
|
146
|
+
const util_stream_1 = __webpack_require__(4252);
|
|
147
|
+
function createGetRequest(url) {
|
|
148
|
+
return new protocol_http_1.HttpRequest({
|
|
149
|
+
protocol: url.protocol,
|
|
150
|
+
hostname: url.hostname,
|
|
151
|
+
port: Number(url.port),
|
|
152
|
+
path: url.pathname,
|
|
153
|
+
query: Array.from(url.searchParams.entries()).reduce((acc, [k, v]) => {
|
|
154
|
+
acc[k] = v;
|
|
155
|
+
return acc;
|
|
156
|
+
}, {}),
|
|
157
|
+
fragment: url.hash,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
async function getCredentials(response, logger) {
|
|
161
|
+
const stream = (0, util_stream_1.sdkStreamMixin)(response.body);
|
|
162
|
+
const str = await stream.transformToString();
|
|
163
|
+
if (response.statusCode === 200) {
|
|
164
|
+
const parsed = JSON.parse(str);
|
|
165
|
+
if (typeof parsed.AccessKeyId !== "string" ||
|
|
166
|
+
typeof parsed.SecretAccessKey !== "string" ||
|
|
167
|
+
typeof parsed.Token !== "string" ||
|
|
168
|
+
typeof parsed.Expiration !== "string") {
|
|
169
|
+
throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: " +
|
|
170
|
+
"{ AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger });
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
accessKeyId: parsed.AccessKeyId,
|
|
174
|
+
secretAccessKey: parsed.SecretAccessKey,
|
|
175
|
+
sessionToken: parsed.Token,
|
|
176
|
+
expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (response.statusCode >= 400 && response.statusCode < 500) {
|
|
180
|
+
let parsedBody = {};
|
|
181
|
+
try {
|
|
182
|
+
parsedBody = JSON.parse(str);
|
|
183
|
+
}
|
|
184
|
+
catch (e) { }
|
|
185
|
+
throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }), {
|
|
186
|
+
Code: parsedBody.Code,
|
|
187
|
+
Message: parsedBody.Message,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger });
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
/***/ }),
|
|
195
|
+
|
|
196
|
+
/***/ 1122:
|
|
197
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
201
|
+
exports.retryWrapper = void 0;
|
|
202
|
+
const retryWrapper = (toRetry, maxRetries, delayMs) => {
|
|
203
|
+
return async () => {
|
|
204
|
+
for (let i = 0; i < maxRetries; ++i) {
|
|
205
|
+
try {
|
|
206
|
+
return await toRetry();
|
|
207
|
+
}
|
|
208
|
+
catch (e) {
|
|
209
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return await toRetry();
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
exports.retryWrapper = retryWrapper;
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
/***/ }),
|
|
219
|
+
|
|
220
|
+
/***/ 8605:
|
|
221
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
222
|
+
|
|
223
|
+
var __webpack_unused_export__;
|
|
224
|
+
|
|
225
|
+
__webpack_unused_export__ = ({ value: true });
|
|
226
|
+
exports.fromHttp = void 0;
|
|
227
|
+
var fromHttp_1 = __webpack_require__(8712);
|
|
228
|
+
Object.defineProperty(exports, "fromHttp", ({ enumerable: true, get: function () { return fromHttp_1.fromHttp; } }));
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
/***/ })
|
|
232
|
+
|
|
233
|
+
};
|
|
234
|
+
;
|