@granite-js/pulumi-aws 0.1.19 → 0.1.21

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/chunk-5W7B34BN.js +3307 -0
  3. package/dist/chunk-64IS37V6.js +17 -0
  4. package/dist/chunk-AEOST5WF.js +63 -0
  5. package/dist/chunk-B7OAPHPY.js +46 -0
  6. package/dist/chunk-FO7L563E.js +13695 -0
  7. package/dist/chunk-FRWSD3YQ.js +1722 -0
  8. package/dist/chunk-IEZY5C3G.js +120 -0
  9. package/dist/chunk-ITI6QA2Q.js +12 -0
  10. package/dist/chunk-IUKLHJNE.js +49 -0
  11. package/dist/chunk-JBVMOFGH.js +152 -0
  12. package/dist/chunk-JSBRDJBE.js +30 -0
  13. package/dist/chunk-KGNTV362.js +209 -0
  14. package/dist/chunk-KRJS4RAS.js +1732 -0
  15. package/dist/chunk-M5GUUX64.js +63 -0
  16. package/dist/chunk-QAE2S7MG.js +3351 -0
  17. package/dist/chunk-SX6SVQKS.js +67 -0
  18. package/dist/chunk-TJ744C2T.js +198 -0
  19. package/dist/chunk-UNXXS5FM.js +120 -0
  20. package/dist/chunk-UT2RMOJS.js +2447 -0
  21. package/dist/chunk-VOTRVWIB.js +1965 -0
  22. package/dist/chunk-W3VXP3A3.js +119 -0
  23. package/dist/chunk-WCHHWTND.js +113 -0
  24. package/dist/chunk-X6XO7USX.js +110 -0
  25. package/dist/chunk-XLUI7RQ4.js +115 -0
  26. package/dist/dist-es-2M7RLZ5O.js +200 -0
  27. package/dist/dist-es-ADTONJUN-RVFWNZHO.js +67 -0
  28. package/dist/dist-es-CDFIYJVE.js +163 -0
  29. package/dist/dist-es-GHYMLBON.js +379 -0
  30. package/dist/dist-es-HJVOMDYC-PIAMWMAL.js +87 -0
  31. package/dist/dist-es-IDBDK36G-Y6TQMRO5.js +299 -0
  32. package/dist/dist-es-OCQVKISC-TNAJ62WG.js +161 -0
  33. package/dist/dist-es-OZGLUDWT.js +305 -0
  34. package/dist/dist-es-PRWCVZGQ-HTTVI42T.js +21 -0
  35. package/dist/dist-es-S75EKWRJ.js +88 -0
  36. package/dist/dist-es-SUPEA6VE-3B5JSW5C.js +368 -0
  37. package/dist/dist-es-WQHDOVD7.js +21 -0
  38. package/dist/dist-es-XQME5F6W.js +67 -0
  39. package/dist/dist-es-Y7VN37H5-WQ3GYROF.js +196 -0
  40. package/dist/lambda/auto-cache-removal.d.cts +17 -0
  41. package/dist/lambda/auto-cache-removal.d.ts +17 -0
  42. package/dist/lambda/auto-cache-removal.js +5313 -0
  43. package/dist/lambda/origin-request.d.cts +14 -0
  44. package/dist/lambda/origin-request.d.ts +14 -0
  45. package/dist/lambda/origin-request.js +113 -0
  46. package/dist/lambda/origin-response.d.cts +6 -0
  47. package/dist/lambda/origin-response.d.ts +6 -0
  48. package/dist/lambda/origin-response.js +52 -0
  49. package/dist/loadSso-CZSSLFH6-SA5HOQAX.js +645 -0
  50. package/dist/loadSso-T7GJVVO2.js +655 -0
  51. package/dist/sso-oidc-55SJ27II.js +827 -0
  52. package/dist/sso-oidc-PKO5GYK5-LC65L46O.js +820 -0
  53. package/dist/sts-OPF4H3GL.js +1162 -0
  54. package/dist/sts-P7Q3MYTS-BKGWHQE4.js +1152 -0
  55. package/lambda/auto-cache-removal.d.ts +1 -0
  56. package/lambda/origin-request.d.ts +1 -0
  57. package/lambda/origin-response.d.ts +1 -0
  58. package/package.json +37 -10
