@go-to-k/cdkd 0.281.12 → 0.281.14
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-JZvPyCEp.js → asg-provider-C1WbHit9.js} +2 -2
- package/dist/{asg-provider-JZvPyCEp.js.map → asg-provider-C1WbHit9.js.map} +1 -1
- package/dist/cli.js +89 -57
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-CPDPlPQN.js → deploy-engine-3BZtmJqZ.js} +322 -51
- package/dist/deploy-engine-3BZtmJqZ.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-CPDPlPQN.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as replayWarn, $t as
|
|
2
|
+
import { $ as replayWarn, $t as findLargeInlineResources, A as green, At as buildDockerImage, B as slowCcOperationTimeoutMs, Bt as getLegacyStateBucketName, C as MULTI_REGION_RECREATE_BLOCKED_TYPES, Cn as ResourceTimeoutError, Ct as AssetModeResolver, D as bold, Dt as parseBootstrapMarker, E as formatResourceLine, En as StackTerminationProtectionError, Et as getBootstrapMarkerKey, F as clearOnUpdateRemoval, Ft as AssetManifestLoader, G as getAccountInfo, Gt as resolveStateBucketWithDefault, H as isTerminationProtectionPropagationError, Ht as resolveAutoAssetStorage, I as ProviderRegistry, It as getDockerImageBySourceHash, J as normalizeAwsTagsToCfn, Jt as stateBucketExistenceConfirmed, K as refStateLookupFromResource, Kt as resolveStateBucketWithDefaultAndSource, L as findActionableSilentDrops, Lt as Synthesizer, M as yellow, Mn as withErrorHandling, Mt as getDockerCmd, N as IAMRoleProvider, Nt as runDockerForeground, O as cyan, Ot as validateAssetBucketName, P as collectInlinePolicyNamesManagedBySiblings, Pt as runDockerStreaming, Q as readConfigString, Qt as MIGRATE_TMP_PREFIX, R as findSilentDropProperties, Rt as synthesisStatusMessage, S as extractDeploymentEventError, Sn as ProvisioningError, St as rewriteTemplateAssetReferences, T as renderStatefulReason, Tn as StackHasActiveImportsError, Tt as ensureAssetStorage, U as IntrinsicFunctionResolver, Ut as resolveCaptureObservedState, V as disableInstanceApiTermination, Vt as resolveApp, W as cfnRefValueFromPhysicalId, Wt as resolveSkipPrefix, X as assertRegionMatch, Xt as CFN_TEMPLATE_BODY_LIMIT, Y as resolveExplicitPhysicalId, Yt as warnDeprecatedNoPrefixCliFlag, Z as configStringRefusal, Zt as CFN_TEMPLATE_URL_LIMIT, _ as createPreDeleteFinalSnapshot, _n as LocalStartServiceError, _t as stringifyValue, a as DeploymentEventsStore, an as resolveBucketRegion, at as DiffCalculator, b as unsupportedFinalSnapshotError, bn as NestedStackChildDirectDestroyError, bt as createAssetRedirectResolver, c as replayFailedOperations, cn as resetAwsClients, ct as isRetryableTransientError, d as IMPLICIT_DELETE_DEPENDENCIES, dn as CdkdError, dt as TemplateParser, en as uploadCfnTemplate, et as requireConfigArray, f as computeImplicitDeleteEdges, ft as LockManager, g as ccRoutedFinalSnapshotError, gn as LocalMigrateError, gt as AssetPublisher, h as buildFinalSnapshotIdentifier, hn as LocalInvokeBuildError$1, ht as shouldRetainResource, i as DeploymentEventsReader, it as applyRoleArnIfSet, j as red, jn as normalizeAwsError, jt as formatDockerLoginError, k as gray, kt as validateContainerRepoName, l as replayRollback, ln as setAwsClients, lt as isThrottlingError, m as PRE_DELETE_SNAPSHOT_TYPES, mn as DeployCancelledError, mt as rebuildClientForBucketRegion, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as AssemblyReader, nt as requireConfigString, o as planFailedOps, on as AwsClients, ot as describeTypeWithThrottleRetry, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pt as S3StateBackend, q as WAFv2WebACLProvider, qt as resolveUseCdkBootstrapAssets, r as DeployEngine, rn as processStackMessages, rt as derivePartitionAndUrlSuffix, s as planRollback, sn as getAwsClients, st as withRetry, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as expectedOwnerParam, tt as requireConfigObject, u as withResourceDeadline, ut as DagBuilder, v as isFinalSnapshotError, vt as WorkGraph, w as isStatefulRecreateTargetSync, wn as ResourceUpdateNotSupportedError, wt as BOOTSTRAP_MARKER_PREFIX, x as makeCanonicalizePropertiesFn, xn as PartialFailureError, xt as loadPublishableAssetManifest, y as refusesFinalSnapshot, yn as MissingCdkCliError, yt as buildAssetRedirectMap, z as CloudControlProvider, zt as getDefaultStateBucketName } from "./deploy-engine-3BZtmJqZ.js";
|
|
3
3
|
import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, h as withStackName, i as runStackBuffered, m as withSkipPrefix, n as getLogger, o as PATTERN_B_NAME_OPTIONS, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-zRrlbaQt.js";
|
|
4
|
-
import { t as ASGProvider } from "./asg-provider-
|
|
4
|
+
import { t as ASGProvider } from "./asg-provider-C1WbHit9.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
7
7
|
import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
@@ -36867,51 +36867,6 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
|
|
|
36867
36867
|
}
|
|
36868
36868
|
};
|
|
36869
36869
|
|
|
36870
|
-
//#endregion
|
|
36871
|
-
//#region src/utils/aws-partition.ts
|
|
36872
|
-
/**
|
|
36873
|
-
* AWS partition / URL-suffix derivation, shared across layers.
|
|
36874
|
-
*
|
|
36875
|
-
* Lives in `src/utils/` because it has consumers in two different layers: the
|
|
36876
|
-
* `cdkd local *` command family (which passes a region in once to keep the STS
|
|
36877
|
-
* hop minimal) and the provisioning layer's `AppSyncProvider`, which rebuilds a
|
|
36878
|
-
* child resource's ARN when AWS did not report one.
|
|
36879
|
-
*
|
|
36880
|
-
* It was originally defined in `src/local/ecs-task-resolver.ts`, which
|
|
36881
|
-
* re-exports it so every existing call site is unchanged; a provisioning
|
|
36882
|
-
* provider importing from `src/local/**` would invert the layering.
|
|
36883
|
-
*
|
|
36884
|
-
* NOTE this is the mapping to prefer over `getAccountInfo().partition`
|
|
36885
|
-
* (`src/deployment/intrinsic-function-resolver.ts`), which is hardcoded to
|
|
36886
|
-
* `'aws'` and says so in its own comment.
|
|
36887
|
-
*/
|
|
36888
|
-
/**
|
|
36889
|
-
* Derive the AWS partition / URL suffix for an AWS region. Same mapping
|
|
36890
|
-
* CloudFormation applies to `${AWS::Partition}` / `${AWS::URLSuffix}`.
|
|
36891
|
-
*/
|
|
36892
|
-
function derivePartitionAndUrlSuffix(region) {
|
|
36893
|
-
if (region.startsWith("cn-")) return {
|
|
36894
|
-
partition: "aws-cn",
|
|
36895
|
-
urlSuffix: "amazonaws.com.cn"
|
|
36896
|
-
};
|
|
36897
|
-
if (region.startsWith("us-gov-")) return {
|
|
36898
|
-
partition: "aws-us-gov",
|
|
36899
|
-
urlSuffix: "amazonaws.com"
|
|
36900
|
-
};
|
|
36901
|
-
if (region.startsWith("us-iso-")) return {
|
|
36902
|
-
partition: "aws-iso",
|
|
36903
|
-
urlSuffix: "c2s.ic.gov"
|
|
36904
|
-
};
|
|
36905
|
-
if (region.startsWith("us-isob-")) return {
|
|
36906
|
-
partition: "aws-iso-b",
|
|
36907
|
-
urlSuffix: "sc2s.sgov.gov"
|
|
36908
|
-
};
|
|
36909
|
-
return {
|
|
36910
|
-
partition: "aws",
|
|
36911
|
-
urlSuffix: "amazonaws.com"
|
|
36912
|
-
};
|
|
36913
|
-
}
|
|
36914
|
-
|
|
36915
36870
|
//#endregion
|
|
36916
36871
|
//#region src/provisioning/providers/appsync-provider.ts
|
|
36917
36872
|
const MUTABLE_GRAPHQL_API_CONFIG_PROPERTIES = [
|
|
@@ -37050,8 +37005,9 @@ var AppSyncProvider = class {
|
|
|
37050
37005
|
* `CloudControlProvider` uses for its own ARN reconstruction, so this costs
|
|
37051
37006
|
* at most one `GetCallerIdentity` per deploy.
|
|
37052
37007
|
*/
|
|
37053
|
-
async buildAppSyncArn(suffix) {
|
|
37054
|
-
const accountInfo = await getAccountInfo(this.providerRegion ?? await this.getClient().config.region());
|
|
37008
|
+
async buildAppSyncArn(suffix, regionOverride) {
|
|
37009
|
+
const accountInfo = await getAccountInfo(regionOverride ?? this.providerRegion ?? await this.getClient().config.region());
|
|
37010
|
+
if (accountInfo.fabricated) throw new Error(`cannot determine the AWS account (STS is unreachable, and the resolved account id is a placeholder), so an ARN for ${suffix} would be fabricated`);
|
|
37055
37011
|
const { partition } = derivePartitionAndUrlSuffix(accountInfo.region);
|
|
37056
37012
|
return `arn:${partition}:appsync:${accountInfo.region}:${accountInfo.accountId}:${suffix}`;
|
|
37057
37013
|
}
|
|
@@ -37098,25 +37054,45 @@ var AppSyncProvider = class {
|
|
|
37098
37054
|
* Returns `undefined` for an id whose arity does not match the type — a
|
|
37099
37055
|
* record that malformed cannot be healed by guessing, and carrying the
|
|
37100
37056
|
* existing attributes forward is the safe answer.
|
|
37057
|
+
*
|
|
37058
|
+
* `omitArnOnFailure` is for the IMPORT path only (issue #1728 review). The
|
|
37059
|
+
* non-ARN keys — `Name`, `ApiKey` — are split straight out of the physical id
|
|
37060
|
+
* and involve no account at all, so dropping them because the ACCOUNT could
|
|
37061
|
+
* not be resolved would fail `Fn::GetAtt Name` for a reason that has nothing
|
|
37062
|
+
* to do with it. Import has no prior record to preserve, so keeping what it
|
|
37063
|
+
* can beats keeping nothing. `update()` must NOT pass it: there a partial map
|
|
37064
|
+
* replaces the record's wholesale and would delete a good ARN.
|
|
37101
37065
|
*/
|
|
37102
|
-
async childRefAttributes(resourceType, physicalId) {
|
|
37066
|
+
async childRefAttributes(resourceType, physicalId, regionOverride, omitArnOnFailure = false) {
|
|
37103
37067
|
const parts = physicalId.split("|");
|
|
37068
|
+
const arn = async (suffix) => {
|
|
37069
|
+
try {
|
|
37070
|
+
return await this.buildAppSyncArn(suffix, regionOverride);
|
|
37071
|
+
} catch (error) {
|
|
37072
|
+
if (!omitArnOnFailure) throw error;
|
|
37073
|
+
this.logger.warn(`Imported ${resourceType} (${physicalId}) but its ARN attribute was NOT recorded: ${error instanceof Error ? error.message : String(error)}. Ref will resolve to the compound physical id, and Fn::GetAtt on the ARN will fail, until the resource's next update heals the record.`);
|
|
37074
|
+
return;
|
|
37075
|
+
}
|
|
37076
|
+
};
|
|
37104
37077
|
if (resourceType === "AWS::AppSync::DataSource" && parts.length === 2) {
|
|
37105
37078
|
const [apiId, name] = parts;
|
|
37079
|
+
const dataSourceArn = await arn(`apis/${apiId}/datasources/${name}`);
|
|
37106
37080
|
return {
|
|
37107
|
-
DataSourceArn:
|
|
37081
|
+
...dataSourceArn && { DataSourceArn: dataSourceArn },
|
|
37108
37082
|
Name: name
|
|
37109
37083
|
};
|
|
37110
37084
|
}
|
|
37111
37085
|
if (resourceType === "AWS::AppSync::Resolver" && parts.length === 3) {
|
|
37112
37086
|
const [apiId, typeName, fieldName] = parts;
|
|
37113
|
-
|
|
37087
|
+
const resolverArn = await arn(`apis/${apiId}/types/${typeName}/resolvers/${fieldName}`);
|
|
37088
|
+
return { ...resolverArn && { ResolverArn: resolverArn } };
|
|
37114
37089
|
}
|
|
37115
37090
|
if (resourceType === "AWS::AppSync::ApiKey" && parts.length === 2) {
|
|
37116
37091
|
const [apiId, apiKeyId] = parts;
|
|
37092
|
+
const apiKeyArn = await arn(`apis/${apiId}/apikey/${apiKeyId}`);
|
|
37117
37093
|
return {
|
|
37118
37094
|
ApiKey: apiKeyId,
|
|
37119
|
-
Arn:
|
|
37095
|
+
...apiKeyArn && { Arn: apiKeyArn }
|
|
37120
37096
|
};
|
|
37121
37097
|
}
|
|
37122
37098
|
}
|
|
@@ -37124,9 +37100,21 @@ var AppSyncProvider = class {
|
|
|
37124
37100
|
* The no-replacement update result for a child type, carrying the healed
|
|
37125
37101
|
* attribute set (issue #1681). Reporting none is still the correct answer for
|
|
37126
37102
|
* an unhealable id — the engine then carries the existing attributes forward.
|
|
37103
|
+
*
|
|
37104
|
+
* An ARN that cannot be built takes the SAME answer, and it must (issue #1728
|
|
37105
|
+
* review). An `update()` attribute map REPLACES the record's wholesale, so
|
|
37106
|
+
* reporting a partial set here would DELETE the ARN a previous deploy
|
|
37107
|
+
* correctly recorded; reporting none carries it forward untouched. That is
|
|
37108
|
+
* why this arm differs from the import one below, which has no prior record
|
|
37109
|
+
* to preserve and therefore keeps what it can.
|
|
37127
37110
|
*/
|
|
37128
37111
|
async childUpdateResult(resourceType, physicalId) {
|
|
37129
|
-
|
|
37112
|
+
let attributes;
|
|
37113
|
+
try {
|
|
37114
|
+
attributes = await this.childRefAttributes(resourceType, physicalId);
|
|
37115
|
+
} catch (error) {
|
|
37116
|
+
this.logger.warn(`Updated ${resourceType} (${physicalId}) but could not rebuild its ARN attribute: ${error instanceof Error ? error.message : String(error)}. The previously recorded attributes are kept.`);
|
|
37117
|
+
}
|
|
37130
37118
|
return {
|
|
37131
37119
|
physicalId,
|
|
37132
37120
|
wasReplaced: false,
|
|
@@ -37134,6 +37122,47 @@ var AppSyncProvider = class {
|
|
|
37134
37122
|
};
|
|
37135
37123
|
}
|
|
37136
37124
|
/**
|
|
37125
|
+
* The child attribute set for an ADOPTED resource (issue #1728).
|
|
37126
|
+
*
|
|
37127
|
+
* `import()` used to record `attributes: {}` for every child type, so a child
|
|
37128
|
+
* adopted via `cdkd import` had no ARN in state and the resolver's
|
|
37129
|
+
* `REF_RETURNS_ARN_FROM_STATE` lookup missed — `Ref` fell back to the raw
|
|
37130
|
+
* compound id, i.e. the pre-#1681 behavior, and `Fn::GetAtt DataSourceArn` /
|
|
37131
|
+
* `ResolverArn` / `Arn` were equally unresolved. The record healed only on the
|
|
37132
|
+
* resource's next UPDATE (#1727), so an imported-and-untouched child stayed
|
|
37133
|
+
* broken indefinitely.
|
|
37134
|
+
*
|
|
37135
|
+
* RECONSTRUCTED rather than read back from AWS. Every segment is already in
|
|
37136
|
+
* the physical id the import receives, `childRefAttributes` is the SAME
|
|
37137
|
+
* mapping `create()` / `update()` use (so the three spellings cannot drift),
|
|
37138
|
+
* and the reconstruction costs one process-cached STS call instead of one
|
|
37139
|
+
* DescribeApi-family call per imported child. A readback would be
|
|
37140
|
+
* authoritative but cannot be more correct for a well-formed id: `import`
|
|
37141
|
+
* adopts a resource in the caller's own account, which is exactly the context
|
|
37142
|
+
* `buildAppSyncArn` derives from.
|
|
37143
|
+
*
|
|
37144
|
+
* Never throws: a failure degrades to `{}` (or to the account-independent
|
|
37145
|
+
* keys — see `omitArnOnFailure`), which is at worst the exact pre-#1728
|
|
37146
|
+
* behavior, because adopting the resource is worth more than its bookkeeping
|
|
37147
|
+
* attribute. `childRefAttributes` already answers `undefined` for a mis-arity
|
|
37148
|
+
* id, which degrades the same way rather than guessing.
|
|
37149
|
+
*
|
|
37150
|
+
* The fabricated-account refusal that makes this honest lives in
|
|
37151
|
+
* `buildAppSyncArn`, not here (issue #1728 review): the UPDATE path rebuilds
|
|
37152
|
+
* the ARN on every in-place update, so an STS blip there would REPLACE a
|
|
37153
|
+
* correct recorded ARN rather than merely fail to write one. Guarding only
|
|
37154
|
+
* this call site would have left the worse path open. The fabrication itself
|
|
37155
|
+
* is issue #1730.
|
|
37156
|
+
*/
|
|
37157
|
+
async childImportAttributes(resourceType, physicalId, region) {
|
|
37158
|
+
try {
|
|
37159
|
+
return await this.childRefAttributes(resourceType, physicalId, region, true) ?? {};
|
|
37160
|
+
} catch (error) {
|
|
37161
|
+
this.logger.warn(`Imported ${resourceType} (${physicalId}) but could not build its ARN attribute: ${error instanceof Error ? error.message : String(error)}. Ref will resolve to the compound physical id, and Fn::GetAtt on the ARN will fail, until the resource's next update heals the record.`);
|
|
37162
|
+
return {};
|
|
37163
|
+
}
|
|
37164
|
+
}
|
|
37165
|
+
/**
|
|
37137
37166
|
* Lazy S3 client for the `*S3Location` properties (Resolver
|
|
37138
37167
|
* `CodeS3Location` / `RequestMappingTemplateS3Location` /
|
|
37139
37168
|
* `ResponseMappingTemplateS3Location`, GraphQLSchema
|
|
@@ -38564,13 +38593,16 @@ var AppSyncProvider = class {
|
|
|
38564
38593
|
* real resource (issue #1134); auto-mode import resolves ids from
|
|
38565
38594
|
* CloudFormation's `DescribeStackResources` instead. AppSync sub-resources
|
|
38566
38595
|
* (`GraphQLSchema`, `DataSource`, `Resolver`, `ApiKey`) are scoped under a
|
|
38567
|
-
* parent `apiId` — explicit-override only.
|
|
38596
|
+
* parent `apiId` — explicit-override only. The three ARN-`Ref` children
|
|
38597
|
+
* additionally record the same attribute set `create()` does, so an adopted
|
|
38598
|
+
* child's `Ref` / `Fn::GetAtt` resolve immediately rather than only after its
|
|
38599
|
+
* first update (issue #1728) — see {@link childImportAttributes}.
|
|
38568
38600
|
*/
|
|
38569
38601
|
async import(input) {
|
|
38570
38602
|
if (input.resourceType !== "AWS::AppSync::GraphQLApi") {
|
|
38571
38603
|
if (input.knownPhysicalId) return {
|
|
38572
38604
|
physicalId: input.knownPhysicalId,
|
|
38573
|
-
attributes:
|
|
38605
|
+
attributes: await this.childImportAttributes(input.resourceType, input.knownPhysicalId, input.region)
|
|
38574
38606
|
};
|
|
38575
38607
|
return null;
|
|
38576
38608
|
}
|
|
@@ -73513,7 +73545,7 @@ function createMigrateCommand() {
|
|
|
73513
73545
|
*/
|
|
73514
73546
|
function buildProgram() {
|
|
73515
73547
|
const program = new Command();
|
|
73516
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.281.
|
|
73548
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.281.14");
|
|
73517
73549
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
73518
73550
|
const { profile } = actionCommand.optsWithGlobals();
|
|
73519
73551
|
if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
|