@go-to-k/cdkd 0.290.49 → 0.291.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/{asg-provider-06Q6iut6.js → asg-provider-CZ5keDoC.js} +2 -2
- package/dist/{asg-provider-06Q6iut6.js.map → asg-provider-CZ5keDoC.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-Cs0cRQIM.js → deploy-engine-9CxYEFh_.js} +296 -9
- package/dist/deploy-engine-9CxYEFh_.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{program-DGTp7UIn.js → program-Cs7N6T4j.js} +6 -4
- package/dist/{program-DGTp7UIn.js.map → program-Cs7N6T4j.js.map} +1 -1
- package/dist/{version-usurnP89.js → version-kDWCn_Jq.js} +2 -2
- package/dist/{version-usurnP89.js.map → version-kDWCn_Jq.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-Cs0cRQIM.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as isVersionOnlyInvocation, t as getCdkdVersion } from "./version-
|
|
2
|
+
import { n as isVersionOnlyInvocation, t as getCdkdVersion } from "./version-kDWCn_Jq.js";
|
|
3
3
|
|
|
4
4
|
//#region src/cli/pipe-close-handler.ts
|
|
5
5
|
/**
|
|
@@ -74,7 +74,7 @@ async function main() {
|
|
|
74
74
|
console.log(getCdkdVersion());
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
const { buildProgram } = await import("./program-
|
|
77
|
+
const { buildProgram } = await import("./program-Cs7N6T4j.js");
|
|
78
78
|
const program = buildProgram();
|
|
79
79
|
const args = reorderArgs(process.argv);
|
|
80
80
|
await program.parseAsync(args);
|
|
@@ -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
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-BoIxyCir.js";
|
|
3
|
-
import { t as getCdkdVersion } from "./version-
|
|
3
|
+
import { t as getCdkdVersion } from "./version-kDWCn_Jq.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";
|
|
@@ -3097,6 +3097,33 @@ function namesTheSameDirectory(bound, candidate) {
|
|
|
3097
3097
|
return realBound !== void 0 && realTarget !== void 0 && realBound === realTarget;
|
|
3098
3098
|
}
|
|
3099
3099
|
/**
|
|
3100
|
+
* The escape verdict for an assembly-supplied path WITHOUT throwing, taking
|
|
3101
|
+
* whichever arm the value's own shape calls for.
|
|
3102
|
+
*
|
|
3103
|
+
* `resolveAssemblyPath` answers for a RELATIVE value and
|
|
3104
|
+
* {@link absoluteAssemblyPathEscape} for an ABSOLUTE one, and a caller that
|
|
3105
|
+
* only wants to WARN would otherwise branch on `path.isAbsolute` and call
|
|
3106
|
+
* both itself. Three sites already do exactly that
|
|
3107
|
+
* ([#3532](https://github.com/go-to-k/cdkd/issues/3532)'s two asset resolvers,
|
|
3108
|
+
* which must also THROW and so keep their own spelling), and the fourth —
|
|
3109
|
+
* [#3497](https://github.com/go-to-k/cdkd/issues/3497)'s BuildKit
|
|
3110
|
+
* passthroughs — has nothing to throw and a dozen values to judge. This is the
|
|
3111
|
+
* one spelling for that case.
|
|
3112
|
+
*
|
|
3113
|
+
* `base` is what a relative value resolves against; `bound` is what the result
|
|
3114
|
+
* must stay inside. They differ for a Stage. Returns `undefined` when the
|
|
3115
|
+
* value is fine, including when it names `bound` itself, which
|
|
3116
|
+
* {@link namesTheSameDirectory} answers — an asset path legitimately names a
|
|
3117
|
+
* directory and a caller that WARNS has no reason to complain about the
|
|
3118
|
+
* assembly root.
|
|
3119
|
+
*/
|
|
3120
|
+
function assemblyPathEscape(base, bound, candidate) {
|
|
3121
|
+
if (path.isAbsolute(candidate)) return absoluteAssemblyPathEscape(bound, candidate);
|
|
3122
|
+
const resolved = resolveAssemblyPath(base, candidate, { containWithin: bound });
|
|
3123
|
+
if (resolved.contained || namesTheSameDirectory(bound, resolved.path)) return void 0;
|
|
3124
|
+
return resolved;
|
|
3125
|
+
}
|
|
3126
|
+
/**
|
|
3100
3127
|
* The shared tail of every containment refusal: what the value resolved to,
|
|
3101
3128
|
* what it escaped, and why that means the assembly is not CDK-generated. Each
|
|
3102
3129
|
* call site supplies its own subject ("Stack 'X' has templateFile='...' which
|
|
@@ -8705,6 +8732,251 @@ function describeDockerCapturedOutput(error, args, fallback) {
|
|
|
8705
8732
|
return redactDockerArgvInText(capturedStreamText(error, "stderr") || capturedStreamText(error, "stdout") || fallback, args);
|
|
8706
8733
|
}
|
|
8707
8734
|
|
|
8735
|
+
//#endregion
|
|
8736
|
+
//#region src/assets/docker-cache-option.ts
|
|
8737
|
+
/**
|
|
8738
|
+
* Render a `DockerCacheOption` as the `--cache-from` / `--cache-to` value
|
|
8739
|
+
* BuildKit receives.
|
|
8740
|
+
*
|
|
8741
|
+
* Its own LEAF module, imported by both `docker-build.ts` (which pushes it
|
|
8742
|
+
* into the argv) and `manifest-passthrough-warnings.ts` (which judges it).
|
|
8743
|
+
* Not because those two form a cycle — `docker-build.ts` imports the warnings
|
|
8744
|
+
* module and not the reverse — but because the helper belongs to NEITHER: it
|
|
8745
|
+
* is the shared definition of what BuildKit will be handed, and keeping it in
|
|
8746
|
+
* the builder would make the judge import the thing it judges.
|
|
8747
|
+
*
|
|
8748
|
+
* **It is the one spelling on purpose, and the reason is a defect**
|
|
8749
|
+
* ([#3497](https://github.com/go-to-k/cdkd/issues/3497)): the warning layer
|
|
8750
|
+
* used to walk `option.params` STRUCTURALLY while the argv is this
|
|
8751
|
+
* concatenation, and neither `,` nor `=` is quoted here. A manifest could
|
|
8752
|
+
* therefore inject CSV through a field the walk did not treat as a path —
|
|
8753
|
+
* `type: 'local,dest=/home/victim/.ssh'` with no params at all renders
|
|
8754
|
+
* `--cache-to type=local,dest=/home/victim/.ssh`, a host WRITE that produced
|
|
8755
|
+
* no warning because `params` was empty. Judging the rendered STRING closes
|
|
8756
|
+
* that by construction: whatever BuildKit parses is what cdkd parsed.
|
|
8757
|
+
*/
|
|
8758
|
+
function cacheOptionToFlag(option) {
|
|
8759
|
+
let flag = `type=${option.type}`;
|
|
8760
|
+
if (option.params) for (const [k, v] of Object.entries(option.params)) flag += `,${k}=${v}`;
|
|
8761
|
+
return flag;
|
|
8762
|
+
}
|
|
8763
|
+
|
|
8764
|
+
//#endregion
|
|
8765
|
+
//#region src/assets/manifest-passthrough-warnings.ts
|
|
8766
|
+
/**
|
|
8767
|
+
* Every candidate host path in a buildx option value.
|
|
8768
|
+
*
|
|
8769
|
+
* **Uniform, and over-inclusive on purpose.** Three review rounds found this
|
|
8770
|
+
* parser short in three different ways — `dest=` only (missing the
|
|
8771
|
+
* `--output=<path>` shorthand), case-sensitive `src` (missing `source=` and
|
|
8772
|
+
* `SRC=`), and a per-entry `=` requirement (missing every key after the first
|
|
8773
|
+
* in `--ssh k=./a.key,/home/victim/.ssh/id_rsa`). Each fix was a new special
|
|
8774
|
+
* case, and the next round found the next gap. So the rule is now one rule:
|
|
8775
|
+
* **a part with a key yields its value, a part without one yields itself**,
|
|
8776
|
+
* for every field. An over-inclusive candidate costs at most a warning about
|
|
8777
|
+
* a string that was never a path — and a value that is not a path resolves
|
|
8778
|
+
* inside the build context and is dropped before anything is printed.
|
|
8779
|
+
*
|
|
8780
|
+
* `write` is true only for an explicit `dest=`, or when the caller says the
|
|
8781
|
+
* whole field is a write target (`dockerOutputs`, whose bare-path form IS a
|
|
8782
|
+
* destination). It is NOT inferred from the field name: `cacheFrom` can carry
|
|
8783
|
+
* a `dest=` and `cacheTo` a `src=`.
|
|
8784
|
+
*
|
|
8785
|
+
* KNOWN INCOMPLETE, recorded rather than built, and this list is the whole of
|
|
8786
|
+
* what is left "safe by argument" in this module — four of five review rounds
|
|
8787
|
+
* broke something that lived in that category, so it is written down instead:
|
|
8788
|
+
*
|
|
8789
|
+
* - buildx parses these as CSV, so a quoted value containing a comma
|
|
8790
|
+
* (`dest="/tmp/a,b"`) is split wrongly here and its path is missed.
|
|
8791
|
+
* - the keyed rule takes `src` / `source` / `dest`, the documented spellings
|
|
8792
|
+
* that make BuildKit open a file. An UNDOCUMENTED alias, or a NEW key in a
|
|
8793
|
+
* future buildx, would slip past it, where the earlier take-every-key rule
|
|
8794
|
+
* would have caught it — that rule was given up because it cost live false
|
|
8795
|
+
* positives on `ref=` / `scope=` / `env=` at an ordinary project layout.
|
|
8796
|
+
* What was audited, per backend: `--secret` opens a file only through
|
|
8797
|
+
* `src` / `source` (`env` is a variable NAME); every `--output` exporter
|
|
8798
|
+
* only through `dest` (`name`, `push`, `compression*`, `annotation.*`,
|
|
8799
|
+
* `store`, the docker exporter's `context` are not paths); `--cache-to` and
|
|
8800
|
+
* `--cache-from` only under `type=local` (`registry`, `s3`, `azblob`, `gha`
|
|
8801
|
+
* reach the network or take inline values). For the CACHE flags alone there
|
|
8802
|
+
* is a second enumeration to keep in step: `src/utils/docker-cmd.ts`'s
|
|
8803
|
+
* `ARGV_PARAM_LIST_LOCATOR_PARAMS`, consulted under `ARGV_PARAM_LIST_FLAGS`
|
|
8804
|
+
* (`--cache-from` / `--cache-to`), lists the same backends for the
|
|
8805
|
+
* redaction side and agrees — **update both or neither.** `--secret` and
|
|
8806
|
+
* `--output` have no counterpart there, so a new exporter key is judged
|
|
8807
|
+
* here and nowhere else.
|
|
8808
|
+
* - a leading or trailing SPACE is trimmed here and is NOT trimmed by buildx
|
|
8809
|
+
* or by Go's CSV reader, so ` ../../x` is a directory literally named
|
|
8810
|
+
* `" .."` to the kernel while cdkd judges the trimmed spelling. It can only
|
|
8811
|
+
* OVER-warn, which is why it is recorded rather than removed.
|
|
8812
|
+
*
|
|
8813
|
+
* Both misses cost a WARNING, never a refusal, which is the whole reason
|
|
8814
|
+
* neither is worth a CSV parser or a wider net.
|
|
8815
|
+
*
|
|
8816
|
+
* Tolerant by construction: an unparseable value yields nothing rather than
|
|
8817
|
+
* throwing. This module only ever ADDS a warning and must never be why a
|
|
8818
|
+
* legitimate build fails.
|
|
8819
|
+
*/
|
|
8820
|
+
function candidateHostPaths(value, opts) {
|
|
8821
|
+
const out = [];
|
|
8822
|
+
for (const part of value.split(",")) {
|
|
8823
|
+
const eq = part.indexOf("=");
|
|
8824
|
+
if (eq < 0) {
|
|
8825
|
+
const bare = part.trim();
|
|
8826
|
+
if (bare.length > 0) out.push({
|
|
8827
|
+
path: bare,
|
|
8828
|
+
write: opts.bareIsWrite
|
|
8829
|
+
});
|
|
8830
|
+
continue;
|
|
8831
|
+
}
|
|
8832
|
+
const key = part.slice(0, eq).trim().toLowerCase();
|
|
8833
|
+
const v = part.slice(eq + 1).trim();
|
|
8834
|
+
if (v.length === 0) continue;
|
|
8835
|
+
if (key !== "src" && key !== "source" && key !== "dest") continue;
|
|
8836
|
+
out.push({
|
|
8837
|
+
path: v,
|
|
8838
|
+
write: key === "dest"
|
|
8839
|
+
});
|
|
8840
|
+
}
|
|
8841
|
+
return out;
|
|
8842
|
+
}
|
|
8843
|
+
/** Every host path this source hands to BuildKit, with where it came from. */
|
|
8844
|
+
function hostPathsOf(source) {
|
|
8845
|
+
const refs = [];
|
|
8846
|
+
if (source.dockerFile) refs.push({
|
|
8847
|
+
field: "dockerFile",
|
|
8848
|
+
where: "dockerFile",
|
|
8849
|
+
path: source.dockerFile,
|
|
8850
|
+
write: false
|
|
8851
|
+
});
|
|
8852
|
+
for (const [k, v] of Object.entries(source.dockerBuildContexts ?? {})) {
|
|
8853
|
+
const rendered = `${k}=${v}`;
|
|
8854
|
+
const contextPath = rendered.slice(rendered.indexOf("=") + 1).trim();
|
|
8855
|
+
if (contextPath.length === 0) continue;
|
|
8856
|
+
refs.push({
|
|
8857
|
+
field: "dockerBuildContexts",
|
|
8858
|
+
where: k,
|
|
8859
|
+
path: contextPath,
|
|
8860
|
+
write: false
|
|
8861
|
+
});
|
|
8862
|
+
}
|
|
8863
|
+
const ssh = source.dockerBuildSsh ?? "";
|
|
8864
|
+
const sshEq = ssh.indexOf("=");
|
|
8865
|
+
(sshEq < 0 ? [] : ssh.slice(sshEq + 1).split(",")).forEach((entry, i) => {
|
|
8866
|
+
const p = entry.trim();
|
|
8867
|
+
if (p.length > 0) refs.push({
|
|
8868
|
+
field: "dockerBuildSsh",
|
|
8869
|
+
where: String(i),
|
|
8870
|
+
path: p,
|
|
8871
|
+
write: false
|
|
8872
|
+
});
|
|
8873
|
+
});
|
|
8874
|
+
for (const [k, v] of Object.entries(source.dockerBuildSecrets ?? {})) for (const { path: p, write } of candidateHostPaths(`id=${k},${v}`, { bareIsWrite: false })) refs.push({
|
|
8875
|
+
field: "dockerBuildSecrets",
|
|
8876
|
+
where: k,
|
|
8877
|
+
path: p,
|
|
8878
|
+
write
|
|
8879
|
+
});
|
|
8880
|
+
(source.cacheFrom ?? []).forEach((c, i) => {
|
|
8881
|
+
for (const { path: p, write } of candidateHostPaths(cacheOptionToFlag(c), { bareIsWrite: false })) refs.push({
|
|
8882
|
+
field: "cacheFrom",
|
|
8883
|
+
where: String(i),
|
|
8884
|
+
path: p,
|
|
8885
|
+
write
|
|
8886
|
+
});
|
|
8887
|
+
});
|
|
8888
|
+
if (source.cacheTo) for (const { path: p, write } of candidateHostPaths(cacheOptionToFlag(source.cacheTo), { bareIsWrite: false })) refs.push({
|
|
8889
|
+
field: "cacheTo",
|
|
8890
|
+
where: "cacheTo",
|
|
8891
|
+
path: p,
|
|
8892
|
+
write
|
|
8893
|
+
});
|
|
8894
|
+
(source.dockerOutputs ?? []).forEach((o, i) => {
|
|
8895
|
+
for (const { path: p, write } of candidateHostPaths(o, { bareIsWrite: true })) refs.push({
|
|
8896
|
+
field: "dockerOutputs",
|
|
8897
|
+
where: String(i),
|
|
8898
|
+
path: p,
|
|
8899
|
+
write
|
|
8900
|
+
});
|
|
8901
|
+
});
|
|
8902
|
+
return refs;
|
|
8903
|
+
}
|
|
8904
|
+
/**
|
|
8905
|
+
* Warn for each BuildKit passthrough whose host path leaves the assembly.
|
|
8906
|
+
*
|
|
8907
|
+
* `base` is the build context directory (what a relative value resolves
|
|
8908
|
+
* against); `bound` is the app's outdir.
|
|
8909
|
+
*/
|
|
8910
|
+
function warnEscapingBuildKitPaths(source, base, bound) {
|
|
8911
|
+
const logger = getLogger().child("assets");
|
|
8912
|
+
const contextNarrows = assemblyPathEscape(base, base, resolve$1(bound)) !== void 0;
|
|
8913
|
+
for (const ref of hostPathsOf(source)) {
|
|
8914
|
+
if (!ref.write && contextNarrows && assemblyPathEscape(base, base, ref.path) === void 0) continue;
|
|
8915
|
+
const escape = assemblyPathEscape(base, bound, ref.path);
|
|
8916
|
+
if (escape === void 0) continue;
|
|
8917
|
+
const verb = ref.write ? "WRITE to" : "read";
|
|
8918
|
+
logger.warn(`Docker asset ${ref.field}` + (ref.where === ref.field ? "" : `['${displaySafe(ref.where)}']`) + ` names a host path outside the assembly, which ${renderAssemblyPathEscape(escape, bound, "load", `cdkd will ${verb} it during the image build, matching the CDK CLI — a pre-synthesized assembly is trusted input. If you did not produce this assembly, that is a host path it chose and the CloudFormation template does not show.`)}`);
|
|
8919
|
+
}
|
|
8920
|
+
}
|
|
8921
|
+
/**
|
|
8922
|
+
* Warn that a manifest-chosen command line is about to run on the host.
|
|
8923
|
+
*
|
|
8924
|
+
* **This is the one the decision singles out**, and it is not a containment
|
|
8925
|
+
* question: `source.executable` is an arbitrary argv cdkd spawns, so no path
|
|
8926
|
+
* check applies and no value of it is "safe". It breaks the reasonable
|
|
8927
|
+
* expectation that `-a <dir>` runs no code from the assembly, and nothing said
|
|
8928
|
+
* so before. Rendered through `redactDockerArgvValues`, because a build script
|
|
8929
|
+
* wrapping `docker build` carries the very `--build-arg` pairs the rest of
|
|
8930
|
+
* this layer masks.
|
|
8931
|
+
*/
|
|
8932
|
+
function warnManifestExecutable(executable) {
|
|
8933
|
+
const [cmd, ...rest] = executable;
|
|
8934
|
+
const logger = getLogger().child("assets");
|
|
8935
|
+
logger.debug(`source.executable argv: ${redactDockerArgvValues([...executable]).join(" ")}`);
|
|
8936
|
+
logger.warn(`Docker asset source.executable runs a command this asset manifest chose, on this machine: '${displaySafe(cmd ?? "")}'` + (rest.length > 0 ? ` (with ${rest.length} argument(s); --verbose shows them)` : "") + ". cdkd runs it, matching the CDK CLI — a pre-synthesized assembly is trusted input. Note that this means deploying from a pre-synthesized assembly DOES execute code from it, which the CloudFormation template does not show.");
|
|
8937
|
+
}
|
|
8938
|
+
/**
|
|
8939
|
+
* One set per KIND rather than one set of composite keys. A `${kind}` + NUL +
|
|
8940
|
+
* `${name}` key would be a multi-part NUL-joined string, which this repo
|
|
8941
|
+
* fences as a record-key shape — and it is not one: it never leaves the
|
|
8942
|
+
* process, is never persisted, and a collision would suppress one duplicate
|
|
8943
|
+
* warning line. Two sets carry the same information with nothing to classify.
|
|
8944
|
+
*/
|
|
8945
|
+
const warnedDestinations = {
|
|
8946
|
+
bucket: /* @__PURE__ */ new Set(),
|
|
8947
|
+
repository: /* @__PURE__ */ new Set()
|
|
8948
|
+
};
|
|
8949
|
+
/**
|
|
8950
|
+
* Warn that an asset destination is not bootstrap-shaped.
|
|
8951
|
+
*
|
|
8952
|
+
* `redirectFileAsset` rewrites a destination only when it matches a known
|
|
8953
|
+
* bootstrap shape, so anything else survives verbatim and cdkd uploads there
|
|
8954
|
+
* with the caller's credentials. A CUSTOM BOOTSTRAP IS LEGITIMATE — which is
|
|
8955
|
+
* why this warns and never refuses — but the name is worth printing, because
|
|
8956
|
+
* it is the one field a reader can recognise as not theirs.
|
|
8957
|
+
*
|
|
8958
|
+
* **Shape only, and an adversary can imitate a shape.**
|
|
8959
|
+
* `isDefaultBootstrapBucketName` accepts any qualifier, so
|
|
8960
|
+
* `cdk-<anything>-assets-<victim-account>-<region>` reads as recognized even
|
|
8961
|
+
* when the bucket lives in the attacker's account (S3 names are global and a
|
|
8962
|
+
* bucket policy can admit the victim's principal). This warning narrows what
|
|
8963
|
+
* a careless manifest gets away with; it is not an ownership check, and
|
|
8964
|
+
* nothing here should be read as one.
|
|
8965
|
+
*
|
|
8966
|
+
* `recognized` is whether the name is default-bootstrap-shaped for this
|
|
8967
|
+
* (account, region) or is cdkd's own asset storage. Judged on the FLATTENED
|
|
8968
|
+
* name and on shape, not on whether the redirect table rewrote it: in legacy
|
|
8969
|
+
* mode nothing is rewritten and every ordinary deploy would otherwise warn,
|
|
8970
|
+
* which is the cry-wolf failure this layer already learned once.
|
|
8971
|
+
*/
|
|
8972
|
+
function warnUnrecognizedAssetDestination(opts) {
|
|
8973
|
+
if (opts.recognized) return;
|
|
8974
|
+
const seen = warnedDestinations[opts.kind];
|
|
8975
|
+
if (seen.has(opts.name)) return;
|
|
8976
|
+
seen.add(opts.name);
|
|
8977
|
+
getLogger().child("assets").warn(`Asset destination ${opts.kind} '${displaySafe(opts.name)}' is not a CDK-bootstrap or cdkd-managed name, so cdkd uploads there exactly as this asset manifest wrote it, with your credentials. That is what a custom bootstrap looks like and is expected for one; if you did not configure it, the manifest chose where your assets go.`);
|
|
8978
|
+
}
|
|
8979
|
+
|
|
8708
8980
|
//#endregion
|
|
8709
8981
|
//#region src/assets/docker-build.ts
|
|
8710
8982
|
/**
|
|
@@ -8785,6 +9057,7 @@ async function buildDockerImage(asset, cdkOutDir, options) {
|
|
|
8785
9057
|
if (source.executable && source.executable.length > 0) {
|
|
8786
9058
|
const [cmd, ...args] = source.executable;
|
|
8787
9059
|
if (!cmd) throw options.wrapError("asset source.executable[] is empty");
|
|
9060
|
+
warnManifestExecutable(source.executable);
|
|
8788
9061
|
const cwd = source.directory ? contextDirectory(source.directory, "run this asset's source.executable with that directory as its working directory") : cdkOutDir;
|
|
8789
9062
|
const shownExecutable = redactDockerArgvValues(source.executable).join(" ");
|
|
8790
9063
|
logger.debug(`Building Docker image via executable: ${shownExecutable} (cwd=${cwd})`);
|
|
@@ -8811,6 +9084,7 @@ async function buildDockerImage(asset, cdkOutDir, options) {
|
|
|
8811
9084
|
const buildArgs = buildDockerBuildCommand(source, options.tag, options.platform);
|
|
8812
9085
|
const contextDir = contextDirectory(source.directory, "send that directory to BuildKit as the build context and bake it into the image pushed to the repository this manifest names");
|
|
8813
9086
|
buildArgs.push(".");
|
|
9087
|
+
warnEscapingBuildKitPaths(source, contextDir, options.assetOutdir ?? cdkOutDir);
|
|
8814
9088
|
logger.debug(`${getDockerCmd()} ${redactDockerArgvValues(buildArgs).join(" ")} (cwd=${displaySafe(contextDir)})`);
|
|
8815
9089
|
try {
|
|
8816
9090
|
await runDockerStreaming(buildArgs, {
|
|
@@ -8849,11 +9123,6 @@ function buildDockerBuildCommand(source, tag, platformOverride) {
|
|
|
8849
9123
|
if (source.cacheDisabled) args.push("--no-cache");
|
|
8850
9124
|
return args;
|
|
8851
9125
|
}
|
|
8852
|
-
function cacheOptionToFlag(option) {
|
|
8853
|
-
let flag = `type=${option.type}`;
|
|
8854
|
-
if (option.params) for (const [k, v] of Object.entries(option.params)) flag += `,${k}=${v}`;
|
|
8855
|
-
return flag;
|
|
8856
|
-
}
|
|
8857
9126
|
|
|
8858
9127
|
//#endregion
|
|
8859
9128
|
//#region src/assets/docker-asset-publisher.ts
|
|
@@ -10380,6 +10649,15 @@ var AssetPublisher = class {
|
|
|
10380
10649
|
const nodeIds = [];
|
|
10381
10650
|
const fileAssets = Object.entries(manifest.files || {}).filter(([, asset]) => !isCfnTemplateAssetPath(asset.source.path)).map(([hash, asset]) => [hash, redirect ? redirectFileAsset(asset, redirect) : asset]);
|
|
10382
10651
|
for (const [hash, asset] of fileAssets) {
|
|
10652
|
+
for (const dest of Object.values(asset.destinations)) {
|
|
10653
|
+
const destRegion = dest.region ?? options.region;
|
|
10654
|
+
const name = flattenAssetPlaceholders(dest.bucketName, options.accountId, destRegion);
|
|
10655
|
+
warnUnrecognizedAssetDestination({
|
|
10656
|
+
kind: "bucket",
|
|
10657
|
+
name,
|
|
10658
|
+
recognized: isDefaultBootstrapBucketName(name, options.accountId, destRegion) || redirect !== void 0 && [...redirect.buckets.values()].includes(name)
|
|
10659
|
+
});
|
|
10660
|
+
}
|
|
10383
10661
|
const nodeId = `asset-publish:${prefix}file:${hash}`;
|
|
10384
10662
|
graph.addNode({
|
|
10385
10663
|
id: nodeId,
|
|
@@ -10400,6 +10678,15 @@ var AssetPublisher = class {
|
|
|
10400
10678
|
}
|
|
10401
10679
|
for (const [hash, rawAsset] of Object.entries(manifest.dockerImages || {})) {
|
|
10402
10680
|
const asset = redirect ? redirectDockerAsset(rawAsset, redirect) : rawAsset;
|
|
10681
|
+
for (const dest of Object.values(asset.destinations)) {
|
|
10682
|
+
const destRegion = dest.region ?? options.region;
|
|
10683
|
+
const name = flattenAssetPlaceholders(dest.repositoryName, options.accountId, destRegion);
|
|
10684
|
+
warnUnrecognizedAssetDestination({
|
|
10685
|
+
kind: "repository",
|
|
10686
|
+
name,
|
|
10687
|
+
recognized: isDefaultBootstrapRepoName(name, options.accountId, destRegion) || redirect !== void 0 && [...redirect.repos.values()].includes(name)
|
|
10688
|
+
});
|
|
10689
|
+
}
|
|
10403
10690
|
const localTag = `cdkd-asset-${hash}`;
|
|
10404
10691
|
const buildNodeId = `asset-build:${prefix}docker:${hash}`;
|
|
10405
10692
|
const publishNodeId = `asset-publish:${prefix}docker:${hash}`;
|
|
@@ -34862,7 +35149,7 @@ var CloudControlProvider = class {
|
|
|
34862
35149
|
const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
|
|
34863
35150
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
34864
35151
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
34865
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
35152
|
+
const { ASGProvider } = await import("./asg-provider-CZ5keDoC.js").then((n) => n.n);
|
|
34866
35153
|
const asgProvider = new ASGProvider();
|
|
34867
35154
|
return withIndeterminateGuard(await asgProvider.delete(logicalId, physicalId, resourceType, _properties, context), indeterminateGuard);
|
|
34868
35155
|
}
|
|
@@ -48571,5 +48858,5 @@ var DeployEngine = class DeployEngine {
|
|
|
48571
48858
|
};
|
|
48572
48859
|
|
|
48573
48860
|
//#endregion
|
|
48574
|
-
export { yellow as $,
|
|
48575
|
-
//# sourceMappingURL=deploy-engine-
|
|
48861
|
+
export { yellow as $, derivePartitionAndUrlSuffix as $i, safeStackName as $n, assertAssetBucketRegion as $r, requireConfigObject as $t, createPreDeleteFinalSnapshot as A, PartialFailureError as Aa, resolveAutoAssetStorage as Ai, malformedOutputsRefusalMessage as An, formatLockExpiry as Ar, carriesDynamicReference as At, isStatefulRecreateTargetSync as B, normalizeAwsError as Ba, CFN_TEMPLATE_URL_LIMIT as Bi, refuseMalformedOrphansForDestroy as Bn, isReadableBag as Br, isSettledInstanceState as Bt, namesAnyDeclaredParameter as C, DynamicReferenceRegionAmbiguousError as Ca, AssetManifestLoader as Ci, isReadableResourceEntry as Cn, LockManager as Cr, slowCcOperationTimeoutMs as Ct, PRE_DELETE_SNAPSHOT_TYPES as D, LockError as Da, getDefaultStateBucketName as Di, malformedOrphanRecordsWarning as Dn, buildForceUnlockCommand as Dr, disableInstanceApiTermination as Dt, ATOMIC_FINAL_SNAPSHOT_TYPES as E, LocalStartServiceError as Ea, synthesisStatusMessage as Ei, malformedLocalOutputsWarning as En, UNREPRODUCIBLE_LOCK_CLAUSE as Er, deleteSkipReason as Et, extractDeploymentEventError as F, StackTerminationProtectionError as Fa, resolveUseCdkBootstrapAssets as Fi, malformedResourcesWarning as Fn, hasReadableExportSet as Fr, isImpossibleEmptyStoredAttribute as Ft, toCfnInteger as G, isTransientServerError as Ga, injectiveKey as Gi, refuseMalformedResourcesForDestroy as Gn, stringifyValue as Gr, coerceCfnBoolean as Gt, WARM_THROUGHPUT_MEMBERS as H, isMarkedNonRetryable as Ha, findLargeInlineResources as Hi, refuseMalformedOutputsForDestroy as Hn, orphansCarriedFrom as Hr, normalizeAwsTagsToCfn as Ht, makeSiblingClaimReader as I, StateError as Ia, stateBucketExistenceConfirmed as Ii, malformedStateRefusalMessage as In, hasReasonlessBaselineRefusal as Ir, isNamelessDynamicReferenceError as It, bold as J, retryClassificationText as Ja, producerRecordKey as Ji, repairMalformedOutputsForReadOnly as Jn, createAssetRedirectResolver as Jr, configIntegerRefusal as Jt, toFiniteNumber as K, markNonRetryable as Ka, injectiveKeyPrefix as Ki, refuseMalformedState as Kn, WorkGraph as Kr, coerceCfnInteger as Kt, planOrphanAdoption as L, SynthesisError as La, warnDeprecatedNoPrefixCliFlag as Li, refuseDivergentRecordRegionForDestroy as Ln, hasUnverifiableParameterRefusal as Lr, isUnboundTemplateParameter as Lt, refusesFinalSnapshot as M, ResourceTimeoutError as Ma, resolveSkipPrefix as Mi, malformedRenderedContainersWarning as Mn, CUSTOM_RESOURCE_RESPONSE_PREFIX as Mr, cfnRefValueFromPhysicalId as Mt, unsupportedFinalSnapshotError as N, ResourceUpdateNotSupportedError as Na, resolveStateBucketWithDefault as Ni, malformedResourceEntriesWarning as Nn, DEFAULT_STATE_PREFIX as Nr, coerceParameterTypedValue as Nt, buildFinalSnapshotIdentifier as O, MalformedProducerRecordRefusalError as Oa, getLegacyStateBucketName as Oi, malformedOrphansRefusalMessage as On, buildLockContentionMessage as Or, isTerminationProtectionPropagationError as Ot, makeCanonicalizePropertiesFn as P, StackHasActiveImportsError as Pa, resolveStateBucketWithDefaultAndSource as Pi, malformedResourcePropertiesWarning as Pn, exportNamesCarriedFrom as Pr, getAccountInfo as Pt, red as Q, canonicalizeRegion as Qi, safeRegion as Qn, BOOTSTRAP_MARKER_PREFIX as Qr, requireConfigArray as Qt, MULTI_REGION_RECREATE_BLOCKED_TYPES as R, formatError as Ra, ssmResolvedValueType as Ri, refuseMalformedNestedChildOutputs as Rn, importableOutputKeys as Rr, parameterTypeMayLoseSecretIdentity as Rt, computeParameterTaint as S, DeployCancelledError as Sa, stripControlChars as Si, hasReadableResources as Sn, scrubResourceRecord as Sr, isWaitAbandonedError as St, resourcesNamingDeclaredParameter as T, LocalInvokeBuildError as Ta, Synthesizer as Ti, malformedExportSourceWarning as Tn, rebuildClientForBucketRegion as Tr, deleteIndeterminateGuards as Tt, coerceWarmThroughput as U, isRetryableTransientError as Ua, uploadCfnTemplate as Ui, refuseMalformedResourceEntries as Un, shouldRetainResource as Ur, resolveExplicitPhysicalId as Ut, renderStatefulReason as V, withErrorHandling as Va, MIGRATE_TMP_PREFIX as Vi, refuseMalformedOutputs as Vn, orphansAfterRollback as Vr, WAFv2WebACLProvider as Vt, isWarmThroughputDecrease as W, isThrottlingError as Wa, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Wi, refuseMalformedResourcePropertiesForOrphan as Wn, AssetPublisher as Wr, assertRegionMatch as Wt, gray as X, safeStringify$1 as Xa, expectedOwnerParam as Xi, repairMalformedResourcePropertiesForReadOnly as Xn, rewriteTemplateAssetReferences as Xr, readConfigString as Xt, cyan as Y, describeAwsFailure as Ya, decodeListingKey as Yi, repairMalformedResourceEntriesForReadOnly as Yn, loadPublishableAssetManifest as Yr, configStringRefusal as Yt, green as Z, __exportAll as Za, PARTITION_TABLE as Zi, repairMalformedResourcesForReadOnly as Zn, AssetModeResolver as Zr, replayWarn as Zt, bagHoldsSecretExpression as _, AssetError as _a, partitionSensitiveEnv as _i, UNREADABLE_ORPHANS_CONTAINER_ROW as _n, maskSecretsInError as _r, endCommandInterruptScope as _t, DeploymentEventsStore as a, hasPlainPrototype$1 as aa, validateAssetBucketName as ai, s3BucketDomainName as an, TemplateParser as ar, secretBearingStateKeyWarning as at, mergeNoChangeOutputs as b, CrossAccountSecretRefusalError as ba, runDockerStreaming as bi, hasReadableOrphans as bn, recoverMaskedOutput as br, startInterruptWatch as bt, replayFailedOperations as c, absoluteAssemblyPathEscape as ca, buildDockerImage as ci, s3BucketWebsiteUrl as cn, STATE_SOURCED_READBACK_RULES as cr, IAMRoleProvider as ct, updatePartialMessage as d, clearBucketRegionCache as da, describeDockerCapturedOutput as di, applyCallerIdentityCredentials as dn, createSecretMasker as dr, ProviderRegistry as dt, AssemblyReader as ea, ensureAssetStorage as ei, requireConfigString as en, findActionableSilentDrops as er, collectDeclaredOutputNames as et, updatePartialReason as f, resolveBucketRegion as fa, describeDockerExecFailure as fi, callerEnvCredentials as fn, dynamicReferenceTokens as fr, wouldReturnToSdkProvider as ft, computeImplicitDeleteEdges as g, setAwsClients as ga, getDockerCmd as gi, STATE_RESOURCES_MALFORMED as gn, markSameGenerationBag as gr, beginCommandInterruptScope as gt, IMPLICIT_DELETE_DEPENDENCIES as h, resetAwsClients as ha, formatDockerLoginError as hi, INTRINSIC_KEYS as hn, isSingleDynamicReferenceToken as hr, maskerOrIdentity as ht, DeploymentEventsReader as i, hasOwnKey as ia, readBootstrapMarkerBody as ii, s3BucketArn as in, DagBuilder as ir, secretBearing as it, isFinalSnapshotError as j, ProvisioningError as ja, resolveCaptureObservedState as ji, malformedOutputsWarning as jn, shellQuote as jr, carriesFetchableDynamicReference as jt, ccRoutedFinalSnapshotError as k, NestedStackChildDirectDestroyError as ka, resolveApp as ki, malformedOrphansWarning as kn, forceQuitRecoveryClause as kr, IntrinsicFunctionResolver as kt, replayRollback as l, renderAssemblyPathEscape as la, resolveDockerContextDirectory as li, applyRoleArnIfSet as ln, TEMPLATE_SOURCED_RULES as lr, collectInlinePolicyNamesManagedBySiblings as lt, maskingRetryLogger as m, getAwsClients as ma, dockerSpawnEnvWithSensitive as mi, DiffCalculator as mn, identityKeyFor as mr, maskDeep as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, processStackMessages as na, isCrossRegionRedirect as ni, producerRegionsFromState as nn, describeTypeWithThrottleRetry as nr, exportAliasCollisionScrubWarning as nt, planFailedOps as o, nullPrototypeRecord as oa, validateContainerRepoName as oi, s3BucketDualStackDomainName as on, STATE_SOURCED_BASELINE_RULES as or, secretSafeKeyDisplay as ot, withResourceDeadline as p, AwsClients as pa, describeDockerFailure as pi, envCredentialsAreAssumedRole as pn, errorCauseChain as pr, createMaskedRetryLogger as pt, formatResourceLine as q, markRedactedCause as qa, producerCoordinateKey as qi, repairMalformedOrphansForReadOnly as qn, buildAssetRedirectMap as qr, configBooleanRefusal as qt, DeployEngine as r, defineOwnKey as ra, parseBootstrapMarker as ri, withSharedDrainBudget as rn, withRetry as rr, isExportAliasCollision as rt, planRollback as s, ownValue as sa, buildDenyExternalAccessPolicy as si, s3BucketRegionalDomainName as sn, STATE_SOURCED_CROSS_GENERATION_RULES as sr, getCurrentResourceSecrets as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, failedStageNote as ta, getBootstrapMarkerKey as ti, classifyReplaySecretRegion as tn, findSilentDropProperties as tr, collectPublishedOutputNames as tt, resolveReplacementOldType as u, resolveAssemblyPath as ua, warnManifestExecutable as ui, AWS_CREDENTIAL_ENV_KEYS as un, carriesSecretMask as ur, clearOnUpdateRemoval as ut, isSecretBearingReferenceString as v, CdkdError as va, redactDockerArgvValues as vi, UNREADABLE_RESOURCES_MAP_ROW as vn, maskSecretsInText as vr, interruptWatchListenerCount as vt, reachableDivergentParameters as w, IntrinsicResolutionRefusalError as wa, getDockerImageBySourceHash as wi, malformedExportNamesWarning as wn, S3StateBackend as wr, UNSPECIFIED_SKIP_REASON as wt, bindingSkippedOutputs as x, DependencyError as xa, escapeRegExp$1 as xi, hasReadableOutputs as xn, redactSecretsForState as xr, CloudControlProvider as xt, keptWholeReasonText as y, ConfigError as ya, runDockerForeground as yi, displayLogicalId as yn, recordMaskOnlyValue as yr, isInterruptedWaitError as yt, isStatefulRecreateTargetForReplace as z, isCdkdError as za, CFN_TEMPLATE_BODY_LIMIT as zi, refuseMalformedOrphans as zn, importableOutputs as zr, refStateLookupFromResource as zt };
|
|
48862
|
+
//# sourceMappingURL=deploy-engine-9CxYEFh_.js.map
|