@@ -0,0 +1,368 @@
1
+ import {
2
+ loadConfig,
3
+ parseUrl
4
+ } from "./chunk-X6XO7USX.js";
5
+ import "./chunk-TJ744C2T.js";
6
+ import "./chunk-XLUI7RQ4.js";
7
+ import {
8
+ CredentialsProviderError,
9
+ ProviderError,
10
+ init_esm_shims
11
+ } from "./chunk-JBVMOFGH.js";
12
+ import "./chunk-JSBRDJBE.js";
13
+
14
+ // ../deployment-manager/dist/dist-es-SUPEA6VE.js
15
+ import { parse } from "url";
16
+ import { Buffer } from "buffer";
17
+ import { request } from "http";
18
+ init_esm_shims();
19
+ init_esm_shims();
20
+ init_esm_shims();
21
+ function httpRequest(options) {
22
+ return new Promise((resolve, reject) => {
23
+ const req = request({
24
+ method: "GET",
25
+ ...options,
26
+ hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1")
27
+ });
28
+ req.on("error", (err) => {
29
+ reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err));
30
+ req.destroy();
31
+ });
32
+ req.on("timeout", () => {
33
+ reject(new ProviderError("TimeoutError from instance metadata service"));
34
+ req.destroy();
35
+ });
36
+ req.on("response", (res) => {
37
+ const { statusCode = 400 } = res;
38
+ if (statusCode < 200 || 300 <= statusCode) {
39
+ reject(Object.assign(new ProviderError("Error response received from instance metadata service"), { statusCode }));
40
+ req.destroy();
41
+ }
42
+ const chunks = [];
43
+ res.on("data", (chunk) => {
44
+ chunks.push(chunk);
45
+ });
46
+ res.on("end", () => {
47
+ resolve(Buffer.concat(chunks));
48
+ req.destroy();
49
+ });
50
+ });
51
+ req.end();
52
+ });
53
+ }
54
+ init_esm_shims();
55
+ var isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string";
56
+ var fromImdsCredentials = (creds) => ({
57
+ accessKeyId: creds.AccessKeyId,
58
+ secretAccessKey: creds.SecretAccessKey,
59
+ sessionToken: creds.Token,
60
+ expiration: new Date(creds.Expiration),
61
+ ...creds.AccountId && { accountId: creds.AccountId }
62
+ });
63
+ init_esm_shims();
64
+ var DEFAULT_TIMEOUT = 1e3;
65
+ var DEFAULT_MAX_RETRIES = 0;
66
+ var providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout });
67
+ init_esm_shims();
68
+ var retry = (toRetry, maxRetries) => {
69
+ let promise = toRetry();
70
+ for (let i = 0; i < maxRetries; i++) {
71
+ promise = promise.catch(toRetry);
72
+ }
73
+ return promise;
74
+ };
75
+ var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
76
+ var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
77
+ var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
78
+ var fromContainerMetadata = (init = {}) => {
79
+ const { timeout, maxRetries } = providerConfigFromInit(init);
80
+ return () => retry(async () => {
81
+ const requestOptions = await getCmdsUri({ logger: init.logger });
82
+ const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));
83
+ if (!isImdsCredentials(credsResponse)) {
84
+ throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
85
+ logger: init.logger
86
+ });
87
+ }
88
+ return fromImdsCredentials(credsResponse);
89
+ }, maxRetries);
90
+ };
91
+ var requestFromEcsImds = async (timeout, options) => {
92
+ if (process.env[ENV_CMDS_AUTH_TOKEN]) {
93
+ options.headers = {
94
+ ...options.headers,
95
+ Authorization: process.env[ENV_CMDS_AUTH_TOKEN]
96
+ };
97
+ }
98
+ const buffer = await httpRequest({
99
+ ...options,
100
+ timeout
101
+ });
102
+ return buffer.toString();
103
+ };
104
+ var CMDS_IP = "169.254.170.2";
105
+ var GREENGRASS_HOSTS = {
106
+ localhost: true,
107
+ "127.0.0.1": true
108
+ };
109
+ var GREENGRASS_PROTOCOLS = {
110
+ "http:": true,
111
+ "https:": true
112
+ };
113
+ var getCmdsUri = async ({ logger }) => {
114
+ if (process.env[ENV_CMDS_RELATIVE_URI]) {
115
+ return {
116
+ hostname: CMDS_IP,
117
+ path: process.env[ENV_CMDS_RELATIVE_URI]
118
+ };
119
+ }
120
+ if (process.env[ENV_CMDS_FULL_URI]) {
121
+ const parsed = parse(process.env[ENV_CMDS_FULL_URI]);
122
+ if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
123
+ throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
124
+ tryNextLink: false,
125
+ logger
126
+ });
127
+ }
128
+ if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
129
+ throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
130
+ tryNextLink: false,
131
+ logger
132
+ });
133
+ }
134
+ return {
135
+ ...parsed,
136
+ port: parsed.port ? parseInt(parsed.port, 10) : void 0
137
+ };
138
+ }
139
+ throw new CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, {
140
+ tryNextLink: false,
141
+ logger
142
+ });
143
+ };
144
+ init_esm_shims();
145
+ init_esm_shims();
146
+ var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends CredentialsProviderError {
147
+ constructor(message, tryNextLink = true) {
148
+ super(message, tryNextLink);
149
+ this.tryNextLink = tryNextLink;
150
+ this.name = "InstanceMetadataV1FallbackError";
151
+ Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype);
152
+ }
153
+ };
154
+ init_esm_shims();
155
+ init_esm_shims();
156
+ var Endpoint;
157
+ (function(Endpoint2) {
158
+ Endpoint2["IPv4"] = "http://169.254.169.254";
159
+ Endpoint2["IPv6"] = "http://[fd00:ec2::254]";
160
+ })(Endpoint || (Endpoint = {}));
161
+ init_esm_shims();
162
+ var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
163
+ var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
164
+ var ENDPOINT_CONFIG_OPTIONS = {
165
+ environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME],
166
+ configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME],
167
+ default: void 0
168
+ };
169
+ init_esm_shims();
170
+ var EndpointMode;
171
+ (function(EndpointMode2) {
172
+ EndpointMode2["IPv4"] = "IPv4";
173
+ EndpointMode2["IPv6"] = "IPv6";
174
+ })(EndpointMode || (EndpointMode = {}));
175
+ init_esm_shims();
176
+ var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE";
177
+ var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode";
178
+ var ENDPOINT_MODE_CONFIG_OPTIONS = {
179
+ environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME],
180
+ configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME],
181
+ default: EndpointMode.IPv4
182
+ };
183
+ var getInstanceMetadataEndpoint = async () => parseUrl(await getFromEndpointConfig() || await getFromEndpointModeConfig());
184
+ var getFromEndpointConfig = async () => loadConfig(ENDPOINT_CONFIG_OPTIONS)();
185
+ var getFromEndpointModeConfig = async () => {
186
+ const endpointMode = await loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();
187
+ switch (endpointMode) {
188
+ case EndpointMode.IPv4:
189
+ return Endpoint.IPv4;
190
+ case EndpointMode.IPv6:
191
+ return Endpoint.IPv6;
192
+ default:
193
+ throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`);
194
+ }
195
+ };
196
+ init_esm_shims();
197
+ init_esm_shims();
198
+ var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
199
+ var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
200
+ var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
201
+ var getExtendedInstanceMetadataCredentials = (credentials, logger) => {
202
+ const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
203
+ const newExpiration = new Date(Date.now() + refreshInterval * 1e3);
204
+ logger.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.
205
+ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
206
+ const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
207
+ return {
208
+ ...credentials,
209
+ ...originalExpiration ? { originalExpiration } : {},
210
+ expiration: newExpiration
211
+ };
212
+ };
213
+ var staticStabilityProvider = (provider, options = {}) => {
214
+ const logger = options?.logger || console;
215
+ let pastCredentials;
216
+ return async () => {
217
+ let credentials;
218
+ try {
219
+ credentials = await provider();
220
+ if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
221
+ credentials = getExtendedInstanceMetadataCredentials(credentials, logger);
222
+ }
223
+ } catch (e) {
224
+ if (pastCredentials) {
225
+ logger.warn("Credential renew failed: ", e);
226
+ credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger);
227
+ } else {
228
+ throw e;
229
+ }
230
+ }
231
+ pastCredentials = credentials;
232
+ return credentials;
233
+ };
234
+ };
235
+ var IMDS_PATH = "/latest/meta-data/iam/security-credentials/";
236
+ var IMDS_TOKEN_PATH = "/latest/api/token";
237
+ var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED";
238
+ var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled";
239
+ var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token";
240
+ var fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger });
241
+ var getInstanceMetadataProvider = (init = {}) => {
242
+ let disableFetchToken = false;
243
+ const { logger, profile } = init;
244
+ const { timeout, maxRetries } = providerConfigFromInit(init);
245
+ const getCredentials = async (maxRetries2, options) => {
246
+ const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;
247
+ if (isImdsV1Fallback) {
248
+ let fallbackBlockedFromProfile = false;
249
+ let fallbackBlockedFromProcessEnv = false;
250
+ const configValue = await loadConfig({
251
+ environmentVariableSelector: (env) => {
252
+ const envValue = env[AWS_EC2_METADATA_V1_DISABLED];
253
+ fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false";
254
+ if (envValue === void 0) {
255
+ throw new CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger });
256
+ }
257
+ return fallbackBlockedFromProcessEnv;
258
+ },
259
+ configFileSelector: (profile2) => {
260
+ const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED];
261
+ fallbackBlockedFromProfile = !!profileValue && profileValue !== "false";
262
+ return fallbackBlockedFromProfile;
263
+ },
264
+ default: false
265
+ }, {
266
+ profile
267
+ })();
268
+ if (init.ec2MetadataV1Disabled || configValue) {
269
+ const causes = [];
270
+ if (init.ec2MetadataV1Disabled)
271
+ causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");
272
+ if (fallbackBlockedFromProfile)
273
+ causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);
274
+ if (fallbackBlockedFromProcessEnv)
275
+ causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);
276
+ throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`);
277
+ }
278
+ }
279
+ const imdsProfile = (await retry(async () => {
280
+ let profile2;
281
+ try {
282
+ profile2 = await getProfile(options);
283
+ } catch (err) {
284
+ if (err.statusCode === 401) {
285
+ disableFetchToken = false;
286
+ }
287
+ throw err;
288
+ }
289
+ return profile2;
290
+ }, maxRetries2)).trim();
291
+ return retry(async () => {
292
+ let creds;
293
+ try {
294
+ creds = await getCredentialsFromProfile(imdsProfile, options, init);
295
+ } catch (err) {
296
+ if (err.statusCode === 401) {
297
+ disableFetchToken = false;
298
+ }
299
+ throw err;
300
+ }
301
+ return creds;
302
+ }, maxRetries2);
303
+ };
304
+ return async () => {
305
+ const endpoint = await getInstanceMetadataEndpoint();
306
+ if (disableFetchToken) {
307
+ logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
308
+ return getCredentials(maxRetries, { ...endpoint, timeout });
309
+ } else {
310
+ let token;
311
+ try {
312
+ token = (await getMetadataToken({ ...endpoint, timeout })).toString();
313
+ } catch (error) {
314
+ if (error?.statusCode === 400) {
315
+ throw Object.assign(error, {
316
+ message: "EC2 Metadata token request returned error"
317
+ });
318
+ } else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) {
319
+ disableFetchToken = true;
320
+ }
321
+ logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
322
+ return getCredentials(maxRetries, { ...endpoint, timeout });
323
+ }
324
+ return getCredentials(maxRetries, {
325
+ ...endpoint,
326
+ headers: {
327
+ [X_AWS_EC2_METADATA_TOKEN]: token
328
+ },
329
+ timeout
330
+ });
331
+ }
332
+ };
333
+ };
334
+ var getMetadataToken = async (options) => httpRequest({
335
+ ...options,
336
+ path: IMDS_TOKEN_PATH,
337
+ method: "PUT",
338
+ headers: {
339
+ "x-aws-ec2-metadata-token-ttl-seconds": "21600"
340
+ }
341
+ });
342
+ var getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString();
343
+ var getCredentialsFromProfile = async (profile, options, init) => {
344
+ const credentialsResponse = JSON.parse((await httpRequest({
345
+ ...options,
346
+ path: IMDS_PATH + profile
347
+ })).toString());
348
+ if (!isImdsCredentials(credentialsResponse)) {
349
+ throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
350
+ logger: init.logger
351
+ });
352
+ }
353
+ return fromImdsCredentials(credentialsResponse);
354
+ };
355
+ init_esm_shims();
356
+ export {
357
+ DEFAULT_MAX_RETRIES,
358
+ DEFAULT_TIMEOUT,
359
+ ENV_CMDS_AUTH_TOKEN,
360
+ ENV_CMDS_FULL_URI,
361
+ ENV_CMDS_RELATIVE_URI,
362
+ Endpoint,
363
+ fromContainerMetadata,
364
+ fromInstanceMetadata,
365
+ getInstanceMetadataEndpoint,
366
+ httpRequest,
367
+ providerConfigFromInit
368
+ };
@@ -0,0 +1,21 @@
1
+ import {
2
+ ENV_ACCOUNT_ID,
3
+ ENV_CREDENTIAL_SCOPE,
4
+ ENV_EXPIRATION,
5
+ ENV_KEY,
6
+ ENV_SECRET,
7
+ ENV_SESSION,
8
+ fromEnv
9
+ } from "./chunk-B7OAPHPY.js";
10
+ import "./chunk-ITI6QA2Q.js";
11
+ import "./chunk-W3VXP3A3.js";
12
+ import "./chunk-JSBRDJBE.js";
13
+ export {
14
+ ENV_ACCOUNT_ID,
15
+ ENV_CREDENTIAL_SCOPE,
16
+ ENV_EXPIRATION,
17
+ ENV_KEY,
18
+ ENV_SECRET,
19
+ ENV_SESSION,
20
+ fromEnv
21
+ };
@@ -0,0 +1,67 @@
1
+ import {
2
+ setCredentialFeature
3
+ } from "./chunk-ITI6QA2Q.js";
4
+ import {
5
+ CredentialsProviderError
6
+ } from "./chunk-W3VXP3A3.js";
7
+ import "./chunk-JSBRDJBE.js";
8
+
9
+ // ../../.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.817.0-d71feb8cb7-880321e3d7.zip/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
10
+ import { readFileSync } from "fs";
11
+
12
+ // ../../.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.817.0-d71feb8cb7-880321e3d7.zip/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js
13
+ var fromWebToken = (init) => async (awsIdentityProperties) => {
14
+ init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
15
+ const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
16
+ let { roleAssumerWithWebIdentity } = init;
17
+ if (!roleAssumerWithWebIdentity) {
18
+ const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-OPF4H3GL.js");
19
+ roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
20
+ ...init.clientConfig,
21
+ credentialProviderLogger: init.logger,
22
+ parentClientConfig: {
23
+ ...awsIdentityProperties?.callerClientConfig,
24
+ ...init.parentClientConfig
25
+ }
26
+ }, init.clientPlugins);
27
+ }
28
+ return roleAssumerWithWebIdentity({
29
+ RoleArn: roleArn,
30
+ RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
31
+ WebIdentityToken: webIdentityToken,
32
+ ProviderId: providerId,
33
+ PolicyArns: policyArns,
34
+ Policy: policy,
35
+ DurationSeconds: durationSeconds
36
+ });
37
+ };
38
+
39
+ // ../../.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.817.0-d71feb8cb7-880321e3d7.zip/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
40
+ var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
41
+ var ENV_ROLE_ARN = "AWS_ROLE_ARN";
42
+ var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
43
+ var fromTokenFile = (init = {}) => async () => {
44
+ init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
45
+ const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
46
+ const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
47
+ const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
48
+ if (!webIdentityTokenFile || !roleArn) {
49
+ throw new CredentialsProviderError("Web identity configuration not specified", {
50
+ logger: init.logger
51
+ });
52
+ }
53
+ const credentials = await fromWebToken({
54
+ ...init,
55
+ webIdentityToken: readFileSync(webIdentityTokenFile, { encoding: "ascii" }),
56
+ roleArn,
57
+ roleSessionName
58
+ })();
59
+ if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
60
+ setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
61
+ }
62
+ return credentials;
63
+ };
64
+ export {
65
+ fromTokenFile,
66
+ fromWebToken
67
+ };
@@ -0,0 +1,196 @@
1
+ import {
2
+ getProfileName,
3
+ parseKnownFiles
4
+ } from "./chunk-TJ744C2T.js";
5
+ import {
6
+ setCredentialFeature
7
+ } from "./chunk-64IS37V6.js";
8
+ import "./chunk-XLUI7RQ4.js";
9
+ import {
10
+ CredentialsProviderError,
11
+ chain,
12
+ init_esm_shims
13
+ } from "./chunk-JBVMOFGH.js";
14
+ import "./chunk-JSBRDJBE.js";
15
+
16
+ // ../deployment-manager/dist/dist-es-Y7VN37H5.js
17
+ init_esm_shims();
18
+ init_esm_shims();
19
+ init_esm_shims();
20
+ init_esm_shims();
21
+ init_esm_shims();
22
+ var resolveCredentialSource = (credentialSource, profileName, logger) => {
23
+ const sourceProvidersMap = {
24
+ EcsContainer: async (options) => {
25
+ const { fromHttp } = await import("./dist-es-OCQVKISC-TNAJ62WG.js");
26
+ const { fromContainerMetadata } = await import("./dist-es-SUPEA6VE-3B5JSW5C.js");
27
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
28
+ return async () => chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
29
+ },
30
+ Ec2InstanceMetadata: async (options) => {
31
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
32
+ const { fromInstanceMetadata } = await import("./dist-es-SUPEA6VE-3B5JSW5C.js");
33
+ return async () => fromInstanceMetadata(options)().then(setNamedProvider);
34
+ },
35
+ Environment: async (options) => {
36
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
37
+ const { fromEnv } = await import("./dist-es-PRWCVZGQ-HTTVI42T.js");
38
+ return async () => fromEnv(options)().then(setNamedProvider);
39
+ }
40
+ };
41
+ if (credentialSource in sourceProvidersMap) {
42
+ return sourceProvidersMap[credentialSource];
43
+ } else {
44
+ throw new CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });
45
+ }
46
+ };
47
+ var setNamedProvider = (creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p");
48
+ var isAssumeRoleProfile = (arg, { profile = "default", logger } = {}) => {
49
+ return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger }));
50
+ };
51
+ var isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {
52
+ const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
53
+ if (withSourceProfile) {
54
+ logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
55
+ }
56
+ return withSourceProfile;
57
+ };
58
+ var isCredentialSourceProfile = (arg, { profile, logger }) => {
59
+ const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
60
+ if (withProviderProfile) {
61
+ logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
62
+ }
63
+ return withProviderProfile;
64
+ };
65
+ var resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}) => {
66
+ options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
67
+ const profileData = profiles[profileName];
68
+ const { source_profile, region } = profileData;
69
+ if (!options.roleAssumer) {
70
+ const { getDefaultRoleAssumer } = await import("./sts-P7Q3MYTS-BKGWHQE4.js");
71
+ options.roleAssumer = getDefaultRoleAssumer({
72
+ ...options.clientConfig,
73
+ credentialProviderLogger: options.logger,
74
+ parentClientConfig: {
75
+ ...options?.parentClientConfig,
76
+ region: region ?? options?.parentClientConfig?.region
77
+ }
78
+ }, options.clientPlugins);
79
+ }
80
+ if (source_profile && source_profile in visitedProfiles) {
81
+ throw new CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${getProfileName(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger });
82
+ }
83
+ options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);
84
+ const sourceCredsProvider = source_profile ? resolveProfileData(source_profile, profiles, options, {
85
+ ...visitedProfiles,
86
+ [source_profile]: true
87
+ }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();
88
+ if (isCredentialSourceWithoutRoleArn(profileData)) {
89
+ return sourceCredsProvider.then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
90
+ } else {
91
+ const params = {
92
+ RoleArn: profileData.role_arn,
93
+ RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,
94
+ ExternalId: profileData.external_id,
95
+ DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10)
96
+ };
97
+ const { mfa_serial } = profileData;
98
+ if (mfa_serial) {
99
+ if (!options.mfaCodeProvider) {
100
+ throw new CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });
101
+ }
102
+ params.SerialNumber = mfa_serial;
103
+ params.TokenCode = await options.mfaCodeProvider(mfa_serial);
104
+ }
105
+ const sourceCreds = await sourceCredsProvider;
106
+ return options.roleAssumer(sourceCreds, params).then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
107
+ }
108
+ };
109
+ var isCredentialSourceWithoutRoleArn = (section) => {
110
+ return !section.role_arn && !!section.credential_source;
111
+ };
112
+ init_esm_shims();
113
+ var isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string";
114
+ var resolveProcessCredentials = async (options, profile) => import("./dist-es-HJVOMDYC-PIAMWMAL.js").then(({ fromProcess }) => fromProcess({
115
+ ...options,
116
+ profile
117
+ })().then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v")));
118
+ init_esm_shims();
119
+ var resolveSsoCredentials = async (profile, profileData, options = {}) => {
120
+ const { fromSSO } = await import("./dist-es-IDBDK36G-Y6TQMRO5.js");
121
+ return fromSSO({
122
+ profile,
123
+ logger: options.logger,
124
+ parentClientConfig: options.parentClientConfig,
125
+ clientConfig: options.clientConfig
126
+ })().then((creds) => {
127
+ if (profileData.sso_session) {
128
+ return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r");
129
+ } else {
130
+ return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
131
+ }
132
+ });
133
+ };
134
+ var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
135
+ init_esm_shims();
136
+ var isStaticCredsProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1;
137
+ var resolveStaticCredentials = async (profile, options) => {
138
+ options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
139
+ const credentials = {
140
+ accessKeyId: profile.aws_access_key_id,
141
+ secretAccessKey: profile.aws_secret_access_key,
142
+ sessionToken: profile.aws_session_token,
143
+ ...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope },
144
+ ...profile.aws_account_id && { accountId: profile.aws_account_id }
145
+ };
146
+ return setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n");
147
+ };
148
+ init_esm_shims();
149
+ var isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
150
+ var resolveWebIdentityCredentials = async (profile, options) => import("./dist-es-ADTONJUN-RVFWNZHO.js").then(({ fromTokenFile }) => fromTokenFile({
151
+ webIdentityTokenFile: profile.web_identity_token_file,
152
+ roleArn: profile.role_arn,
153
+ roleSessionName: profile.role_session_name,
154
+ roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
155
+ logger: options.logger,
156
+ parentClientConfig: options.parentClientConfig
157
+ })().then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q")));
158
+ var resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
159
+ const data = profiles[profileName];
160
+ if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
161
+ return resolveStaticCredentials(data, options);
162
+ }
163
+ if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {
164
+ return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles);
165
+ }
166
+ if (isStaticCredsProfile(data)) {
167
+ return resolveStaticCredentials(data, options);
168
+ }
169
+ if (isWebIdentityProfile(data)) {
170
+ return resolveWebIdentityCredentials(data, options);
171
+ }
172
+ if (isProcessProfile(data)) {
173
+ return resolveProcessCredentials(options, profileName);
174
+ }
175
+ if (isSsoProfile(data)) {
176
+ return await resolveSsoCredentials(profileName, data, options);
177
+ }
178
+ throw new CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });
179
+ };
180
+ var fromIni = (_init = {}) => async ({ callerClientConfig } = {}) => {
181
+ const init = {
182
+ ..._init,
183
+ parentClientConfig: {
184
+ ...callerClientConfig,
185
+ ..._init.parentClientConfig
186
+ }
187
+ };
188
+ init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
189
+ const profiles = await parseKnownFiles(init);
190
+ return resolveProfileData(getProfileName({
191
+ profile: _init.profile ?? callerClientConfig?.profile
192
+ }), profiles, init);
193
+ };
194
+ export {
195
+ fromIni
196
+ };
@@ -0,0 +1,17 @@
1
+ import { S3Event, Context, Callback, S3EventRecord } from 'aws-lambda';
2
+
3
+ /**
4
+ * Lambda handler function that processes S3 events and creates CloudFront invalidations
5
+ */
6
+ declare const handler: (event: S3Event, _: Context, callback: Callback) => Promise<void>;
7
+ /**
8
+ * Process individual S3 event record
9
+ */
10
+ declare function processRecord(record: S3EventRecord, distributionId: string): Promise<{
11
+ key: string;
12
+ invalidated: boolean;
13
+ paths?: string[];
14
+ invalidationId?: string;
15
+ }>;
16
+
17
+ export { handler, processRecord };
@@ -0,0 +1,17 @@
1
+ import { S3Event, Context, Callback, S3EventRecord } from 'aws-lambda';
2
+
3
+ /**
4
+ * Lambda handler function that processes S3 events and creates CloudFront invalidations
5
+ */
6
+ declare const handler: (event: S3Event, _: Context, callback: Callback) => Promise<void>;
7
+ /**
8
+ * Process individual S3 event record
9
+ */
10
+ declare function processRecord(record: S3EventRecord, distributionId: string): Promise<{
11
+ key: string;
12
+ invalidated: boolean;
13
+ paths?: string[];
14
+ invalidationId?: string;
15
+ }>;
16
+
17
+ export { handler, processRecord };