@go-to-k/cdkd 0.291.4 → 0.291.6
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/dist/{asg-provider-_vdcb9QG.js → asg-provider-B1pinTYm.js} +4 -4
- package/dist/asg-provider-B1pinTYm.js.map +1 -0
- package/dist/{aws-client-defaults-BoIxyCir.js → aws-client-defaults-jISU4PHo.js} +70 -2
- package/dist/aws-client-defaults-jISU4PHo.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-CpMT9Bmm.js → deploy-engine-BrGb93QQ.js} +138 -33
- package/dist/deploy-engine-BrGb93QQ.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{program-C5r-kmIQ.js → program-CGPchKa2.js} +154 -157
- package/dist/{program-C5r-kmIQ.js.map → program-CGPchKa2.js.map} +1 -1
- package/dist/{version-ChuDKy_E.js → version-DQAkja2a.js} +2 -2
- package/dist/{version-ChuDKy_E.js.map → version-DQAkja2a.js.map} +1 -1
- package/package.json +1 -1
- package/dist/asg-provider-_vdcb9QG.js.map +0 -1
- package/dist/aws-client-defaults-BoIxyCir.js.map +0 -1
- package/dist/deploy-engine-CpMT9Bmm.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as displayAwsMessage, D as truncateCodePoints, E as isPasteableIdent, S as UNRENDERABLE, T as displaySafe, d as applyDefaultNameForFallback, f as explicitNamePropertyFor, g as looksLikeCdkdGeneratedName, h as getCurrentStackName, m as generateResourceNameWithFallback, n as getLogger, p as generateResourceName, r as isStdoutReservedForPayload, s as getLiveRenderer, v as withStackName, w as displayIdent, x as STACK_REF_MAX_CODE_POINTS, y as withoutGeneratedFallbackName } from "./logger-GASr9bAF.js";
|
|
2
|
-
import { a as setAssumedRoleCredentials, i as getPreAssumeEnvCredentials, n as awsClientDefaults, o as setPreAssumeEnvCredentials, r as getAssumedRoleCredentials, t as SECOND_ROLE_PUBLISH_REFUSAL } from "./aws-client-defaults-
|
|
3
|
-
import { t as getCdkdVersion } from "./version-
|
|
2
|
+
import { a as setAssumedRoleCredentials, c as currentStackAwsScope, i as getPreAssumeEnvCredentials, l as runInStackAwsScope, n as awsClientDefaults, o as setPreAssumeEnvCredentials, r as getAssumedRoleCredentials, s as ambientRegion, t as SECOND_ROLE_PUBLISH_REFUSAL } from "./aws-client-defaults-jISU4PHo.js";
|
|
3
|
+
import { t as getCdkdVersion } from "./version-DQAkja2a.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { createHash, randomUUID } from "node:crypto";
|
|
6
6
|
import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetBucketReplicationCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
@@ -1436,14 +1436,20 @@ function formatDuration$1(ms) {
|
|
|
1436
1436
|
* the attribute and the live read finds nothing or fails), plus the
|
|
1437
1437
|
* read-less `AWS::RDS::DBProxy` / `DBProxyEndpoint` `VpcId` refusal beside
|
|
1438
1438
|
* them — each replacing a physical id the attribute's value type can never
|
|
1439
|
-
* accept
|
|
1439
|
+
* accept; and `lookupResourceRecord`'s refusal of a state record whose
|
|
1440
|
+
* `physicalId` is not a string
|
|
1441
|
+
* ([#3576](https://github.com/go-to-k/cdkd/issues/3576)), which both `Ref`
|
|
1442
|
+
* and `Fn::GetAtt` reach, and so both `${...}` forms.
|
|
1440
1443
|
* 2. NOT reachable from it, and thrown as this class only so that "deliberate
|
|
1441
1444
|
* refusal" is a property of the THROW rather than of the one catch that
|
|
1442
1445
|
* inspects it: `resolveSplit`'s two refusals of a non-string value (#1874),
|
|
1446
|
+
* `resolveSelect`'s refusal of an index that does not resolve to a
|
|
1447
|
+
* non-negative integer ([#3574](https://github.com/go-to-k/cdkd/issues/3574)),
|
|
1443
1448
|
* and `refuseCoercedInheritedSecret`, which refuses an already-resolved
|
|
1444
1449
|
* value whose type cannot be coerced. Their non-reachability has two
|
|
1445
|
-
* DIFFERENT reasons, so do not collapse them: `
|
|
1446
|
-
* contain an `Fn::Split
|
|
1450
|
+
* DIFFERENT reasons, so do not collapse them: a `${...}` placeholder cannot
|
|
1451
|
+
* syntactically contain an `Fn::Split` or `Fn::Select`, while
|
|
1452
|
+
* `refuseCoercedInheritedSecret` runs in the
|
|
1447
1453
|
* nested-stack PARAMETER pre-pass, before any `Fn::Sub` is resolved. Neither
|
|
1448
1454
|
* changes behavior by being this class.
|
|
1449
1455
|
* 3. PERMANENT — the one site where no user action and no re-run can make the
|
|
@@ -1453,7 +1459,8 @@ function formatDuration$1(ms) {
|
|
|
1453
1459
|
* {@link CrossAccountSecretRefusalError} rather than this class, because
|
|
1454
1460
|
* every site in groups 1 and 2 is USER-FIXABLE (correct the stale
|
|
1455
1461
|
* placeholder ARN, deploy the producer so STS resolves, enrich the
|
|
1456
|
-
* `Fn::GetAtt`, drop `--strict-getatt`, fix the malformed `Fn::Split
|
|
1462
|
+
* `Fn::GetAtt`, drop `--strict-getatt`, fix the malformed `Fn::Split` or
|
|
1463
|
+
* `Fn::Select` index, repair the record's `physicalId`,
|
|
1457
1464
|
* correct the nested stack's output name, declare the nested-stack parameter
|
|
1458
1465
|
* `Type: String`) and a
|
|
1459
1466
|
* consumer that treats "permanent" as a property of the CLASS silently
|
|
@@ -1983,6 +1990,7 @@ var aws_clients_exports = /* @__PURE__ */ __exportAll({
|
|
|
1983
1990
|
AwsClients: () => AwsClients,
|
|
1984
1991
|
getAwsClients: () => getAwsClients,
|
|
1985
1992
|
resetAwsClients: () => resetAwsClients,
|
|
1993
|
+
runWithStackAwsClients: () => runWithStackAwsClients,
|
|
1986
1994
|
setAwsClients: () => setAwsClients
|
|
1987
1995
|
});
|
|
1988
1996
|
/**
|
|
@@ -2063,18 +2071,21 @@ var AwsClients = class AwsClients {
|
|
|
2063
2071
|
* incomplete, it is UNSTABLE in the one direction that is dangerous: the SDK
|
|
2064
2072
|
* memoizes a region-less client's region at its first resolution
|
|
2065
2073
|
* (`@smithy/node-config-provider`'s `loadConfig` wraps the provider chain in
|
|
2066
|
-
* `memoize`), while `
|
|
2067
|
-
* `
|
|
2068
|
-
* `
|
|
2069
|
-
*
|
|
2074
|
+
* `memoize`), while a per-stack region switch (`destroy-runner.ts` today;
|
|
2075
|
+
* `deploy.ts` until issue #1981 moved it into a stack scope) mutates
|
|
2076
|
+
* `process.env.AWS_REGION` and restores it in each stack's `finally`. So
|
|
2077
|
+
* an env-derived answer can report region X for a client that long ago
|
|
2078
|
+
* pinned itself to region P — letting a caller conclude "these
|
|
2070
2079
|
* clients already point at my region" and use the WRONG ones, which is worse
|
|
2071
2080
|
* than not knowing.
|
|
2072
2081
|
*
|
|
2073
2082
|
* When this returns `undefined` the region is not merely unknown to us, it is
|
|
2074
|
-
* NOT YET DECIDED — and that is the important part.
|
|
2075
|
-
*
|
|
2083
|
+
* NOT YET DECIDED — and that is the important part. Outside a stack scope
|
|
2084
|
+
* (`runWithStackAwsClients`, which makes `awsClientDefaults()` supply the
|
|
2085
|
+
* scope's region), {@link clientOptions} omits `region` entirely in that
|
|
2086
|
+
* case, so each service client resolves and
|
|
2076
2087
|
* MEMOIZES its own region independently, at its own first construction, from
|
|
2077
|
-
* an environment
|
|
2088
|
+
* an environment a per-stack region switch may be actively mutating. The
|
|
2078
2089
|
* members of one region-less bag can therefore disagree with each other:
|
|
2079
2090
|
* `ssm` can pin `us-west-2` and `secretsManager` pin `us-east-1` a moment
|
|
2080
2091
|
* later, because the getters are lazy and each samples a different instant.
|
|
@@ -2491,14 +2502,44 @@ var AwsClients = class AwsClients {
|
|
|
2491
2502
|
*/
|
|
2492
2503
|
let globalClients = null;
|
|
2493
2504
|
/**
|
|
2494
|
-
*
|
|
2505
|
+
* The AWS clients for the code running now: the active per-stack scope's
|
|
2506
|
+
* clients when one is entered ({@link runWithStackAwsClients}), else the
|
|
2507
|
+
* process-global instance, created on first use.
|
|
2508
|
+
*
|
|
2509
|
+
* The scope comes FIRST so that a stack deploying concurrently with a stack in
|
|
2510
|
+
* another region can never read the other stack's clients (issue
|
|
2511
|
+
* go-to-k/cdkd#1981). `config` only matters when the global is created.
|
|
2495
2512
|
*/
|
|
2496
2513
|
function getAwsClients(config) {
|
|
2514
|
+
const scoped = currentStackAwsScope();
|
|
2515
|
+
if (scoped) return scoped.clients;
|
|
2497
2516
|
if (!globalClients) globalClients = new AwsClients(config);
|
|
2498
2517
|
return globalClients;
|
|
2499
2518
|
}
|
|
2500
2519
|
/**
|
|
2501
|
-
*
|
|
2520
|
+
* Run `fn` with `clients` as the AWS clients, and their configured region as
|
|
2521
|
+
* the ambient region, of everything it calls — across `await`s, and without
|
|
2522
|
+
* touching the process-global instance or `process.env.AWS_REGION`, which
|
|
2523
|
+
* concurrently running stacks would otherwise overwrite for each other
|
|
2524
|
+
* (issue go-to-k/cdkd#1981). See `stack-aws-scope.ts`.
|
|
2525
|
+
*
|
|
2526
|
+
* `clients` must be configured with a region: the scope's whole job is to name
|
|
2527
|
+
* one, and a region-less bag resolves its region from the very environment
|
|
2528
|
+
* this replaces.
|
|
2529
|
+
*/
|
|
2530
|
+
function runWithStackAwsClients(clients, fn) {
|
|
2531
|
+
const region = clients.configuredRegion;
|
|
2532
|
+
if (region === void 0) throw new Error("runWithStackAwsClients requires AwsClients configured with a region");
|
|
2533
|
+
return runInStackAwsScope({
|
|
2534
|
+
region,
|
|
2535
|
+
clients
|
|
2536
|
+
}, fn);
|
|
2537
|
+
}
|
|
2538
|
+
/**
|
|
2539
|
+
* Set global AWS clients instance.
|
|
2540
|
+
*
|
|
2541
|
+
* Inside a {@link runWithStackAwsClients} scope, `getAwsClients()` keeps
|
|
2542
|
+
* returning the scope's clients: the global this sets is only seen outside it.
|
|
2502
2543
|
*/
|
|
2503
2544
|
function setAwsClients(clients) {
|
|
2504
2545
|
globalClients = clients;
|
|
@@ -27521,7 +27562,7 @@ function parseWebACLArn(arn) {
|
|
|
27521
27562
|
*/
|
|
27522
27563
|
var WAFv2WebACLProvider = class {
|
|
27523
27564
|
wafv2Client;
|
|
27524
|
-
providerRegion =
|
|
27565
|
+
providerRegion = ambientRegion();
|
|
27525
27566
|
logger = getLogger().child("WAFv2WebACLProvider");
|
|
27526
27567
|
handledProperties = /* @__PURE__ */ new Map([["AWS::WAFv2::WebACL", /* @__PURE__ */ new Set([
|
|
27527
27568
|
"Name",
|
|
@@ -28451,6 +28492,19 @@ function nestedStackChildRegionFromLocalArn(physicalId) {
|
|
|
28451
28492
|
return NESTED_STACK_LOCAL_ARN.exec(physicalId)?.[1];
|
|
28452
28493
|
}
|
|
28453
28494
|
/**
|
|
28495
|
+
* The array position a RESOLVED `Fn::Select` index names, or `undefined` when
|
|
28496
|
+
* it names none (issue #3574): a non-negative safe integer, or its canonical
|
|
28497
|
+
* decimal string (CloudFormation accepts `"1"`, and a `Ref` to a parameter the
|
|
28498
|
+
* resolver did not coerce is still a string). No `Number()` on anything else:
|
|
28499
|
+
* it trims whitespace and maps `""` / `null` / `[]` to `0`. No leading zero
|
|
28500
|
+
* either, so `String(position)` IS the resolved text and masks like it — the
|
|
28501
|
+
* same shape `import.ts`'s `isStaticSelectIndex` vouches for.
|
|
28502
|
+
*/
|
|
28503
|
+
function selectIndexPosition(value) {
|
|
28504
|
+
const n = typeof value === "number" ? value : typeof value === "string" && /^(0|[1-9][0-9]*)$/.test(value) ? Number(value) : void 0;
|
|
28505
|
+
return n !== void 0 && Number.isSafeInteger(n) && n >= 0 ? n : void 0;
|
|
28506
|
+
}
|
|
28507
|
+
/**
|
|
28454
28508
|
* The prefix every dynamic-reference diagnostic this resolver spells carries.
|
|
28455
28509
|
*
|
|
28456
28510
|
* Exported because `cdkd scrub` applies the SAME partition on its side and must
|
|
@@ -30210,6 +30264,33 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
30210
30264
|
throw markNonRetryable(new IntrinsicResolutionRefusalError(`Nested-stack parameter '${loggedName}' is declared 'Type: ${loggedType}', but the parent stack resolved a SECRET dynamic reference into it. cdkd keeps a resolved secret out of persisted state by rewriting STRING leaves back to their {{resolve:...}} expression; coercing this value to '${loggedType}' destroys the plaintext cdkd would have matched on, so the DECRYPTED secret would be left in the child stack's state.json with nothing to redact it back to. Declare '${loggedName}' as 'Type: String' in the nested stack's template (CDK does this by default for cross-stack references), or stop passing a secret reference into it.`, void 0, "NESTED_STACK_SECRET_PARAMETER_TYPE"));
|
|
30211
30265
|
}
|
|
30212
30266
|
/**
|
|
30267
|
+
* The ONE read of a state record by logical id, shared by `Ref` and
|
|
30268
|
+
* `Fn::GetAtt` (the only two arms that take a record out of
|
|
30269
|
+
* `context.resources`; every other method receives it from them).
|
|
30270
|
+
*
|
|
30271
|
+
* - `Object.hasOwn`, never a bare read (issue #2767): the logical id is
|
|
30272
|
+
* template text, and a plain-object read walks the prototype chain.
|
|
30273
|
+
* - A record whose `physicalId` is not a string, or that is not an object at
|
|
30274
|
+
* all, is REFUSED here, above every reader (issue #3576). Nothing in
|
|
30275
|
+
* `src/state/` checks the type, so a hand edit or a foreign writer can
|
|
30276
|
+
* leave a number, and the arms below call `.startsWith` / `.replace` on
|
|
30277
|
+
* it (a bare `TypeError`) or build an ARN from it. cdkd never writes such
|
|
30278
|
+
* a record, so no answer derived from it is honest. `markNonRetryable`:
|
|
30279
|
+
* the verdict is a function of the persisted record, and the message
|
|
30280
|
+
* carries a template-controlled id. A NULL record keeps missing as before.
|
|
30281
|
+
*/
|
|
30282
|
+
lookupResourceRecord(logicalId, via, context) {
|
|
30283
|
+
const resource = Object.hasOwn(context.resources, logicalId) ? context.resources[logicalId] : void 0;
|
|
30284
|
+
if (!resource) return void 0;
|
|
30285
|
+
const isObject = typeof resource === "object" && !Array.isArray(resource);
|
|
30286
|
+
const physicalId = isObject ? resource.physicalId : void 0;
|
|
30287
|
+
if (typeof physicalId !== "string") {
|
|
30288
|
+
const loggedId = this.displayMasked(logicalId, context);
|
|
30289
|
+
throw markNonRetryable(new IntrinsicResolutionRefusalError(`${via} ${loggedId}: ${isObject ? `the state record's physical id is ${physicalId === null ? "null" : typeof physicalId}, not a string` : `the state record is ${Array.isArray(resource) ? "an array" : typeof resource}, not an object`}. cdkd always records an object with a string id, so this record was edited by hand or written by another tool. ${isObject ? `Set the resource's "physicalId" in the stack's state.json back to the id AWS knows the resource by.` : `Restore the resource's record in the stack's state.json, or remove it and re-import the resource.`}`, void 0, "STATE_PHYSICAL_ID_NOT_STRING"));
|
|
30290
|
+
}
|
|
30291
|
+
return resource;
|
|
30292
|
+
}
|
|
30293
|
+
/**
|
|
30213
30294
|
* Resolve Ref intrinsic function
|
|
30214
30295
|
*
|
|
30215
30296
|
* Ref can reference:
|
|
@@ -30218,7 +30299,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
30218
30299
|
* 3. Pseudo parameters (AWS::Region, AWS::AccountId, etc.)
|
|
30219
30300
|
*/
|
|
30220
30301
|
async resolveRef(logicalId, context) {
|
|
30221
|
-
const resource =
|
|
30302
|
+
const resource = this.lookupResourceRecord(logicalId, "Ref", context);
|
|
30222
30303
|
if (resource) {
|
|
30223
30304
|
const refValue = this.resolveRefValue(logicalId, resource, context);
|
|
30224
30305
|
this.logger.debug(`Resolved Ref to resource: ${this.displayMasked(logicalId, context)} -> ${this.displayMasked(String(refValue), context)}`);
|
|
@@ -30412,7 +30493,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
30412
30493
|
logicalId = split.logicalId;
|
|
30413
30494
|
attributeName = split.attributeName;
|
|
30414
30495
|
}
|
|
30415
|
-
const resource =
|
|
30496
|
+
const resource = this.lookupResourceRecord(logicalId, "Fn::GetAtt", context);
|
|
30416
30497
|
if (!resource) throw markNonRetryable(/* @__PURE__ */ new Error(`Resource ${this.displayMasked(logicalId, context)} not found for Fn::GetAtt`));
|
|
30417
30498
|
if (!(resource.resourceType === "AWS::EC2::VPC" && attributeName === "Ipv6CidrBlocks") && resource.attributes !== void 0) {
|
|
30418
30499
|
const storedValue = Object.hasOwn(resource.attributes, attributeName) ? resource.attributes[attributeName] : void 0;
|
|
@@ -30768,7 +30849,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
30768
30849
|
case "Ipv6CidrBlocks": try {
|
|
30769
30850
|
const ec2 = this.clientsForRegion(this.explicitRegion).ec2;
|
|
30770
30851
|
const maxAttempts = 15;
|
|
30771
|
-
const loggedId = this.displayMasked(
|
|
30852
|
+
const loggedId = this.displayMasked(physicalId, context);
|
|
30772
30853
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
30773
30854
|
const associations = (await ec2.send(new DescribeVpcsCommand({ VpcIds: [physicalId] }))).Vpcs?.[0]?.Ipv6CidrBlockAssociationSet || [];
|
|
30774
30855
|
const blocks = associations.filter((a) => a.Ipv6CidrBlockState?.State === "associated").map((a) => a.Ipv6CidrBlock);
|
|
@@ -30786,7 +30867,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
30786
30867
|
this.logger.warn(`VPC ${loggedId} IPv6 CIDR did not reach 'associated' state after ${maxAttempts} attempts`);
|
|
30787
30868
|
return [];
|
|
30788
30869
|
} catch (error) {
|
|
30789
|
-
this.logger.warn(`Failed to fetch VPC Ipv6CidrBlocks for ${this.displayMasked(
|
|
30870
|
+
this.logger.warn(`Failed to fetch VPC Ipv6CidrBlocks for ${this.displayMasked(physicalId, context)}: ${this.displayMasked(error instanceof Error ? error.message : String(error), context)}`);
|
|
30790
30871
|
return [];
|
|
30791
30872
|
}
|
|
30792
30873
|
case "DefaultSecurityGroup": {
|
|
@@ -30911,7 +30992,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
30911
30992
|
const { GetNamespaceCommand } = await import("@aws-sdk/client-servicediscovery");
|
|
30912
30993
|
return (await (await this.serviceDiscoveryClient()).send(new GetNamespaceCommand({ Id: physicalId }))).Namespace?.Properties?.DnsProperties?.HostedZoneId;
|
|
30913
30994
|
} catch (error) {
|
|
30914
|
-
this.logger.warn(`Failed to fetch HostedZoneId for namespace ${this.displayMasked(
|
|
30995
|
+
this.logger.warn(`Failed to fetch HostedZoneId for namespace ${this.displayMasked(physicalId, context)}: ${this.displayMasked(error instanceof Error ? error.message : String(error), context)}`);
|
|
30915
30996
|
return;
|
|
30916
30997
|
}
|
|
30917
30998
|
default: return this.guardedPhysicalIdFallback(logicalId, attributeName, resourceType, physicalId, context);
|
|
@@ -31112,7 +31193,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
31112
31193
|
const value = attributeName === "LatestVersionNumber" ? lt?.LatestVersionNumber : lt?.DefaultVersionNumber;
|
|
31113
31194
|
if (value !== void 0 && value !== null) return String(value);
|
|
31114
31195
|
} catch (err) {
|
|
31115
|
-
this.logger.warn(`DescribeLaunchTemplates(${this.displayMasked(
|
|
31196
|
+
this.logger.warn(`DescribeLaunchTemplates(${this.displayMasked(physicalId, context)}) failed for ${this.displayMasked(attributeName, context)}: ${this.displayMasked(err instanceof Error ? err.message : String(err), context)}`);
|
|
31116
31197
|
}
|
|
31117
31198
|
return attributeName === "LatestVersionNumber" ? "$Latest" : "$Default";
|
|
31118
31199
|
}
|
|
@@ -31606,18 +31687,29 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
31606
31687
|
* Resolve Fn::Select intrinsic function
|
|
31607
31688
|
*
|
|
31608
31689
|
* Fn::Select: [index, [value1, value2, ...]]
|
|
31609
|
-
* Returns the value at the specified index in the list
|
|
31690
|
+
* Returns the value at the specified index in the list. The index may be an
|
|
31691
|
+
* intrinsic; it is resolved, then must name a position (issue #3574).
|
|
31610
31692
|
*/
|
|
31611
31693
|
async resolveSelect(selectArgs, context) {
|
|
31694
|
+
if (!Array.isArray(selectArgs) || selectArgs.length !== 2) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Fn::Select takes a two-element list [index, list], got ${this.describeOperandShape(selectArgs, context)}`));
|
|
31612
31695
|
const [index, list] = selectArgs;
|
|
31696
|
+
const resolvedIndex = await this.resolveValue(index, context);
|
|
31697
|
+
const position = selectIndexPosition(resolvedIndex);
|
|
31698
|
+
if (position === void 0) {
|
|
31699
|
+
const source = this.describeSplitValueSource(index);
|
|
31700
|
+
const sourceClause = source ? ` (from ${this.displayMasked(source.label, context)})` : "";
|
|
31701
|
+
throw markNonRetryable(new IntrinsicResolutionRefusalError(`Fn::Select: the index${sourceClause} must resolve to a non-negative integer (a number, or its decimal string with no leading zero), got ${this.describeOperandShape(resolvedIndex, context)}. Use a literal, a Ref to a parameter or an Fn::FindInMap that yields one.`));
|
|
31702
|
+
}
|
|
31613
31703
|
const resolvedList = await this.resolveValue(list, context);
|
|
31614
31704
|
if (!Array.isArray(resolvedList)) throw new Error(`Fn::Select: list must be an array, got ${typeof resolvedList}`);
|
|
31615
|
-
|
|
31616
|
-
|
|
31617
|
-
|
|
31618
|
-
|
|
31619
|
-
|
|
31620
|
-
|
|
31705
|
+
const loggedPosition = this.displayMasked(String(position), context);
|
|
31706
|
+
if (position >= resolvedList.length) {
|
|
31707
|
+
if (loggedPosition !== String(position)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Fn::Select: the index ${loggedPosition} is out of bounds (array length: ${resolvedList.length}), and it resolves from a secret value, so cdkd will not write it into the OutOfBounds placeholder.`));
|
|
31708
|
+
this.logger.warn(`Fn::Select: index ${position} out of bounds (array length: ${resolvedList.length})`);
|
|
31709
|
+
return `{{Fn::Select:${position}:OutOfBounds}}`;
|
|
31710
|
+
}
|
|
31711
|
+
const result = resolvedList[position];
|
|
31712
|
+
this.logger.debug(`Resolved Fn::Select: index ${loggedPosition} -> ${JSON.stringify(this.maskValueLeaves(result, context))}`);
|
|
31621
31713
|
return result;
|
|
31622
31714
|
}
|
|
31623
31715
|
/**
|
|
@@ -31636,6 +31728,18 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
31636
31728
|
return "<intrinsic>";
|
|
31637
31729
|
}
|
|
31638
31730
|
/**
|
|
31731
|
+
* Name a malformed operand's type, and its value when that is a scalar, for
|
|
31732
|
+
* a refusal message. The value is template text or a resolution product, so
|
|
31733
|
+
* it goes through the builder (issue #3479).
|
|
31734
|
+
*/
|
|
31735
|
+
describeOperandShape(value, context) {
|
|
31736
|
+
if (value === null) return "null";
|
|
31737
|
+
if (Array.isArray(value)) return `an array of ${value.length}`;
|
|
31738
|
+
if (typeof value === "string") return `string "${this.displayMasked(value, context)}"`;
|
|
31739
|
+
if (typeof value === "number" || typeof value === "boolean") return `${typeof value} ${this.displayMasked(String(value), context)}`;
|
|
31740
|
+
return typeof value;
|
|
31741
|
+
}
|
|
31742
|
+
/**
|
|
31639
31743
|
* Name the UNRESOLVED value argument of an `Fn::Split` for its refusal
|
|
31640
31744
|
* message (issue [#1874](https://github.com/go-to-k/cdkd/issues/1874)).
|
|
31641
31745
|
*
|
|
@@ -31653,7 +31757,8 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
31653
31757
|
* naming the parameter.
|
|
31654
31758
|
*
|
|
31655
31759
|
* Anything else degrades to its bare intrinsic key, or to `undefined` for a
|
|
31656
|
-
* literal (which the message then simply omits).
|
|
31760
|
+
* literal (which the message then simply omits). `resolveSelect` borrows the
|
|
31761
|
+
* label for its index refusal (issue #3574); only `kind` is Split-specific.
|
|
31657
31762
|
*
|
|
31658
31763
|
* `kind` is not decoration: the caller uses it to pick the remedy, since the
|
|
31659
31764
|
* `Fn::GetAtt` remedy (drop the `Fn::Split`, and the #1868 note for the
|
|
@@ -35482,7 +35587,7 @@ var CloudControlProvider = class {
|
|
|
35482
35587
|
const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
|
|
35483
35588
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
35484
35589
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
35485
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
35590
|
+
const { ASGProvider } = await import("./asg-provider-B1pinTYm.js").then((n) => n.n);
|
|
35486
35591
|
const asgProvider = new ASGProvider();
|
|
35487
35592
|
return withIndeterminateGuard(await asgProvider.delete(logicalId, physicalId, resourceType, _properties, context), indeterminateGuard);
|
|
35488
35593
|
}
|
|
@@ -50732,5 +50837,5 @@ var DeployEngine = class DeployEngine {
|
|
|
50732
50837
|
};
|
|
50733
50838
|
|
|
50734
50839
|
//#endregion
|
|
50735
|
-
export { yellow as $,
|
|
50736
|
-
//# sourceMappingURL=deploy-engine-
|
|
50840
|
+
export { yellow as $, retryClassificationText as $a, expectedOwnerParam as $i, repairMalformedResourcePropertiesForReadOnly as $n, rewriteTemplateAssetReferences as $r, requireConfigObject as $t, createPreDeleteFinalSnapshot as A, LocalInvokeBuildError as Aa, getDefaultStateBucketName as Ai, malformedOutputsRefusalMessage as An, buildForceUnlockCommand as Ar, carriesDynamicReference as At, isStatefulRecreateTargetSync as B, StackTerminationProtectionError as Ba, warnDeprecatedNoPrefixCliFlag as Bi, refuseMalformedOrphansForDestroy as Bn, hasUnverifiableParameterRefusal as Br, isSettledInstanceState as Bt, namesAnyDeclaredParameter as C, CdkdError as Ca, runDockerStreaming as Ci, isReadableResourceEntry as Cn, recoverMaskedOutput as Cr, slowCcOperationTimeoutMs as Ct, PRE_DELETE_SNAPSHOT_TYPES as D, DeployCancelledError as Da, getDockerImageBySourceHash as Di, malformedOrphanRecordsWarning as Dn, S3StateBackend as Dr, disableInstanceApiTermination as Dt, ATOMIC_FINAL_SNAPSHOT_TYPES as E, DependencyError as Ea, AssetManifestLoader as Ei, malformedLocalOutputsWarning as En, LockManager as Er, deleteSkipReason as Et, extractDeploymentEventError as F, PartialFailureError as Fa, resolveSkipPrefix as Fi, malformedResourcesWarning as Fn, CUSTOM_RESOURCE_RESPONSE_PREFIX as Fr, isImpossibleEmptyStoredAttribute as Ft, toCfnInteger as G, normalizeAwsError as Ga, findLargeInlineResources as Gi, refuseMalformedResourceEntries as Gn, orphansCarriedFrom as Gr, coerceCfnBoolean as Gt, WARM_THROUGHPUT_MEMBERS as H, SynthesisError as Ha, CFN_TEMPLATE_BODY_LIMIT as Hi, refuseMalformedOutputs as Hn, importableOutputs as Hr, normalizeAwsTagsToCfn as Ht, makeSiblingClaimReader as I, ProvisioningError as Ia, resolveStateBucketWithDefault as Ii, malformedStateRefusalMessage as In, DEFAULT_STATE_PREFIX as Ir, isNamelessDynamicReferenceError as It, bold as J, isRetryableTransientError as Ja, injectiveKey as Ji, refuseMalformedResourcesForDestroy as Jn, stringifyValue as Jr, configIntegerRefusal as Jt, toFiniteNumber as K, withErrorHandling as Ka, uploadCfnTemplate as Ki, refuseMalformedResourceEntriesForOrphan as Kn, shouldRetainResource as Kr, coerceCfnInteger as Kt, planOrphanAdoption as L, ResourceTimeoutError as La, resolveStateBucketWithDefaultAndSource as Li, refuseDivergentRecordRegionForDestroy as Ln, exportNamesCarriedFrom as Lr, isUnboundTemplateParameter as Lt, refusesFinalSnapshot as M, LockError as Ma, resolveApp as Mi, malformedRenderedContainersWarning as Mn, forceQuitRecoveryClause as Mr, cfnRefValueFromPhysicalId as Mt, unsupportedFinalSnapshotError as N, MalformedProducerRecordRefusalError as Na, resolveAutoAssetStorage as Ni, malformedResourceEntriesWarning as Nn, formatLockExpiry as Nr, coerceParameterTypedValue as Nt, buildFinalSnapshotIdentifier as O, DynamicReferenceRegionAmbiguousError as Oa, Synthesizer as Oi, malformedOrphansRefusalMessage as On, rebuildClientForBucketRegion as Or, isTerminationProtectionPropagationError as Ot, makeCanonicalizePropertiesFn as P, NestedStackChildDirectDestroyError as Pa, resolveCaptureObservedState as Pi, malformedResourcePropertiesWarning as Pn, shellQuote as Pr, getAccountInfo as Pt, red as Q, markRedactedCause as Qa, decodeListingKey as Qi, repairMalformedResourceEntriesForReadOnly as Qn, loadPublishableAssetManifest as Qr, requireConfigArray as Qt, MULTI_REGION_RECREATE_BLOCKED_TYPES as R, ResourceUpdateNotSupportedError as Ra, resolveUseCdkBootstrapAssets as Ri, refuseMalformedNestedChildOutputs as Rn, hasReadableExportSet as Rr, parameterTypeMayLoseSecretIdentity as Rt, computeParameterTaint as S, AssetError as Sa, runDockerForeground as Si, hasReadableResources as Sn, recordMaskOnlyValue as Sr, isWaitAbandonedError as St, resourcesNamingDeclaredParameter as T, CrossAccountSecretRefusalError as Ta, stripControlChars as Ti, malformedExportSourceWarning as Tn, scrubResourceRecord as Tr, deleteIndeterminateGuards as Tt, coerceWarmThroughput as U, formatError as Ua, CFN_TEMPLATE_URL_LIMIT as Ui, refuseMalformedOutputsForDestroy as Un, isReadableBag as Ur, resolveExplicitPhysicalId as Ut, renderStatefulReason as V, StateError as Va, ssmResolvedValueType as Vi, refuseMalformedOrphansForOrphan as Vn, importableOutputKeys as Vr, WAFv2WebACLProvider as Vt, isWarmThroughputDecrease as W, isCdkdError as Wa, MIGRATE_TMP_PREFIX as Wi, refuseMalformedResourceAttributesForOrphan as Wn, orphansAfterRollback as Wr, assertRegionMatch as Wt, gray as X, isTransientServerError as Xa, producerCoordinateKey as Xi, repairMalformedOrphansForReadOnly as Xn, buildAssetRedirectMap as Xr, readConfigString as Xt, cyan as Y, isThrottlingError as Ya, injectiveKeyPrefix as Yi, refuseMalformedState as Yn, WorkGraph as Yr, configStringRefusal as Yt, green as Z, markNonRetryable as Za, producerRecordKey as Zi, repairMalformedOutputsForReadOnly as Zn, createAssetRedirectResolver as Zr, replayWarn as Zt, bagHoldsSecretExpression as _, AwsClients as _a, dockerSpawnEnvWithSensitive as _i, UNREADABLE_ORPHANS_CONTAINER_ROW as _n, identityKeyFor as _r, endCommandInterruptScope as _t, DeploymentEventsStore as a, globMatches as aa, isCrossRegionRedirect as ai, s3BucketDomainName as an, describeTypeWithThrottleRetry as ar, secretBearingStateKeyWarning as at, mergeNoChangeOutputs as b, runWithStackAwsClients as ba, partitionSensitiveEnv as bi, hasReadableOrphans as bn, maskSecretsInError as br, startInterruptWatch as bt, replayFailedOperations as c, hasOwnKey as ca, validateAssetBucketName as ci, s3BucketWebsiteUrl as cn, TemplateParser as cr, IAMRoleProvider as ct, updatePartialMessage as d, ownValue as da, buildDockerImage as di, applyCallerIdentityCredentials as dn, STATE_SOURCED_READBACK_RULES as dr, ProviderRegistry as dt, PARTITION_TABLE as ea, AssetModeResolver as ei, requireConfigString as en, describeAwsFailure as eo, repairMalformedResourcesForReadOnly as er, collectDeclaredOutputNames as et, updatePartialReason as f, absoluteAssemblyPathEscape as fa, resolveDockerContextDirectory as fi, callerEnvCredentials as fn, TEMPLATE_SOURCED_RULES as fr, wouldReturnToSdkProvider as ft, computeImplicitDeleteEdges as g, resolveBucketRegion as ga, describeDockerFailure as gi, STATE_RESOURCES_MALFORMED as gn, errorCauseChain as gr, beginCommandInterruptScope as gt, IMPLICIT_DELETE_DEPENDENCIES as h, clearBucketRegionCache as ha, describeDockerExecFailure as hi, INTRINSIC_KEYS as hn, dynamicReferenceTokens as hr, maskerOrIdentity as ht, DeploymentEventsReader as i, failedStageNote as ia, getBootstrapMarkerKey as ii, s3BucketArn as in, findSilentDropProperties as ir, secretBearing as it, isFinalSnapshotError as j, LocalStartServiceError as ja, getLegacyStateBucketName as ji, malformedOutputsWarning as jn, buildLockContentionMessage as jr, carriesFetchableDynamicReference as jt, ccRoutedFinalSnapshotError as k, IntrinsicResolutionRefusalError as ka, synthesisStatusMessage as ki, malformedOrphansWarning as kn, UNREPRODUCIBLE_LOCK_CLAUSE as kr, IntrinsicFunctionResolver as kt, replayRollback as l, hasPlainPrototype$1 as la, validateContainerRepoName as li, applyRoleArnIfSet as ln, STATE_SOURCED_BASELINE_RULES as lr, collectInlinePolicyNamesManagedBySiblings as lt, maskingRetryLogger as m, resolveAssemblyPath as ma, describeDockerCapturedOutput as mi, DiffCalculator as mn, createSecretMasker as mr, maskDeep as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, derivePartitionAndUrlSuffix as na, assertAssetBucketRegion as ni, producerRegionsFromState as nn, __exportAll as no, safeStackName as nr, exportAliasCollisionScrubWarning as nt, planFailedOps as o, processStackMessages as oa, parseBootstrapMarker as oi, s3BucketDualStackDomainName as on, withRetry as or, secretSafeKeyDisplay as ot, withResourceDeadline as p, renderAssemblyPathEscape as pa, warnManifestExecutable as pi, envCredentialsAreAssumedRole as pn, carriesSecretMask as pr, createMaskedRetryLogger as pt, formatResourceLine as q, isMarkedNonRetryable as qa, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as qi, refuseMalformedResourcePropertiesForOrphan as qn, AssetPublisher as qr, configBooleanRefusal as qt, DeployEngine as r, AssemblyReader as ra, ensureAssetStorage as ri, withSharedDrainBudget as rn, findActionableSilentDrops as rr, isExportAliasCollision as rt, planRollback as s, defineOwnKey as sa, readBootstrapMarkerBody as si, s3BucketRegionalDomainName as sn, DagBuilder as sr, getCurrentResourceSecrets as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, canonicalizeRegion as ta, BOOTSTRAP_MARKER_PREFIX as ti, classifyReplaySecretRegion as tn, safeStringify$1 as to, safeRegion as tr, collectPublishedOutputNames as tt, resolveReplacementOldType as u, nullPrototypeRecord as ua, buildDenyExternalAccessPolicy as ui, AWS_CREDENTIAL_ENV_KEYS as un, STATE_SOURCED_CROSS_GENERATION_RULES as ur, clearOnUpdateRemoval as ut, isSecretBearingReferenceString as v, getAwsClients as va, formatDockerLoginError as vi, UNREADABLE_RESOURCES_MAP_ROW as vn, isSingleDynamicReferenceToken as vr, interruptWatchListenerCount as vt, reachableDivergentParameters as w, ConfigError as wa, escapeRegExp$1 as wi, malformedExportNamesWarning as wn, redactSecretsForState as wr, UNSPECIFIED_SKIP_REASON as wt, bindingSkippedOutputs as x, setAwsClients as xa, redactDockerArgvValues as xi, hasReadableOutputs as xn, maskSecretsInText as xr, CloudControlProvider as xt, keptWholeReasonText as y, resetAwsClients as ya, getDockerCmd as yi, displayLogicalId as yn, markSameGenerationBag as yr, isInterruptedWaitError as yt, isStatefulRecreateTargetForReplace as z, StackHasActiveImportsError as za, stateBucketExistenceConfirmed as zi, refuseMalformedOrphans as zn, hasReasonlessBaselineRefusal as zr, refStateLookupFromResource as zt };
|
|
50841
|
+
//# sourceMappingURL=deploy-engine-BrGb93QQ.js.map
|