@go-to-k/cdkd 0.233.0 → 0.234.1
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/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { A as withErrorHandling, B as generateResourceName, C as StackHasActiveImportsError, F as getLiveRenderer, H as withSkipPrefix, I as PATTERN_B_NAME_OPTIONS, L as PATTERN_B_NAME_PROPERTIES, M as getLogger, P as runStackBuffered, R as PATTERN_B_RESOURCE_TYPES, S as ResourceUpdateNotSupportedError, U as withStackName, V as generateResourceNameWithFallback, _ as MissingCdkCliError, a as normalizeAwsTagsToCfn, b as ProvisioningError, f as LocalInvokeBuildError$1, i as matchesCdkPath, k as normalizeAwsError, l as CdkdError, m as LocalStartServiceError, n as isTerminationProtectionPropagationError, o as resolveExplicitPhysicalId, p as LocalMigrateError, r as CDK_PATH_TAG, s as assertRegionMatch, t as disableInstanceApiTermination, v as NestedStackChildDirectDestroyError, w as StackTerminationProtectionError, x as ResourceTimeoutError, y as PartialFailureError } from "./ec2-termination-protection-uvVnteGl.js";
|
|
3
3
|
import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-pjPwZz1r.js";
|
|
4
|
-
import { $ as AssetManifestLoader, A as DiffCalculator, B as buildAssetRedirectMap, C as findActionableSilentDrops, D as refStateLookupFromResource, E as cfnRefValueFromPhysicalId, F as rebuildClientForBucketRegion, G as BOOTSTRAP_MARKER_PREFIX, H as loadPublishableAssetManifest, I as shouldRetainResource, J as buildDockerImage, K as ensureAssetStorage, L as AssetPublisher, M as TemplateParser, N as LockManager, O as WAFv2WebACLProvider, P as S3StateBackend, Q as runDockerStreaming, R as stringifyValue, S as ProviderRegistry, T as IntrinsicFunctionResolver, U as rewriteTemplateAssetReferences, V as createAssetRedirectResolver, W as AssetModeResolver, X as getDockerCmd, Y as formatDockerLoginError, Z as runDockerForeground, _ as green, _t as AssemblyReader, a as withRetry, at as resolveApp, b as IAMRoleProvider, c as computeImplicitDeleteEdges, ct as resolveStateBucketWithDefault, d as isStatefulRecreateTargetSync, dt as warnDeprecatedNoPrefixCliFlag, et as getDockerImageBySourceHash, f as renderStatefulReason, ft as CFN_TEMPLATE_BODY_LIMIT, g as gray, gt as uploadCfnTemplate, h as cyan, ht as findLargeInlineResources, i as withResourceDeadline, it as getLegacyStateBucketName, j as DagBuilder, k as applyRoleArnIfSet, l as extractDeploymentEventError, lt as resolveStateBucketWithDefaultAndSource, m as bold, mt as MIGRATE_TMP_PREFIX, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as synthesisStatusMessage, o as isRetryableTransientError, ot as resolveCaptureObservedState, p as formatResourceLine, pt as CFN_TEMPLATE_URL_LIMIT, q as parseBootstrapMarker, r as DeployEngine, rt as getDefaultStateBucketName, s as IMPLICIT_DELETE_DEPENDENCIES, st as resolveSkipPrefix, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as Synthesizer, u as MULTI_REGION_RECREATE_BLOCKED_TYPES, ut as resolveUseCdkBootstrapAssets, v as red, w as CloudControlProvider, x as collectInlinePolicyNamesManagedBySiblings, y as yellow, yt as resolveBucketRegion, z as WorkGraph } from "./deploy-engine-
|
|
4
|
+
import { $ as AssetManifestLoader, A as DiffCalculator, B as buildAssetRedirectMap, C as findActionableSilentDrops, D as refStateLookupFromResource, E as cfnRefValueFromPhysicalId, F as rebuildClientForBucketRegion, G as BOOTSTRAP_MARKER_PREFIX, H as loadPublishableAssetManifest, I as shouldRetainResource, J as buildDockerImage, K as ensureAssetStorage, L as AssetPublisher, M as TemplateParser, N as LockManager, O as WAFv2WebACLProvider, P as S3StateBackend, Q as runDockerStreaming, R as stringifyValue, S as ProviderRegistry, T as IntrinsicFunctionResolver, U as rewriteTemplateAssetReferences, V as createAssetRedirectResolver, W as AssetModeResolver, X as getDockerCmd, Y as formatDockerLoginError, Z as runDockerForeground, _ as green, _t as AssemblyReader, a as withRetry, at as resolveApp, b as IAMRoleProvider, c as computeImplicitDeleteEdges, ct as resolveStateBucketWithDefault, d as isStatefulRecreateTargetSync, dt as warnDeprecatedNoPrefixCliFlag, et as getDockerImageBySourceHash, f as renderStatefulReason, ft as CFN_TEMPLATE_BODY_LIMIT, g as gray, gt as uploadCfnTemplate, h as cyan, ht as findLargeInlineResources, i as withResourceDeadline, it as getLegacyStateBucketName, j as DagBuilder, k as applyRoleArnIfSet, l as extractDeploymentEventError, lt as resolveStateBucketWithDefaultAndSource, m as bold, mt as MIGRATE_TMP_PREFIX, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as synthesisStatusMessage, o as isRetryableTransientError, ot as resolveCaptureObservedState, p as formatResourceLine, pt as CFN_TEMPLATE_URL_LIMIT, q as parseBootstrapMarker, r as DeployEngine, rt as getDefaultStateBucketName, s as IMPLICIT_DELETE_DEPENDENCIES, st as resolveSkipPrefix, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as Synthesizer, u as MULTI_REGION_RECREATE_BLOCKED_TYPES, ut as resolveUseCdkBootstrapAssets, v as red, w as CloudControlProvider, x as collectInlinePolicyNamesManagedBySiblings, y as yellow, yt as resolveBucketRegion, z as WorkGraph } from "./deploy-engine-CdAkyW9k.js";
|
|
5
5
|
import { t as ASGProvider } from "./asg-provider-Dd9Xze-T.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -645,10 +645,12 @@ async function bootstrapCommand(options) {
|
|
|
645
645
|
bucketName = getDefaultStateBucketName(accountId);
|
|
646
646
|
logger.info(`Using default state bucket: ${bucketName}`);
|
|
647
647
|
}
|
|
648
|
+
const rebuiltStateBucketClient = await rebuildClientForBucketRegion(s3Client, bucketName, { ...options.profile && { profile: options.profile } });
|
|
649
|
+
const stateBucketS3 = rebuiltStateBucketClient ?? s3Client;
|
|
648
650
|
try {
|
|
649
651
|
let bucketExists = false;
|
|
650
652
|
try {
|
|
651
|
-
await
|
|
653
|
+
await stateBucketS3.send(new HeadBucketCommand({ Bucket: bucketName }));
|
|
652
654
|
bucketExists = true;
|
|
653
655
|
logger.info(`Bucket ${bucketName} already exists`);
|
|
654
656
|
} catch (error) {
|
|
@@ -672,18 +674,18 @@ async function bootstrapCommand(options) {
|
|
|
672
674
|
logger.info(`Creating S3 bucket: ${bucketName} in region ${region}`);
|
|
673
675
|
const createBucketParams = { Bucket: bucketName };
|
|
674
676
|
if (region !== "us-east-1") createBucketParams.CreateBucketConfiguration = { LocationConstraint: region };
|
|
675
|
-
await
|
|
677
|
+
await stateBucketS3.send(new CreateBucketCommand(createBucketParams));
|
|
676
678
|
logger.info(`✓ Created S3 bucket: ${bucketName}`);
|
|
677
679
|
}
|
|
678
680
|
if (!skipStateBucketConfig) {
|
|
679
681
|
logger.debug("Enabling bucket versioning...");
|
|
680
|
-
await
|
|
682
|
+
await stateBucketS3.send(new PutBucketVersioningCommand({
|
|
681
683
|
Bucket: bucketName,
|
|
682
684
|
VersioningConfiguration: { Status: "Enabled" }
|
|
683
685
|
}));
|
|
684
686
|
logger.info("✓ Enabled bucket versioning");
|
|
685
687
|
logger.debug("Enabling bucket encryption...");
|
|
686
|
-
await
|
|
688
|
+
await stateBucketS3.send(new PutBucketEncryptionCommand({
|
|
687
689
|
Bucket: bucketName,
|
|
688
690
|
ServerSideEncryptionConfiguration: { Rules: [{
|
|
689
691
|
ApplyServerSideEncryptionByDefault: { SSEAlgorithm: "AES256" },
|
|
@@ -703,7 +705,7 @@ async function bootstrapCommand(options) {
|
|
|
703
705
|
Condition: { StringNotEquals: { "aws:PrincipalAccount": accountId } }
|
|
704
706
|
}]
|
|
705
707
|
};
|
|
706
|
-
await
|
|
708
|
+
await stateBucketS3.send(new PutBucketPolicyCommand({
|
|
707
709
|
Bucket: bucketName,
|
|
708
710
|
Policy: JSON.stringify(bucketPolicy)
|
|
709
711
|
}));
|
|
@@ -753,6 +755,7 @@ async function bootstrapCommand(options) {
|
|
|
753
755
|
logger.info(` --state-bucket ${bucketName}`);
|
|
754
756
|
logger.info(` --region ${region}`);
|
|
755
757
|
} finally {
|
|
758
|
+
rebuiltStateBucketClient?.destroy();
|
|
756
759
|
awsClients.destroy();
|
|
757
760
|
}
|
|
758
761
|
}
|
|
@@ -1500,7 +1503,7 @@ const FLUSH_INTERVAL_MS = 2e3;
|
|
|
1500
1503
|
const FLUSH_EVENT_THRESHOLD = 50;
|
|
1501
1504
|
/** Build-time cdkd version, with a dev fallback for non-built contexts. */
|
|
1502
1505
|
function getCdkdVersion() {
|
|
1503
|
-
return "0.
|
|
1506
|
+
return "0.234.1";
|
|
1504
1507
|
}
|
|
1505
1508
|
/**
|
|
1506
1509
|
* Generate a time-sortable unique run id, e.g.
|
|
@@ -47876,6 +47879,28 @@ function buildSubstitutionContextFromImageContext(context) {
|
|
|
47876
47879
|
return subContext;
|
|
47877
47880
|
}
|
|
47878
47881
|
/**
|
|
47882
|
+
* A container-image URI that points at a CDK-bootstrap OR cdkd-owned assets
|
|
47883
|
+
* ECR repository:
|
|
47884
|
+
*
|
|
47885
|
+
* - `cdk-<qualifier>-container-assets-<acct>-<region>` — the CDK bootstrap
|
|
47886
|
+
* repo (default qualifier `hnb659fds`, or a custom `cdk bootstrap
|
|
47887
|
+
* --qualifier` value);
|
|
47888
|
+
* - `cdkd-container-assets-<acct>-<region>` — the repo `cdkd bootstrap`
|
|
47889
|
+
* creates and `cdkd deploy` publishes into once a bootstrap marker exists
|
|
47890
|
+
* (issue #1002; a migrated stack's template / `--from-state` state carries
|
|
47891
|
+
* this shape).
|
|
47892
|
+
*
|
|
47893
|
+
* Either is a CDK asset image the ECS runner resolves back to the on-disk
|
|
47894
|
+
* `cdk.out` build, so both must classify as `kind: 'cdk-asset'`. The `cdk-`
|
|
47895
|
+
* qualifier is generalized to `[a-z0-9]+` so a custom-qualifier bootstrap is
|
|
47896
|
+
* matched too (previously only the hardcoded `hnb659fds` default was).
|
|
47897
|
+
*/
|
|
47898
|
+
const CDK_ASSET_IMAGE_REPO_RE = /(?:cdk-[a-z0-9]+|cdkd)-container-assets-/;
|
|
47899
|
+
/** True when `uri` embeds a CDK-bootstrap or cdkd-owned container-assets repo. */
|
|
47900
|
+
function isCdkAssetImageUri(uri) {
|
|
47901
|
+
return CDK_ASSET_IMAGE_REPO_RE.test(uri);
|
|
47902
|
+
}
|
|
47903
|
+
/**
|
|
47879
47904
|
* Parse the `Image` field of an ECS container definition.
|
|
47880
47905
|
*
|
|
47881
47906
|
* Three shapes:
|
|
@@ -47915,7 +47940,7 @@ function parseContainerImage(raw, containerName, taskLogicalId, resources, _stac
|
|
|
47915
47940
|
if (joinResolved.kind === "unsupported-join") throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an unsupported Fn::Join Image shape: ${joinResolved.reason}. cdkd local run-task recognizes the canonical CDK 2.x ContainerImage.fromEcrRepository Fn::Join shape (delimiter "" with nested Fn::Select/Fn::Split over an ECR Repository Arn GetAtt + Ref to the repo).`);
|
|
47916
47941
|
const flat = extractImageString(raw);
|
|
47917
47942
|
if (!flat) throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an unparseable Image property. cdkd local run-task v1 supports flat string images, single-key Fn::Sub bodies, and CDK-asset Image references.`);
|
|
47918
|
-
if (flat
|
|
47943
|
+
if (isCdkAssetImageUri(flat)) {
|
|
47919
47944
|
const hashMatch = /:([a-f0-9]{8,})$/.exec(flat);
|
|
47920
47945
|
const out = { kind: "cdk-asset" };
|
|
47921
47946
|
if (hashMatch) out.assetHash = hashMatch[1];
|
|
@@ -47963,7 +47988,7 @@ function findUnresolvedEcrRepositoryRef(substituted, resources) {
|
|
|
47963
47988
|
* `Fn::GetAtt` path can share the regex-match branches.
|
|
47964
47989
|
*/
|
|
47965
47990
|
function classifyResolvedImage(uri) {
|
|
47966
|
-
if (uri
|
|
47991
|
+
if (isCdkAssetImageUri(uri)) {
|
|
47967
47992
|
const hashMatch = /:([a-f0-9]{8,})$/.exec(uri);
|
|
47968
47993
|
const out = { kind: "cdk-asset" };
|
|
47969
47994
|
if (hashMatch) out.assetHash = hashMatch[1];
|
|
@@ -55989,7 +56014,7 @@ function reorderArgs(argv) {
|
|
|
55989
56014
|
async function main() {
|
|
55990
56015
|
installPipeCloseHandler();
|
|
55991
56016
|
const program = new Command();
|
|
55992
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
56017
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.234.1");
|
|
55993
56018
|
program.addCommand(createBootstrapCommand());
|
|
55994
56019
|
program.addCommand(createSynthCommand());
|
|
55995
56020
|
program.addCommand(createListCommand());
|