@cdkd/cli 0.358.7 → 0.359.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ambient-client-defaults-DvXDYfs8.js → ambient-client-defaults-BNqC0q-Z.js} +3 -3
- package/dist/{ambient-client-defaults-DvXDYfs8.js.map → ambient-client-defaults-BNqC0q-Z.js.map} +1 -1
- package/dist/{asg-provider-BReZap7O.js → asg-provider-BDCUGWZV.js} +6 -6
- package/dist/{asg-provider-BReZap7O.js.map → asg-provider-BDCUGWZV.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{custom-resource-runtime-CpziCILQ.js → custom-resource-runtime-DMkX_oQo.js} +6 -6
- package/dist/{custom-resource-runtime-CpziCILQ.js.map → custom-resource-runtime-DMkX_oQo.js.map} +1 -1
- package/dist/{db-associated-roles-DTMCw2Ka.js → db-associated-roles-Bx5ML-MI.js} +2 -2
- package/dist/{db-associated-roles-DTMCw2Ka.js.map → db-associated-roles-Bx5ML-MI.js.map} +1 -1
- package/dist/{delete-started-DNc0CPAc.js → delete-started-V5NHQ1O-.js} +4 -4
- package/dist/{delete-started-DNc0CPAc.js.map → delete-started-V5NHQ1O-.js.map} +1 -1
- package/dist/{deploy-engine-Db00WvIx.js → deploy-engine-BjSv27_M.js} +2025 -859
- package/dist/deploy-engine-BjSv27_M.js.map +1 -0
- package/dist/{ec2-termination-protection-Gf-1-VVU.js → ec2-termination-protection-hc3MeuqF.js} +11 -7
- package/dist/ec2-termination-protection-hc3MeuqF.js.map +1 -0
- package/dist/{ecr-uri-zC_A2VLB.js → ecr-uri-D1ijxg7D.js} +2 -2
- package/dist/{ecr-uri-zC_A2VLB.js.map → ecr-uri-D1ijxg7D.js.map} +1 -1
- package/dist/{expected-bucket-owner-Am4J3ano.js → expected-bucket-owner-CQimj8gv.js} +2 -2
- package/dist/{expected-bucket-owner-Am4J3ano.js.map → expected-bucket-owner-CQimj8gv.js.map} +1 -1
- package/dist/{iam-role-provider-BisBYgT3.js → iam-role-provider-b46RdZD5.js} +27 -13
- package/dist/iam-role-provider-b46RdZD5.js.map +1 -0
- package/dist/{image-plan-CNMyGwzi.js → image-plan-DtFbiJj5.js} +8 -8
- package/dist/{image-plan-CNMyGwzi.js.map → image-plan-DtFbiJj5.js.map} +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-BZmINj0f.js → logger-CqKPJ_tV.js} +2 -2
- package/dist/{logger-BZmINj0f.js.map → logger-CqKPJ_tV.js.map} +1 -1
- package/dist/{neptune-provider-DM4GhUTb.js → neptune-provider-DiyWADaS.js} +7 -7
- package/dist/{neptune-provider-DM4GhUTb.js.map → neptune-provider-DiyWADaS.js.map} +1 -1
- package/dist/{program-CCtcOCaP.js → program-Cdwgr3Yv.js} +626 -40
- package/dist/program-Cdwgr3Yv.js.map +1 -0
- package/dist/{provider-classes-CgZzBNg8.js → provider-classes-DhmwW7hI.js} +465 -391
- package/dist/provider-classes-DhmwW7hI.js.map +1 -0
- package/dist/{rds-provider-Cef0DBFH.js → rds-provider-DpOZv_UG.js} +10 -10
- package/dist/{rds-provider-Cef0DBFH.js.map → rds-provider-DpOZv_UG.js.map} +1 -1
- package/dist/{read-replica-DCjUkLOl.js → read-replica-Ct0oakPU.js} +3 -3
- package/dist/{read-replica-DCjUkLOl.js.map → read-replica-Ct0oakPU.js.map} +1 -1
- package/dist/{replacement-rules-iQkausbv.js → replacement-rules-CMnMy7rf.js} +3 -3
- package/dist/{replacement-rules-iQkausbv.js.map → replacement-rules-CMnMy7rf.js.map} +1 -1
- package/dist/{resource-deadline-6tnCx6Yj.js → resource-deadline-DlZTHrBj.js} +123 -122
- package/dist/resource-deadline-DlZTHrBj.js.map +1 -0
- package/dist/{restore-source-guard-Dj_CS7r6.js → restore-source-guard-DIs6rqZm.js} +4 -4
- package/dist/{restore-source-guard-Dj_CS7r6.js.map → restore-source-guard-DIs6rqZm.js.map} +1 -1
- package/dist/{run-cli-Db8hPv4V.js → run-cli-BLZnjA32.js} +2 -2
- package/dist/{run-cli-Db8hPv4V.js.map → run-cli-BLZnjA32.js.map} +1 -1
- package/dist/{settle-own-write-members-CXG2uUvJ.js → settle-own-write-members-C1uPhq2z.js} +49 -304
- package/dist/settle-own-write-members-C1uPhq2z.js.map +1 -0
- package/dist/{version-DSeV-Tyv.js → version-DyE_oClc.js} +2 -2
- package/dist/{version-DSeV-Tyv.js.map → version-DyE_oClc.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-Db00WvIx.js.map +0 -1
- package/dist/ec2-termination-protection-Gf-1-VVU.js.map +0 -1
- package/dist/iam-role-provider-BisBYgT3.js.map +0 -1
- package/dist/program-CCtcOCaP.js.map +0 -1
- package/dist/provider-classes-CgZzBNg8.js.map +0 -1
- package/dist/resource-deadline-6tnCx6Yj.js.map +0 -1
- package/dist/settle-own-write-members-CXG2uUvJ.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, O as displayIdent, P as safeMsg, _ as shellQuote, k as displaySafe, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, r as SHELL_ACTIVE, w as UNRENDERABLE } from "./version-
|
|
2
|
-
import {
|
|
3
|
-
import { $ as AssetError,
|
|
1
|
+
import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, O as displayIdent, P as safeMsg, _ as shellQuote, k as displaySafe, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, r as SHELL_ACTIVE, w as UNRENDERABLE } from "./version-DyE_oClc.js";
|
|
2
|
+
import { _ as currentLogLineMasker, l as describeAwsErrorDiagnostics, m as verboseAwareText, n as getLogger, p as safeStringify$1, r as isStdoutReservedForPayload, u as describeAwsFailure } from "./logger-CqKPJ_tV.js";
|
|
3
|
+
import { $ as AssetError, G as markRedactedCause, ct as SynthesisError, d as MacroExpansionError, et as CdkdError, it as LockError, k as escapeRegExp, lt as isSoftAbort, nt as DeploymentNotApprovedError, p as DependencyError, st as StateError, t as ambientClientDefaults } from "./ambient-client-defaults-BNqC0q-Z.js";
|
|
4
4
|
import { n as awsClientDefaults, r as awsEndpointOverrideActive } from "./aws-client-defaults-DAebi99J.js";
|
|
5
5
|
import { l as s3ClientDefaults } from "./aws-clients-DOkPjjAW.js";
|
|
6
|
-
import { $
|
|
7
|
-
import {
|
|
6
|
+
import { $s as siblingsOf, Au as isDefaultBootstrapBucketName, Bs as referenceTokensIn, Bu as resolveFileAssetSourcePath, Hc as refuseMalformedResourceEntriesForDeploy, Hu as warnWholeAssemblyAsSource, Ja as settleDeclaredMember, Js as namesRecreatedParent, Ka as policyDocumentMatchesDeclared, Ls as recordedProvenanceOf, Ms as extractGetAttRefs, Mu as loadPublishableAssetManifest, Ns as promoteInPlaceAttributeDependents, Nu as redirectDockerAsset, Ou as createLazyAssetModeContext, Pu as redirectFileAsset, Qs as replacementSidesForLog, Ru as isCfnTemplateAssetPath, Su as purgeNoncurrentKeyVersions, Ts as AWS_NO_VALUE, Ul as withoutUnwrittenSdkUnwiredProperties, Vl as withoutAcceptedSdkUnwiredProperties, Vu as warnAbsoluteAssetPath, Xl as isKnownTokenFreeState, Xs as containsIntrinsic, Ys as INTRINSIC_KEYS, Zc as refuseMalformedResourceProperties, Zs as markNewValueKnownAfterDeploy, _c as movedMaskedProperties, ad as nullPrototypeRecord, bu as ssmResolvedValueType, cd as assemblyPathEscape, dd as namesTheSameDirectory, du as stringifyValue, ed as getCdkdAssetBucketName, eu as rebuildClientForBucketRegion, fd as renderAssemblyPathEscape, fu as missingStateBucketRemedy, hc as inputFingerprinter, hd as resolveBucketRegion, hu as listNestedTemplateRows, ju as isDefaultBootstrapRepoName, ku as flattenAssetPlaceholders, ld as describeFileReadFailure, mc as tryGetTopLevelWriteOnlyProperties, nd as defineOwnKey, pd as resolveAssemblyPath, ql as TemplateParser, sd as absoluteAssemblyPathEscape, tc as isPlainReferenceTo, td as getCdkdContainerRepoName, ud as displayAssemblyPath, vu as SSM_PARAMETER_VALUE_PREFIX, wu as rememberSynthesizedStacks, yu as isListParameterType, zs as referenceProvenanceOf, zu as parseAssetManifestBody } from "./deploy-engine-BjSv27_M.js";
|
|
7
|
+
import { F as changedTriggers, J as parseFailureDebugDetail, K as describeJsonParseFailure, P as REPLACEMENT_TRIGGER_PROPERTIES, R as willReplaceGroup, X as utf8ByteLength, b as createOnlyChangeRequiresReplacement, q as jsonParseFailureStandIn, x as getCreateOnlyPropertyPaths } from "./ec2-termination-protection-hc3MeuqF.js";
|
|
8
8
|
import { r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
|
|
9
|
-
import { Ut as maskerOrIdentity, _n as
|
|
10
|
-
import { t as expectedOwnerParam } from "./expected-bucket-owner-
|
|
11
|
-
import { _t as acceptedCreateOnlyDropsOf } from "./delete-started-
|
|
12
|
-
import { pn as splitGetAttStringForm, t as ReplacementRulesRegistry } from "./replacement-rules-
|
|
13
|
-
import { S as unsettledPropertiesOf } from "./restore-source-guard-
|
|
9
|
+
import { Ut as maskerOrIdentity, _n as withPasteableAwsProfile, cn as formatLockOperation, in as buildForceUnlockCommand, ln as formatLockOwner, rn as UNREPRODUCIBLE_LOCK_CLAUSE, sn as formatLockExpiry, vn as injectiveKey } from "./resource-deadline-DlZTHrBj.js";
|
|
10
|
+
import { t as expectedOwnerParam } from "./expected-bucket-owner-CQimj8gv.js";
|
|
11
|
+
import { _t as acceptedCreateOnlyDropsOf } from "./delete-started-V5NHQ1O-.js";
|
|
12
|
+
import { pn as splitGetAttStringForm, t as ReplacementRulesRegistry } from "./replacement-rules-CMnMy7rf.js";
|
|
13
|
+
import { S as unsettledPropertiesOf } from "./restore-source-guard-DIs6rqZm.js";
|
|
14
14
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
15
15
|
import { AbortMultipartUploadCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand, NoSuchKey, PutObjectCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
16
16
|
import { CloudControlClient, GetResourceCommand, ListResourcesCommand } from "@aws-sdk/client-cloudcontrol";
|
|
@@ -2017,7 +2017,7 @@ async function resolveStateBucketWithDefaultAndSource(cliBucket, region, legacyF
|
|
|
2017
2017
|
const { GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
|
|
2018
2018
|
const { S3Client, HeadBucketCommand, ListObjectsV2Command } = await import("@aws-sdk/client-s3");
|
|
2019
2019
|
const { getAwsClients } = await import("./aws-clients-DOkPjjAW.js").then((n) => n.n);
|
|
2020
|
-
const { expectedOwnerParam, recordResolvedAccountId } = await import("./expected-bucket-owner-
|
|
2020
|
+
const { expectedOwnerParam, recordResolvedAccountId } = await import("./expected-bucket-owner-CQimj8gv.js").then((n) => n.n);
|
|
2021
2021
|
const probeDeps = {
|
|
2022
2022
|
HeadBucketCommand,
|
|
2023
2023
|
ListObjectsV2Command,
|
|
@@ -3416,10 +3416,10 @@ function refuseDockerAssetUnderAwsEmulator(assetName) {
|
|
|
3416
3416
|
function ecrUrlSuffix(region) {
|
|
3417
3417
|
return derivePartitionAndUrlSuffix(region).urlSuffix;
|
|
3418
3418
|
}
|
|
3419
|
-
const ACCOUNT_ID
|
|
3419
|
+
const ACCOUNT_ID = /^\d{12}$/;
|
|
3420
3420
|
const REGION_LABEL = /^[A-Za-z0-9][A-Za-z0-9-]*$/;
|
|
3421
3421
|
function ecrRegistryHost(accountId, region) {
|
|
3422
|
-
if (typeof accountId !== "string" || !ACCOUNT_ID
|
|
3422
|
+
if (typeof accountId !== "string" || !ACCOUNT_ID.test(accountId)) throw new AssetError(`Refusing to publish a Docker image asset: ${displayIdent(accountId)} is not a 12-digit AWS account id`);
|
|
3423
3423
|
if (typeof region !== "string" || region.length > 63 || !REGION_LABEL.test(region)) throw new AssetError(`Refusing to publish a Docker image asset: the destination region ${displayIdent(region)} is not a valid AWS region id`);
|
|
3424
3424
|
return `${accountId}.dkr.ecr.${region}.${ecrUrlSuffix(region)}`;
|
|
3425
3425
|
}
|
|
@@ -4861,12 +4861,43 @@ function recordedSubscriptionAttributes(recorded) {
|
|
|
4861
4861
|
return attributes;
|
|
4862
4862
|
}
|
|
4863
4863
|
|
|
4864
|
+
// src/provisioning/providers/route53/record-name.ts
|
|
4865
|
+
const UNDECODABLE_OCTAL_ESCAPES = /* @__PURE__ */ new Set(["056", "134"]);
|
|
4866
|
+
function normalizeRecordName(name) {
|
|
4867
|
+
const lowered = name.replace(/\\([0-7]{3})/g, (match, oct) => UNDECODABLE_OCTAL_ESCAPES.has(oct) ? match : String.fromCharCode(parseInt(oct, 8))).toLowerCase();
|
|
4868
|
+
return lowered.endsWith(".") ? lowered : `${lowered}.`;
|
|
4869
|
+
}
|
|
4870
|
+
|
|
4864
4871
|
// src/analyzer/diff-calculator/provider-replacement.ts
|
|
4872
|
+
const snsSubscriptionReplacement = (recorded, desired) => {
|
|
4873
|
+
const plan = planSubscriptionAttributes(recordedSubscriptionAttributes(recorded), desired);
|
|
4874
|
+
return plan.kind === "replace" ? plan.reason : void 0;
|
|
4875
|
+
};
|
|
4876
|
+
const recordSetRenameReplacement = (recorded, desired) => {
|
|
4877
|
+
const comparable = (value) => typeof value === "string" && value !== "" && !value.includes("{{resolve:");
|
|
4878
|
+
const [prevName, name] = [recorded["Name"], desired["Name"]];
|
|
4879
|
+
if (!comparable(prevName) || !comparable(name)) return void 0;
|
|
4880
|
+
if (!comparable(recorded["Type"]) || !comparable(desired["Type"])) return void 0;
|
|
4881
|
+
return normalizeRecordName(prevName) !== normalizeRecordName(name) ? "its Name changed, and Route 53 keys a record on its name" : void 0;
|
|
4882
|
+
};
|
|
4883
|
+
const PROVIDER_REPLACEMENT_PLANNERS = /* @__PURE__ */ new Map([["AWS::SNS::Subscription", {
|
|
4884
|
+
properties: [
|
|
4885
|
+
"DeliveryPolicy",
|
|
4886
|
+
"FilterPolicy",
|
|
4887
|
+
"FilterPolicyScope",
|
|
4888
|
+
"ReplayPolicy",
|
|
4889
|
+
"SubscriptionRoleArn"
|
|
4890
|
+
],
|
|
4891
|
+
plan: snsSubscriptionReplacement
|
|
4892
|
+
}], ["AWS::Route53::RecordSet", {
|
|
4893
|
+
properties: ["Name"],
|
|
4894
|
+
plan: recordSetRenameReplacement
|
|
4895
|
+
}]]);
|
|
4865
4896
|
function providerReplacementReason(resourceType, record, desired) {
|
|
4866
|
-
|
|
4897
|
+
const entry = PROVIDER_REPLACEMENT_PLANNERS.get(resourceType);
|
|
4898
|
+
if (entry === void 0) return void 0;
|
|
4867
4899
|
if (record.resourceType !== resourceType || record.provisionedBy === "cc-api") return void 0;
|
|
4868
|
-
|
|
4869
|
-
return plan.kind === "replace" ? plan.reason : void 0;
|
|
4900
|
+
return entry.plan(record.properties ?? {}, desired);
|
|
4870
4901
|
}
|
|
4871
4902
|
function dropSupersededProviderReplacements(changes) {
|
|
4872
4903
|
for (const change of changes.values()) {
|
|
@@ -5502,292 +5533,6 @@ var DiffCalculator = class {
|
|
|
5502
5533
|
}
|
|
5503
5534
|
};
|
|
5504
5535
|
|
|
5505
|
-
// src/provisioning/policy-document-content.ts
|
|
5506
|
-
const MASK = "***";
|
|
5507
|
-
const PERMANENT_CDKD_CODES = /* @__PURE__ */ new Set(["ROLLBACK_SECRET_TOKEN_SCAN_MISMATCH"]);
|
|
5508
|
-
const MARKED_PERMANENT_CODE_PREFIXES = ["INTRINSIC_RESOLUTION_REFUSAL", "ROLLBACK_SECRET_REGION_AMBIGUOUS"];
|
|
5509
|
-
const NOT_FOUND_ERROR_NAMES = /* @__PURE__ */ new Set([
|
|
5510
|
-
"ResourceNotFoundException",
|
|
5511
|
-
"ParameterNotFound",
|
|
5512
|
-
"ParameterVersionNotFound"
|
|
5513
|
-
]);
|
|
5514
|
-
function holdsUnresolvedValue(document) {
|
|
5515
|
-
let root = document;
|
|
5516
|
-
if (typeof document === "string") try {
|
|
5517
|
-
root = JSON.parse(document);
|
|
5518
|
-
} catch {
|
|
5519
|
-
root = document;
|
|
5520
|
-
}
|
|
5521
|
-
const walk = (v) => {
|
|
5522
|
-
if (typeof v === "string") return v === MASK || v.includes("{{resolve:");
|
|
5523
|
-
if (Array.isArray(v)) return v.some(walk);
|
|
5524
|
-
if (v !== null && typeof v === "object") return Object.values(v).some(walk);
|
|
5525
|
-
return false;
|
|
5526
|
-
};
|
|
5527
|
-
return walk(root);
|
|
5528
|
-
}
|
|
5529
|
-
function isPermanentResolutionError(error) {
|
|
5530
|
-
let current = error;
|
|
5531
|
-
for (let depth = 0; depth < 5 && current != null; depth++) {
|
|
5532
|
-
const e = current;
|
|
5533
|
-
if (typeof e.name === "string" && NOT_FOUND_ERROR_NAMES.has(e.name)) return true;
|
|
5534
|
-
if (typeof e.code === "string") {
|
|
5535
|
-
if (PERMANENT_CDKD_CODES.has(e.code)) return true;
|
|
5536
|
-
const code = e.code;
|
|
5537
|
-
if (MARKED_PERMANENT_CODE_PREFIXES.some((p) => code.startsWith(p)) && isMarkedNonRetryable(current)) return true;
|
|
5538
|
-
}
|
|
5539
|
-
if (typeof e.message === "string" && e.message.startsWith("Dynamic reference: ")) return true;
|
|
5540
|
-
current = e.cause;
|
|
5541
|
-
}
|
|
5542
|
-
return false;
|
|
5543
|
-
}
|
|
5544
|
-
function errorName(error) {
|
|
5545
|
-
const name = error?.name;
|
|
5546
|
-
return typeof name === "string" && /^[\w.-]{1,128}$/.test(name) ? name : "error";
|
|
5547
|
-
}
|
|
5548
|
-
async function attemptedPolicyDocument(recorded, resolve) {
|
|
5549
|
-
let document = recorded;
|
|
5550
|
-
if (resolve) try {
|
|
5551
|
-
document = await resolve();
|
|
5552
|
-
} catch (error) {
|
|
5553
|
-
return isPermanentResolutionError(error) ? {
|
|
5554
|
-
kind: "unusable",
|
|
5555
|
-
why: "a secret it references does not exist or cannot be used"
|
|
5556
|
-
} : {
|
|
5557
|
-
kind: "retry",
|
|
5558
|
-
errorName: errorName(error)
|
|
5559
|
-
};
|
|
5560
|
-
}
|
|
5561
|
-
if (!(typeof document === "string" && document.length > 0 || document !== null && typeof document === "object")) return {
|
|
5562
|
-
kind: "unusable",
|
|
5563
|
-
why: "no policy document it attempted is recorded"
|
|
5564
|
-
};
|
|
5565
|
-
if (holdsUnresolvedValue(document)) return {
|
|
5566
|
-
kind: "unusable",
|
|
5567
|
-
why: "its policy document still holds a secret reference or masked value"
|
|
5568
|
-
};
|
|
5569
|
-
return {
|
|
5570
|
-
kind: "document",
|
|
5571
|
-
document
|
|
5572
|
-
};
|
|
5573
|
-
}
|
|
5574
|
-
const ACCOUNT_ID = /^\d{12}$/;
|
|
5575
|
-
const ACCOUNT_ROOT_ARN = /^arn:[a-z-]+:iam::(\d{12}):root$/;
|
|
5576
|
-
const LIST_KEYS = [
|
|
5577
|
-
"Action",
|
|
5578
|
-
"NotAction",
|
|
5579
|
-
"Resource",
|
|
5580
|
-
"NotResource"
|
|
5581
|
-
];
|
|
5582
|
-
const PRINCIPAL_KEYS = ["Principal", "NotPrincipal"];
|
|
5583
|
-
function unwrapSingle(value) {
|
|
5584
|
-
return Array.isArray(value) && value.length === 1 ? value[0] : value;
|
|
5585
|
-
}
|
|
5586
|
-
function accountKey(value) {
|
|
5587
|
-
if (typeof value !== "string") return value;
|
|
5588
|
-
if (ACCOUNT_ID.test(value)) return `account:${value}`;
|
|
5589
|
-
const m = ACCOUNT_ROOT_ARN.exec(value);
|
|
5590
|
-
return m ? `account:${m[1]}` : value;
|
|
5591
|
-
}
|
|
5592
|
-
const ANYONE = "anyone:*";
|
|
5593
|
-
function normalizePrincipal(principal) {
|
|
5594
|
-
if (principal === "*") return ANYONE;
|
|
5595
|
-
if (principal === null || typeof principal !== "object" || Array.isArray(principal)) return principal;
|
|
5596
|
-
const keys = Object.keys(principal);
|
|
5597
|
-
if (keys.length === 1 && keys[0] === "AWS" && unwrapSingle(principal["AWS"]) === "*") return ANYONE;
|
|
5598
|
-
const out = {};
|
|
5599
|
-
for (const [key, raw] of Object.entries(principal)) out[key] = unwrapSingle(key === "AWS" ? Array.isArray(raw) ? raw.map(accountKey) : accountKey(raw) : raw);
|
|
5600
|
-
return out;
|
|
5601
|
-
}
|
|
5602
|
-
function normalizeStatement(statement) {
|
|
5603
|
-
if (statement === null || typeof statement !== "object" || Array.isArray(statement)) return statement;
|
|
5604
|
-
const out = { ...statement };
|
|
5605
|
-
for (const key of LIST_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = unwrapSingle(out[key]);
|
|
5606
|
-
for (const key of PRINCIPAL_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = normalizePrincipal(out[key]);
|
|
5607
|
-
return out;
|
|
5608
|
-
}
|
|
5609
|
-
function canonicalJson(value) {
|
|
5610
|
-
const sortKeys = (v) => {
|
|
5611
|
-
if (Array.isArray(v)) return v.map(sortKeys);
|
|
5612
|
-
if (v !== null && typeof v === "object") {
|
|
5613
|
-
const out = Object.create(null);
|
|
5614
|
-
for (const key of Object.keys(v).sort()) out[key] = sortKeys(v[key]);
|
|
5615
|
-
return out;
|
|
5616
|
-
}
|
|
5617
|
-
return v;
|
|
5618
|
-
};
|
|
5619
|
-
return JSON.stringify(sortKeys(value));
|
|
5620
|
-
}
|
|
5621
|
-
function policyContentKey(document) {
|
|
5622
|
-
let value = document;
|
|
5623
|
-
if (typeof document === "string") try {
|
|
5624
|
-
value = JSON.parse(document);
|
|
5625
|
-
} catch {
|
|
5626
|
-
return `raw:${document}`;
|
|
5627
|
-
}
|
|
5628
|
-
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
5629
|
-
const doc = { ...value };
|
|
5630
|
-
if (Object.prototype.hasOwnProperty.call(doc, "Statement")) doc["Statement"] = (Array.isArray(doc["Statement"]) ? doc["Statement"] : [doc["Statement"]]).map(normalizeStatement);
|
|
5631
|
-
value = doc;
|
|
5632
|
-
}
|
|
5633
|
-
return canonicalJson(value);
|
|
5634
|
-
}
|
|
5635
|
-
|
|
5636
|
-
// src/provisioning/settle-after-own-write.ts
|
|
5637
|
-
const OWN_WRITE_REREAD_DELAYS_MS = [
|
|
5638
|
-
500,
|
|
5639
|
-
1e3,
|
|
5640
|
-
2e3
|
|
5641
|
-
];
|
|
5642
|
-
async function reReadUntilSettled(read, settled, delaysMs) {
|
|
5643
|
-
let answer = await read();
|
|
5644
|
-
for (const delayMs of delaysMs) {
|
|
5645
|
-
if (settled(answer)) return {
|
|
5646
|
-
answer,
|
|
5647
|
-
settled: true
|
|
5648
|
-
};
|
|
5649
|
-
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
5650
|
-
answer = await read();
|
|
5651
|
-
}
|
|
5652
|
-
return {
|
|
5653
|
-
answer,
|
|
5654
|
-
settled: settled(answer)
|
|
5655
|
-
};
|
|
5656
|
-
}
|
|
5657
|
-
function memberReadFailure(err) {
|
|
5658
|
-
return isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) ? "failed" : "refused";
|
|
5659
|
-
}
|
|
5660
|
-
async function settleDeclaredMember(first, read, matches, declared, delaysMs, unsettled) {
|
|
5661
|
-
const settled = (answer) => typeof answer === "object" && matches(answer.value);
|
|
5662
|
-
if (first === "refused" || settled(first)) return first;
|
|
5663
|
-
let newest = first;
|
|
5664
|
-
for (const delayMs of delaysMs) {
|
|
5665
|
-
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
5666
|
-
let answer;
|
|
5667
|
-
try {
|
|
5668
|
-
answer = await read();
|
|
5669
|
-
} catch (err) {
|
|
5670
|
-
answer = memberReadFailure(err);
|
|
5671
|
-
}
|
|
5672
|
-
if (answer === "refused") break;
|
|
5673
|
-
if (answer !== "failed") newest = answer;
|
|
5674
|
-
if (settled(newest)) return newest;
|
|
5675
|
-
}
|
|
5676
|
-
if (newest !== "failed") unsettled();
|
|
5677
|
-
return newest === "absent" ? { value: declared } : newest;
|
|
5678
|
-
}
|
|
5679
|
-
function warnUnsettledMember(logger, logicalId, resourceType, memberKey) {
|
|
5680
|
-
logger.warn(safeMsg`${resourceType} ${logicalId}: the read right after the write never showed the declared ${memberKey}, so its drift baseline may not match the live resource; run ${proseQuoted(cdkdRemedy("cdkd state refresh-observed"))} on the stack to re-capture it`);
|
|
5681
|
-
}
|
|
5682
|
-
function declaredMemberDocument(value) {
|
|
5683
|
-
if (typeof value === "string") {
|
|
5684
|
-
if (value === "") return void 0;
|
|
5685
|
-
try {
|
|
5686
|
-
return JSON.parse(value);
|
|
5687
|
-
} catch {
|
|
5688
|
-
return value;
|
|
5689
|
-
}
|
|
5690
|
-
}
|
|
5691
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
5692
|
-
}
|
|
5693
|
-
const KMS_DEFAULT_KEY_POLICY_ID = "key-default-1";
|
|
5694
|
-
const EFS_FILE_SYSTEM_ARN = /^arn:[a-z-]+:elasticfilesystem:[a-z0-9-]+:\d{12}:file-system\/fs-[0-9a-f]+$/;
|
|
5695
|
-
function efsPolicyMatchesDeclared(answer, declared, fileSystemId) {
|
|
5696
|
-
return policyDocumentMatchesDeclared(withoutAddedResource(answer, declared, fileSystemId), declared);
|
|
5697
|
-
}
|
|
5698
|
-
function withoutAddedResource(answer, declared, fileSystemId) {
|
|
5699
|
-
const parse = (doc) => {
|
|
5700
|
-
if (typeof doc !== "string") return doc;
|
|
5701
|
-
try {
|
|
5702
|
-
return JSON.parse(doc);
|
|
5703
|
-
} catch {
|
|
5704
|
-
return doc;
|
|
5705
|
-
}
|
|
5706
|
-
};
|
|
5707
|
-
const read = parse(answer);
|
|
5708
|
-
const want = parse(declared);
|
|
5709
|
-
const statements = (doc) => {
|
|
5710
|
-
if (typeof doc !== "object" || doc === null || Array.isArray(doc)) return void 0;
|
|
5711
|
-
const s = doc["Statement"];
|
|
5712
|
-
return s === void 0 ? void 0 : Array.isArray(s) ? s : [s];
|
|
5713
|
-
};
|
|
5714
|
-
const readStatements = statements(read);
|
|
5715
|
-
const wantStatements = statements(want);
|
|
5716
|
-
if (readStatements === void 0 || wantStatements === void 0) return answer;
|
|
5717
|
-
return {
|
|
5718
|
-
...read,
|
|
5719
|
-
Statement: readStatements.map((entry, index) => {
|
|
5720
|
-
const wanted = wantStatements[index];
|
|
5721
|
-
if (typeof entry !== "object" || entry === null || typeof wanted !== "object" || wanted === null || Object.prototype.hasOwnProperty.call(wanted, "Resource")) return entry;
|
|
5722
|
-
const resource = entry["Resource"];
|
|
5723
|
-
if (typeof resource !== "string" || !EFS_FILE_SYSTEM_ARN.test(resource) || fileSystemId !== void 0 && !resource.endsWith(`:file-system/${fileSystemId}`)) return entry;
|
|
5724
|
-
const { Resource: _added, ...rest } = entry;
|
|
5725
|
-
return rest;
|
|
5726
|
-
})
|
|
5727
|
-
};
|
|
5728
|
-
}
|
|
5729
|
-
function declaredPolicyDocument(properties) {
|
|
5730
|
-
if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return;
|
|
5731
|
-
const doc = properties["PolicyDocument"];
|
|
5732
|
-
if (typeof doc === "string") return doc === "" ? void 0 : doc;
|
|
5733
|
-
return typeof doc === "object" && doc !== null && !Array.isArray(doc) ? doc : void 0;
|
|
5734
|
-
}
|
|
5735
|
-
function policyDocumentMatchesDeclared(answer, declared) {
|
|
5736
|
-
return answer !== void 0 && policyContentKey(foldConditionValues(answer)) === policyContentKey(foldConditionValues(declared));
|
|
5737
|
-
}
|
|
5738
|
-
function foldConditionValues(document) {
|
|
5739
|
-
let doc = document;
|
|
5740
|
-
if (typeof doc === "string") try {
|
|
5741
|
-
doc = JSON.parse(doc);
|
|
5742
|
-
} catch {
|
|
5743
|
-
return document;
|
|
5744
|
-
}
|
|
5745
|
-
if (typeof doc !== "object" || doc === null || Array.isArray(doc)) return doc;
|
|
5746
|
-
const statement = doc["Statement"];
|
|
5747
|
-
if (statement === void 0) return doc;
|
|
5748
|
-
const statements = Array.isArray(statement) ? statement : [statement];
|
|
5749
|
-
return {
|
|
5750
|
-
...doc,
|
|
5751
|
-
Statement: statements.map((entry) => {
|
|
5752
|
-
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return entry;
|
|
5753
|
-
const condition = entry["Condition"];
|
|
5754
|
-
if (typeof condition !== "object" || condition === null || Array.isArray(condition)) return entry;
|
|
5755
|
-
const folded = {};
|
|
5756
|
-
for (const [operator, block] of Object.entries(condition)) {
|
|
5757
|
-
if (typeof block !== "object" || block === null || Array.isArray(block)) {
|
|
5758
|
-
folded[operator] = block;
|
|
5759
|
-
continue;
|
|
5760
|
-
}
|
|
5761
|
-
const values = {};
|
|
5762
|
-
for (const [key, value] of Object.entries(block)) values[key] = Array.isArray(value) && value.length === 1 ? value[0] : value;
|
|
5763
|
-
folded[operator] = values;
|
|
5764
|
-
}
|
|
5765
|
-
return {
|
|
5766
|
-
...entry,
|
|
5767
|
-
Condition: folded
|
|
5768
|
-
};
|
|
5769
|
-
})
|
|
5770
|
-
};
|
|
5771
|
-
}
|
|
5772
|
-
const SNS_DEFAULT_POLICY_ID = "__default_policy_ID";
|
|
5773
|
-
const LAMBDA_PERMISSION_STATEMENT_KEYS = [
|
|
5774
|
-
"Action",
|
|
5775
|
-
"Principal",
|
|
5776
|
-
"SourceArn",
|
|
5777
|
-
"SourceAccount",
|
|
5778
|
-
"PrincipalOrgID",
|
|
5779
|
-
"InvokedViaFunctionUrl"
|
|
5780
|
-
];
|
|
5781
|
-
function lambdaPermissionMatchesDeclared(read, declared) {
|
|
5782
|
-
return LAMBDA_PERMISSION_STATEMENT_KEYS.every((key) => {
|
|
5783
|
-
if (key === "InvokedViaFunctionUrl") return read[key] === true === (coerceCfnBoolean(declared[key]) === true);
|
|
5784
|
-
const want = declared[key];
|
|
5785
|
-
const got = read[key];
|
|
5786
|
-
if (want === void 0 || want === null || want === "") return got === void 0;
|
|
5787
|
-
return key === "Principal" ? accountKey(got) === accountKey(want) : got === want;
|
|
5788
|
-
});
|
|
5789
|
-
}
|
|
5790
|
-
|
|
5791
5536
|
// src/provisioning/settle-own-write-members.ts
|
|
5792
5537
|
async function settleOwnWriteMembers(result, members, delaysMs, unsettled) {
|
|
5793
5538
|
await Promise.all(members.map(async (member) => {
|
|
@@ -5902,5 +5647,5 @@ function principalOwnWriteMembers(properties, reads) {
|
|
|
5902
5647
|
return members;
|
|
5903
5648
|
}
|
|
5904
5649
|
|
|
5905
|
-
export {
|
|
5906
|
-
//# sourceMappingURL=settle-own-write-members-
|
|
5650
|
+
export { CFN_TEMPLATE_URL_LIMIT as $, isMalformedEnvKey as A, loadCdkJson as B, redactedDockerCause as C, partitionSensitiveEnv as D, finchSecretArgvRefusal as E, abortInFlightMultipartUploads as F, resolveStateBucketWithDefault as G, resolveAutoAssetStorage as H, Synthesizer as I, resolveUpdatePolicy as J, resolveStateBucketWithDefaultAndSource as K, synthesisStatusMessage as L, getDockerCmd as M, runDockerForeground as N, warnFinchArgvExposure as O, runDockerStreaming as P, CFN_TEMPLATE_BODY_LIMIT as Q, getDefaultStateBucketName as R, redactedCause as S, dockerSpawnEnvWithSensitive as T, resolveCaptureObservedState as U, resolveApp as V, resolveSkipPrefix as W, stateBucketExistenceConfirmed as X, resolveUseCdkBootstrapAssets as Y, warnDeprecatedNoPrefixCliFlag as Z, buildDockerImage as _, principalOwnWriteMembers as a, StageLoadError as at, describeDockerExecFailure as b, stringListMember as c, legacyPlanAssetCount as ct, planSubscriptionAttributes as d, CdkToolkitBucketMissingError as dt, MIGRATE_TMP_PREFIX as et, DagBuilder as f, processStackMessages as ft, WorkGraph as g, AssetPublisher as h, injectedAwsRegionValue as ht, mergeDeclaredEntries as i, AssemblyReader as it, formatDockerLoginError as j, isDockerClientEnvKey as k, DiffCalculator as l, predictedAutoCreatedAssetMode as lt, isLockInfoExpired as m, injectAwsRegion as mt, declaredStringList as n, uploadCfnTemplate as nt, settleOwnWriteMembers as o, bindLegacyStackAssetParameters as ot, LockManager as p, setChildProcessAwsEnv as pt, resolveStateBucketWithSource as q, inlinePoliciesAreDeclared as r, refuseFailedLookups as rt, stringListIsDeclared as s, createLegacyAssetParameterBinder as st, declaredInlinePolicies as t, findLargeInlineResources as tt, normalizeRecordName as u, prepareLegacyStackAssets as ut, resolveDockerContextDirectory as v, redactDockerArgvValues as w, describeDockerFailure as x, describeDockerCapturedOutput as y, getLegacyStateBucketName as z };
|
|
5651
|
+
//# sourceMappingURL=settle-own-write-members-C1uPhq2z.js.map
|