@go-to-k/cdkd 0.283.1 → 0.283.3
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-R3IdAR_3.js → asg-provider-CtmogXk9.js} +2 -2
- package/dist/{asg-provider-R3IdAR_3.js.map → asg-provider-CtmogXk9.js.map} +1 -1
- package/dist/cli.js +190 -38
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-InwDI9o0.js → deploy-engine-DxpS3fJ9.js} +3 -3
- package/dist/{deploy-engine-InwDI9o0.js.map → deploy-engine-DxpS3fJ9.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as configStringRefusal, $t as resolveStateBucketWithDefaultAndSource, A as green, An as NestedStackChildDirectDestroyError, At as BOOTSTRAP_MARKER_PREFIX, B as slowCcOperationTimeoutMs, Bt as runDockerForeground, C as MULTI_REGION_RECREATE_BLOCKED_TYPES, Ct as stringifyValue, D as bold, Dn as LocalStartServiceError, Dt as loadPublishableAssetManifest, E as formatResourceLine, En as LocalMigrateError, Et as createAssetRedirectResolver, F as clearOnUpdateRemoval, Fn as StackHasActiveImportsError, Ft as validateContainerRepoName, G as getAccountInfo, Gt as synthesisStatusMessage, H as isTerminationProtectionPropagationError, Hn as withErrorHandling, Ht as AssetManifestLoader, I as ProviderRegistry, In as StackTerminationProtectionError, It as buildDenyExternalAccessPolicy, J as normalizeAwsTagsToCfn, Jt as resolveApp, K as refStateLookupFromResource, Kt as getDefaultStateBucketName, L as findActionableSilentDrops, Lt as buildDockerImage, M as yellow, Mn as ProvisioningError, Mt as getBootstrapMarkerKey, N as IAMRoleProvider, Nn as ResourceTimeoutError, Nt as parseBootstrapMarker, O as cyan, Ot as rewriteTemplateAssetReferences, P as collectInlinePolicyNamesManagedBySiblings, Pn as ResourceUpdateNotSupportedError, Pt as validateAssetBucketName, Q as configBooleanRefusal, Qt as resolveStateBucketWithDefault, R as findSilentDropProperties, Rt as formatDockerLoginError, S as extractDeploymentEventError, St as AssetPublisher, T as renderStatefulReason, Tn as LocalInvokeBuildError$1, Tt as buildAssetRedirectMap, U as IntrinsicFunctionResolver, Ut as getDockerImageBySourceHash, V as disableInstanceApiTermination, Vn as normalizeAwsError, Vt as runDockerStreaming, W as cfnRefValueFromPhysicalId, Wt as Synthesizer, X as assertRegionMatch, Xt as resolveCaptureObservedState, Y as resolveExplicitPhysicalId, Yt as resolveAutoAssetStorage, Z as coerceCfnBoolean, Zt as resolveSkipPrefix, _ as createPreDeleteFinalSnapshot, _n as getAwsClients, _t as TemplateParser, a as DeploymentEventsStore, an as MIGRATE_TMP_PREFIX, at as s3BucketArn, b as unsupportedFinalSnapshotError, bt as rebuildClientForBucketRegion, c as replayFailedOperations, cn as expectedOwnerParam, ct as s3BucketRegionalDomainName, d as IMPLICIT_DELETE_DEPENDENCIES, dn as derivePartitionAndUrlSuffix, dt as DiffCalculator, en as resolveUseCdkBootstrapAssets, et as readConfigString, f as computeImplicitDeleteEdges, fn as AssemblyReader, ft as describeTypeWithThrottleRetry, g as ccRoutedFinalSnapshotError, gn as AwsClients, gt as DagBuilder, h as buildFinalSnapshotIdentifier, hn as resolveBucketRegion, ht as isThrottlingError, i as DeploymentEventsReader, in as CFN_TEMPLATE_URL_LIMIT, it as requireConfigString, j as red, jn as PartialFailureError, jt as ensureAssetStorage, k as gray, kn as MissingCdkCliError, kt as AssetModeResolver, l as replayRollback, ln as PARTITION_TABLE, lt as s3BucketWebsiteUrl, m as PRE_DELETE_SNAPSHOT_TYPES, mt as isRetryableTransientError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as warnDeprecatedNoPrefixCliFlag, nt as requireConfigArray, o as planFailedOps, on as findLargeInlineResources, ot as s3BucketDomainName, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as processStackMessages, pt as withRetry, q as WAFv2WebACLProvider, qt as getLegacyStateBucketName, r as DeployEngine, rn as CFN_TEMPLATE_BODY_LIMIT, rt as requireConfigObject, s as planRollback, sn as uploadCfnTemplate, st as s3BucketDualStackDomainName, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as stateBucketExistenceConfirmed, tt as replayWarn, u as withResourceDeadline, un as canonicalizeRegion, ut as applyRoleArnIfSet, v as isFinalSnapshotError, vn as resetAwsClients, vt as LockManager, w as isStatefulRecreateTargetSync, wn as DeployCancelledError, wt as WorkGraph, x as makeCanonicalizePropertiesFn, xn as CdkdError, xt as shouldRetainResource, y as refusesFinalSnapshot, yn as setAwsClients, yt as S3StateBackend, z as CloudControlProvider, zt as getDockerCmd } from "./deploy-engine-
|
|
2
|
+
import { $ as configStringRefusal, $t as resolveStateBucketWithDefaultAndSource, A as green, An as NestedStackChildDirectDestroyError, At as BOOTSTRAP_MARKER_PREFIX, B as slowCcOperationTimeoutMs, Bt as runDockerForeground, C as MULTI_REGION_RECREATE_BLOCKED_TYPES, Ct as stringifyValue, D as bold, Dn as LocalStartServiceError, Dt as loadPublishableAssetManifest, E as formatResourceLine, En as LocalMigrateError, Et as createAssetRedirectResolver, F as clearOnUpdateRemoval, Fn as StackHasActiveImportsError, Ft as validateContainerRepoName, G as getAccountInfo, Gt as synthesisStatusMessage, H as isTerminationProtectionPropagationError, Hn as withErrorHandling, Ht as AssetManifestLoader, I as ProviderRegistry, In as StackTerminationProtectionError, It as buildDenyExternalAccessPolicy, J as normalizeAwsTagsToCfn, Jt as resolveApp, K as refStateLookupFromResource, Kt as getDefaultStateBucketName, L as findActionableSilentDrops, Lt as buildDockerImage, M as yellow, Mn as ProvisioningError, Mt as getBootstrapMarkerKey, N as IAMRoleProvider, Nn as ResourceTimeoutError, Nt as parseBootstrapMarker, O as cyan, Ot as rewriteTemplateAssetReferences, P as collectInlinePolicyNamesManagedBySiblings, Pn as ResourceUpdateNotSupportedError, Pt as validateAssetBucketName, Q as configBooleanRefusal, Qt as resolveStateBucketWithDefault, R as findSilentDropProperties, Rt as formatDockerLoginError, S as extractDeploymentEventError, St as AssetPublisher, T as renderStatefulReason, Tn as LocalInvokeBuildError$1, Tt as buildAssetRedirectMap, U as IntrinsicFunctionResolver, Ut as getDockerImageBySourceHash, V as disableInstanceApiTermination, Vn as normalizeAwsError, Vt as runDockerStreaming, W as cfnRefValueFromPhysicalId, Wt as Synthesizer, X as assertRegionMatch, Xt as resolveCaptureObservedState, Y as resolveExplicitPhysicalId, Yt as resolveAutoAssetStorage, Z as coerceCfnBoolean, Zt as resolveSkipPrefix, _ as createPreDeleteFinalSnapshot, _n as getAwsClients, _t as TemplateParser, a as DeploymentEventsStore, an as MIGRATE_TMP_PREFIX, at as s3BucketArn, b as unsupportedFinalSnapshotError, bt as rebuildClientForBucketRegion, c as replayFailedOperations, cn as expectedOwnerParam, ct as s3BucketRegionalDomainName, d as IMPLICIT_DELETE_DEPENDENCIES, dn as derivePartitionAndUrlSuffix, dt as DiffCalculator, en as resolveUseCdkBootstrapAssets, et as readConfigString, f as computeImplicitDeleteEdges, fn as AssemblyReader, ft as describeTypeWithThrottleRetry, g as ccRoutedFinalSnapshotError, gn as AwsClients, gt as DagBuilder, h as buildFinalSnapshotIdentifier, hn as resolveBucketRegion, ht as isThrottlingError, i as DeploymentEventsReader, in as CFN_TEMPLATE_URL_LIMIT, it as requireConfigString, j as red, jn as PartialFailureError, jt as ensureAssetStorage, k as gray, kn as MissingCdkCliError, kt as AssetModeResolver, l as replayRollback, ln as PARTITION_TABLE, lt as s3BucketWebsiteUrl, m as PRE_DELETE_SNAPSHOT_TYPES, mt as isRetryableTransientError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as warnDeprecatedNoPrefixCliFlag, nt as requireConfigArray, o as planFailedOps, on as findLargeInlineResources, ot as s3BucketDomainName, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as processStackMessages, pt as withRetry, q as WAFv2WebACLProvider, qt as getLegacyStateBucketName, r as DeployEngine, rn as CFN_TEMPLATE_BODY_LIMIT, rt as requireConfigObject, s as planRollback, sn as uploadCfnTemplate, st as s3BucketDualStackDomainName, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as stateBucketExistenceConfirmed, tt as replayWarn, u as withResourceDeadline, un as canonicalizeRegion, ut as applyRoleArnIfSet, v as isFinalSnapshotError, vn as resetAwsClients, vt as LockManager, w as isStatefulRecreateTargetSync, wn as DeployCancelledError, wt as WorkGraph, x as makeCanonicalizePropertiesFn, xn as CdkdError, xt as shouldRetainResource, y as refusesFinalSnapshot, yn as setAwsClients, yt as S3StateBackend, z as CloudControlProvider, zt as getDockerCmd } from "./deploy-engine-DxpS3fJ9.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-CtmogXk9.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";
|
|
@@ -9139,15 +9139,24 @@ var SQSQueueProvider = class {
|
|
|
9139
9139
|
}
|
|
9140
9140
|
}
|
|
9141
9141
|
/**
|
|
9142
|
-
* Construct SQS queue ARN from account/region/queue name
|
|
9142
|
+
* Construct SQS queue ARN from account/region/queue name.
|
|
9143
|
+
*
|
|
9144
|
+
* The partition is derived from the region through the same closed mapping
|
|
9145
|
+
* `${AWS::Partition}` uses (issue #1815) rather than hardcoded to `aws` —
|
|
9146
|
+
* this ARN is recorded into state and served as the queue's `Arn`
|
|
9147
|
+
* attribute, so a commercial literal is structurally valid but wrong in
|
|
9148
|
+
* `aws-cn` / `aws-us-gov` and nothing downstream rejects it.
|
|
9143
9149
|
*/
|
|
9144
9150
|
async constructArn(queueName) {
|
|
9145
9151
|
try {
|
|
9146
9152
|
const accountId = (await this.stsClient.send(new GetCallerIdentityCommand({}))).Account;
|
|
9147
|
-
|
|
9153
|
+
const region = await this.sqsClient.config.region();
|
|
9154
|
+
const { partition } = derivePartitionAndUrlSuffix(region);
|
|
9155
|
+
return `arn:${partition}:sqs:${region}:${accountId}:${queueName}`;
|
|
9148
9156
|
} catch {
|
|
9149
9157
|
this.logger.warn("Failed to construct SQS ARN from STS, using placeholder");
|
|
9150
|
-
|
|
9158
|
+
const { partition } = derivePartitionAndUrlSuffix(process.env["AWS_REGION"] ?? "");
|
|
9159
|
+
return `arn:${partition}:sqs:unknown:unknown:${queueName}`;
|
|
9151
9160
|
}
|
|
9152
9161
|
}
|
|
9153
9162
|
/**
|
|
@@ -18425,14 +18434,23 @@ var LogsLogGroupProvider = class {
|
|
|
18425
18434
|
}
|
|
18426
18435
|
}
|
|
18427
18436
|
/**
|
|
18428
|
-
* Build log group ARN from name
|
|
18437
|
+
* Build log group ARN from name.
|
|
18438
|
+
*
|
|
18439
|
+
* The partition is derived from the region through the same closed mapping
|
|
18440
|
+
* `${AWS::Partition}` uses (issue #1815) rather than hardcoded to `aws` —
|
|
18441
|
+
* this ARN is recorded into state and served as the log group's `Arn`
|
|
18442
|
+
* attribute, so a commercial literal is structurally valid but wrong in
|
|
18443
|
+
* `aws-cn` / `aws-us-gov` and nothing downstream rejects it.
|
|
18429
18444
|
*/
|
|
18430
18445
|
async buildArn(logGroupName) {
|
|
18431
18446
|
try {
|
|
18432
18447
|
const accountId = (await this.stsClient.send(new GetCallerIdentityCommand({}))).Account;
|
|
18433
|
-
|
|
18448
|
+
const region = await this.logsClient.config.region() || process.env["AWS_REGION"] || "us-east-1";
|
|
18449
|
+
const { partition } = derivePartitionAndUrlSuffix(region);
|
|
18450
|
+
return `arn:${partition}:logs:${region}:${accountId}:log-group:${logGroupName}:*`;
|
|
18434
18451
|
} catch {
|
|
18435
|
-
|
|
18452
|
+
const { partition } = derivePartitionAndUrlSuffix(process.env["AWS_REGION"] ?? "");
|
|
18453
|
+
return `arn:${partition}:logs:unknown:unknown:log-group:${logGroupName}:*`;
|
|
18436
18454
|
}
|
|
18437
18455
|
}
|
|
18438
18456
|
/**
|
|
@@ -18693,9 +18711,12 @@ var CloudWatchAlarmProvider = class {
|
|
|
18693
18711
|
this.logger.debug(`Failed to describe alarm ${alarmName}, constructing ARN from config: ${error instanceof Error ? error.message : String(error)}`);
|
|
18694
18712
|
}
|
|
18695
18713
|
try {
|
|
18696
|
-
|
|
18714
|
+
const region = await this.cloudWatchClient.config.region() || process.env["AWS_REGION"] || "us-east-1";
|
|
18715
|
+
const { partition } = derivePartitionAndUrlSuffix(region);
|
|
18716
|
+
return `arn:${partition}:cloudwatch:${region}:*:alarm:${alarmName}`;
|
|
18697
18717
|
} catch {
|
|
18698
|
-
|
|
18718
|
+
const { partition } = derivePartitionAndUrlSuffix(process.env["AWS_REGION"] ?? "");
|
|
18719
|
+
return `arn:${partition}:cloudwatch:*:*:alarm:${alarmName}`;
|
|
18699
18720
|
}
|
|
18700
18721
|
}
|
|
18701
18722
|
/**
|
|
@@ -24983,13 +25004,23 @@ var ApiGatewayProvider = class ApiGatewayProvider {
|
|
|
24983
25004
|
/**
|
|
24984
25005
|
* Build the ARN for an API Gateway Stage, used for tag mutations.
|
|
24985
25006
|
*
|
|
24986
|
-
* Format:
|
|
25007
|
+
* Format:
|
|
25008
|
+
* `arn:{partition}:apigateway:{region}::/restapis/{restApiId}/stages/{stageName}`.
|
|
24987
25009
|
* The double colon (`::`) is intentional: API Gateway tagging uses an
|
|
24988
25010
|
* account-id-less ARN.
|
|
25011
|
+
*
|
|
25012
|
+
* The partition is derived from the region through the same closed mapping
|
|
25013
|
+
* `${AWS::Partition}` uses (issue #1815) rather than hardcoded to `aws`.
|
|
25014
|
+
* Unlike the pure attribute builders this one is passed straight to
|
|
25015
|
+
* `TagResource` / `UntagResource` as `resourceArn`, so in `aws-cn` /
|
|
25016
|
+
* `aws-us-gov` a commercial literal does not just record a wrong string —
|
|
25017
|
+
* it aims the tag mutation at an ARN that names no stage.
|
|
24989
25018
|
*/
|
|
24990
25019
|
async buildStageArn(restApiId, stageName) {
|
|
24991
25020
|
try {
|
|
24992
|
-
|
|
25021
|
+
const region = await this.apiGatewayClient.config.region();
|
|
25022
|
+
const { partition } = derivePartitionAndUrlSuffix(region);
|
|
25023
|
+
return `arn:${partition}:apigateway:${region}::/restapis/${restApiId}/stages/${stageName}`;
|
|
24993
25024
|
} catch {
|
|
24994
25025
|
return;
|
|
24995
25026
|
}
|
|
@@ -38742,11 +38773,19 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
|
|
|
38742
38773
|
}
|
|
38743
38774
|
/**
|
|
38744
38775
|
* Build a namespace ARN from namespace ID.
|
|
38745
|
-
* Format: arn:
|
|
38776
|
+
* Format: `arn:{partition}:servicediscovery:{region}:{account}:namespace/{namespaceId}`
|
|
38777
|
+
*
|
|
38778
|
+
* The partition is derived from the region through the same closed mapping
|
|
38779
|
+
* `${AWS::Partition}` uses (issue #1815) rather than hardcoded to `aws` —
|
|
38780
|
+
* this ARN is recorded into state and served as the namespace's `Arn`
|
|
38781
|
+
* attribute, so a commercial-partition literal is silently wrong (but
|
|
38782
|
+
* structurally valid, hence unrejected) in `aws-cn` / `aws-us-gov`.
|
|
38746
38783
|
*/
|
|
38747
38784
|
async buildNamespaceArn(namespaceId) {
|
|
38748
38785
|
const accountId = (await this.getStsClient().send(new GetCallerIdentityCommand({}))).Account || "";
|
|
38749
|
-
|
|
38786
|
+
const region = await this.getClient().config.region();
|
|
38787
|
+
const { partition } = derivePartitionAndUrlSuffix(region);
|
|
38788
|
+
return `arn:${partition}:servicediscovery:${region}:${accountId}:namespace/${namespaceId}`;
|
|
38750
38789
|
}
|
|
38751
38790
|
};
|
|
38752
38791
|
|
|
@@ -43394,12 +43433,35 @@ var BudgetsBudgetProvider = class {
|
|
|
43394
43433
|
}
|
|
43395
43434
|
/**
|
|
43396
43435
|
* Budget ARN for the tagging APIs (`ListTagsForResource` / `TagResource` /
|
|
43397
|
-
* `UntagResource`)
|
|
43398
|
-
*
|
|
43399
|
-
* ARNs
|
|
43400
|
-
|
|
43401
|
-
|
|
43402
|
-
|
|
43436
|
+
* `UntagResource`), and the `Arn` attribute recorded into state.
|
|
43437
|
+
*
|
|
43438
|
+
* Budgets ARNs carry no region component, but they DO carry a partition, so
|
|
43439
|
+
* a region is still needed to name it. It is read from the RESOLVED region
|
|
43440
|
+
* of the very client that receives this ARN — the same
|
|
43441
|
+
* `getClient().config.region()` the `delete()` path already consults for
|
|
43442
|
+
* its `assertRegionMatch` guard — and routed through the closed mapping
|
|
43443
|
+
* `${AWS::Partition}` uses (issue #1815).
|
|
43444
|
+
*
|
|
43445
|
+
* Asking the CLIENT rather than `providerRegion` is what makes the ARN and
|
|
43446
|
+
* its consumer agree. `providerRegion` is `process.env['AWS_REGION']`, and
|
|
43447
|
+
* when that is unset `getClient()` builds `new BudgetsClient({})`, leaving
|
|
43448
|
+
* the SDK to resolve the region from its OWN chain (`AWS_DEFAULT_REGION`,
|
|
43449
|
+
* the `~/.aws/config` profile). So a profile-configured `cn-north-1` /
|
|
43450
|
+
* `us-gov-*` caller would have derived the COMMERCIAL partition from an
|
|
43451
|
+
* empty string while the client itself talked to a non-commercial endpoint
|
|
43452
|
+
* — on the PRIMARY path, not a fallback.
|
|
43453
|
+
*
|
|
43454
|
+
* The `aws` partition USED to be hardcoded here on the stated assumption
|
|
43455
|
+
* that non-`aws` partitions were unsupported. That was wrong in the quiet
|
|
43456
|
+
* direction: the literal is structurally valid everywhere, so in `aws-cn` /
|
|
43457
|
+
* `aws-us-gov` nothing rejected it — the ARN was simply recorded into state
|
|
43458
|
+
* and handed to `TagResource` naming no budget. A client whose region is
|
|
43459
|
+
* unset or unrecognized still derives to `aws`, so commercial output is
|
|
43460
|
+
* unchanged byte for byte.
|
|
43461
|
+
*/
|
|
43462
|
+
async budgetArn(accountId, budgetName) {
|
|
43463
|
+
const { partition } = derivePartitionAndUrlSuffix(await this.getClient().config.region() ?? "");
|
|
43464
|
+
return `arn:${partition}:budgets::${accountId}:budget/${budgetName}`;
|
|
43403
43465
|
}
|
|
43404
43466
|
/**
|
|
43405
43467
|
* Convert a CFn `Spend` shape to the SDK shape. CFn templates carry
|
|
@@ -43555,7 +43617,7 @@ var BudgetsBudgetProvider = class {
|
|
|
43555
43617
|
this.logger.debug(`Successfully created budget ${logicalId}: ${name}`);
|
|
43556
43618
|
return {
|
|
43557
43619
|
physicalId: name,
|
|
43558
|
-
attributes: { Arn: this.budgetArn(accountId, name) }
|
|
43620
|
+
attributes: { Arn: await this.budgetArn(accountId, name) }
|
|
43559
43621
|
};
|
|
43560
43622
|
} catch (error) {
|
|
43561
43623
|
if (error instanceof ProvisioningError) throw error;
|
|
@@ -43582,7 +43644,7 @@ var BudgetsBudgetProvider = class {
|
|
|
43582
43644
|
return {
|
|
43583
43645
|
physicalId,
|
|
43584
43646
|
wasReplaced: false,
|
|
43585
|
-
attributes: { Arn: this.budgetArn(accountId, physicalId) }
|
|
43647
|
+
attributes: { Arn: await this.budgetArn(accountId, physicalId) }
|
|
43586
43648
|
};
|
|
43587
43649
|
} catch (error) {
|
|
43588
43650
|
if (error instanceof ProvisioningError) throw error;
|
|
@@ -43698,7 +43760,7 @@ var BudgetsBudgetProvider = class {
|
|
|
43698
43760
|
async reconcileResourceTags(accountId, budgetName, oldTags, newTags) {
|
|
43699
43761
|
const sortedJson = (tags) => JSON.stringify([...tags].sort((a, b) => (a.Key ?? "").localeCompare(b.Key ?? "")));
|
|
43700
43762
|
if (sortedJson(oldTags) === sortedJson(newTags)) return;
|
|
43701
|
-
const arn = this.budgetArn(accountId, budgetName);
|
|
43763
|
+
const arn = await this.budgetArn(accountId, budgetName);
|
|
43702
43764
|
const newKeys = new Set(newTags.map((t) => t.Key));
|
|
43703
43765
|
const removedKeys = oldTags.map((t) => t.Key).filter((k) => {
|
|
43704
43766
|
return typeof k === "string" && !newKeys.has(k);
|
|
@@ -43741,7 +43803,7 @@ var BudgetsBudgetProvider = class {
|
|
|
43741
43803
|
/**
|
|
43742
43804
|
* `Fn::GetAtt` support. CloudFormation documents no attributes for
|
|
43743
43805
|
* `AWS::Budgets::Budget`; `Arn` is served as a cdkd convenience (computed
|
|
43744
|
-
* — Budgets ARNs are `arn:
|
|
43806
|
+
* — Budgets ARNs are `arn:{partition}:budgets::{account}:budget/{name}`, verified
|
|
43745
43807
|
* to exist via `DescribeBudget` first).
|
|
43746
43808
|
*/
|
|
43747
43809
|
async getAttribute(physicalId, resourceType, attributeName) {
|
|
@@ -43752,7 +43814,7 @@ var BudgetsBudgetProvider = class {
|
|
|
43752
43814
|
AccountId: accountId,
|
|
43753
43815
|
BudgetName: physicalId
|
|
43754
43816
|
}));
|
|
43755
|
-
return this.budgetArn(accountId, physicalId);
|
|
43817
|
+
return await this.budgetArn(accountId, physicalId);
|
|
43756
43818
|
} catch (error) {
|
|
43757
43819
|
const cause = error instanceof Error ? error : void 0;
|
|
43758
43820
|
throw new ProvisioningError(`Failed to resolve Arn for budget ${physicalId}: ${cause?.message ?? String(error)}`, resourceType, physicalId, physicalId, cause);
|
|
@@ -43777,7 +43839,7 @@ var BudgetsBudgetProvider = class {
|
|
|
43777
43839
|
}));
|
|
43778
43840
|
return {
|
|
43779
43841
|
physicalId: explicit,
|
|
43780
|
-
attributes: { Arn: this.budgetArn(accountId, explicit) }
|
|
43842
|
+
attributes: { Arn: await this.budgetArn(accountId, explicit) }
|
|
43781
43843
|
};
|
|
43782
43844
|
} catch (error) {
|
|
43783
43845
|
if (error instanceof NotFoundException$5) return null;
|
|
@@ -51573,13 +51635,33 @@ var S3DirectoryBucketProvider = class {
|
|
|
51573
51635
|
return { Arn: await this.buildBucketArn(bucketName) };
|
|
51574
51636
|
}
|
|
51575
51637
|
/**
|
|
51576
|
-
* Directory bucket ARN:
|
|
51638
|
+
* Directory bucket ARN:
|
|
51639
|
+
* `arn:{partition}:s3express:{region}:{account}:bucket/{name}`.
|
|
51577
51640
|
* Also the `ResourceArn` for the S3 Control tag operations. Callers that
|
|
51578
51641
|
* already resolved the account (for the S3 Control `AccountId` parameter)
|
|
51579
51642
|
* pass it in so the STS lookup runs once per operation.
|
|
51643
|
+
*
|
|
51644
|
+
* The partition is derived from the region through the same closed mapping
|
|
51645
|
+
* `${AWS::Partition}` uses (issue #1815) rather than hardcoded to `aws`.
|
|
51646
|
+
* Here it is load-bearing TWICE over: the value is served as the bucket's
|
|
51647
|
+
* `Arn` attribute AND passed to S3 Control as the `ResourceArn` of a tag
|
|
51648
|
+
* mutation, so outside the commercial partition the wrong literal does not
|
|
51649
|
+
* merely record a bad string — it aims the tag call at an ARN that does not
|
|
51650
|
+
* name this bucket.
|
|
51651
|
+
*
|
|
51652
|
+
* KNOWN BOUND (pre-existing, not introduced by #1815): the region — and now
|
|
51653
|
+
* the partition derived from it — comes from `s3Client`, while the tag
|
|
51654
|
+
* calls that consume this ARN go through `s3ControlClient`, built from
|
|
51655
|
+
* `providerRegion` (`process.env['AWS_REGION']`). Those two can disagree,
|
|
51656
|
+
* so the ARN can name a different region than the client receiving it. The
|
|
51657
|
+
* region SEGMENT already had this exposure before the partition rode along
|
|
51658
|
+
* with it; unifying the two clients' region resolution is a separate change.
|
|
51580
51659
|
*/
|
|
51581
51660
|
async buildBucketArn(bucketName, accountId) {
|
|
51582
|
-
|
|
51661
|
+
const region = await this.getRegion();
|
|
51662
|
+
const account = accountId ?? await this.getAccountId();
|
|
51663
|
+
const { partition } = derivePartitionAndUrlSuffix(region);
|
|
51664
|
+
return `arn:${partition}:s3express:${region}:${account}:bucket/${bucketName}`;
|
|
51583
51665
|
}
|
|
51584
51666
|
/**
|
|
51585
51667
|
* Create an S3 Express Directory Bucket
|
|
@@ -67114,6 +67196,75 @@ function createLocalStateProvider$1(options, cdkdStackName, synthRegion) {
|
|
|
67114
67196
|
return createLocalStateProvider(options, cdkdStackName, synthRegion, cdkdExtraStateProviders);
|
|
67115
67197
|
}
|
|
67116
67198
|
|
|
67199
|
+
//#endregion
|
|
67200
|
+
//#region src/local/intrinsic-image.ts
|
|
67201
|
+
/**
|
|
67202
|
+
* Boundary shim over cdk-local's container-image intrinsic resolver for
|
|
67203
|
+
* `cdkd local invoke` / `start-api` / `run-task` — resolves the canonical
|
|
67204
|
+
* CDK 2.x `Fn::Join` shape for ECR image URIs (`lambda.DockerImageCode.fromEcr`
|
|
67205
|
+
* / ECS `ContainerImage.fromEcrRepository`) and the same-stack ECR `Fn::GetAtt`
|
|
67206
|
+
* Arn / RepositoryUri synthesis. The implementation lives in cdk-local and
|
|
67207
|
+
* cdkd consumes it instead of carrying a byte-identical copy.
|
|
67208
|
+
* `ImageResolutionContext` is re-exported as a type. See cdk-local's
|
|
67209
|
+
* `src/local/intrinsic-image.ts`.
|
|
67210
|
+
*
|
|
67211
|
+
* Two of the three symbols are bare re-exports. `derivePseudoParametersFromRegion`
|
|
67212
|
+
* is NOT: it is wrapped, for the reason below.
|
|
67213
|
+
*/
|
|
67214
|
+
/**
|
|
67215
|
+
* Derive `${AWS::Region}` / `${AWS::AccountId}` / `${AWS::Partition}` /
|
|
67216
|
+
* `${AWS::URLSuffix}` for the `Fn::Join` `Code.ImageUri` path (issue #637),
|
|
67217
|
+
* with the region CANONICALIZED to its lower-case spelling first.
|
|
67218
|
+
*
|
|
67219
|
+
* ## Why this is a wrapper rather than a re-export
|
|
67220
|
+
*
|
|
67221
|
+
* Issue [#1795](https://github.com/go-to-k/cdkd/issues/1795) canonicalizes the
|
|
67222
|
+
* region inside `derivePartitionAndUrlSuffix` (`src/utils/aws-partition.ts`),
|
|
67223
|
+
* so every cdkd-OWNED region -> partition/suffix derivation inherits ONE
|
|
67224
|
+
* normalization point. This helper is a FOURTH derivation that the fix
|
|
67225
|
+
* structurally could not reach (issue
|
|
67226
|
+
* [#1814](https://github.com/go-to-k/cdkd/issues/1814)): the implementation is
|
|
67227
|
+
* cdk-local's, and it carries its own partition table whose prefix tests are
|
|
67228
|
+
* case-sensitive in the same direction. So an upper-cased `--region CN-NORTH-1`
|
|
67229
|
+
* still fell through to the commercial partition here and synthesized
|
|
67230
|
+
* `<acct>.dkr.ecr.CN-NORTH-1.amazonaws.com/...` — a `cn-` region carrying the
|
|
67231
|
+
* commercial suffix, a host that does not exist — at the five call sites, across
|
|
67232
|
+
* three files, that reach this symbol:
|
|
67233
|
+
*
|
|
67234
|
+
* - `src/cli/commands/local-start-api.ts` (the `Fn::Join` `Code.ImageUri` path)
|
|
67235
|
+
* - `src/cli/commands/local-invoke-agentcore.ts` (x3)
|
|
67236
|
+
* - `src/local/lambda-resolver.ts`
|
|
67237
|
+
*
|
|
67238
|
+
* The preferred fix is upstream — lower-casing the region inside cdk-local's
|
|
67239
|
+
* own implementation, which would keep exactly one normalization point. This
|
|
67240
|
+
* is the filed FALLBACK: a thin canonicalizing boundary over the re-export,
|
|
67241
|
+
* the same shape `docker-image-builder.ts` uses for its error-class boundary.
|
|
67242
|
+
* It stays correct if upstream later canonicalizes too, because
|
|
67243
|
+
* {@link canonicalizeRegion} is idempotent — double-folding is a no-op.
|
|
67244
|
+
*
|
|
67245
|
+
* Canonicalizing the INPUT (rather than post-processing the result) is what
|
|
67246
|
+
* makes this complete: the returned `region` is substituted as
|
|
67247
|
+
* `${AWS::Region}` into every ARN the resolver builds, so a raw upper-cased
|
|
67248
|
+
* value would misspell those too, not just the derived suffix.
|
|
67249
|
+
*
|
|
67250
|
+
* `undefined` passes through untouched — upstream answers `undefined` for a
|
|
67251
|
+
* missing region and that verdict is not this shim's to change.
|
|
67252
|
+
*
|
|
67253
|
+
* ## What this deliberately does NOT fix
|
|
67254
|
+
*
|
|
67255
|
+
* Case is only half the agreement between the two tables. cdk-local's table
|
|
67256
|
+
* predates the three rows cdkd's issue #1764 added, so `us-isof-` / `eu-isoe-` /
|
|
67257
|
+
* `eusc-` regions resolve COMMERCIAL here even when spelled canonically — a
|
|
67258
|
+
* table-COVERAGE divergence, orthogonal to case, filed as issue
|
|
67259
|
+
* [#1821](https://github.com/go-to-k/cdkd/issues/1821). Widening this wrapper
|
|
67260
|
+
* into a second partition authority would fix it, but that is a design call of
|
|
67261
|
+
* its own; the divergence is pinned by a unit case so it fails loudly rather
|
|
67262
|
+
* than staying latent.
|
|
67263
|
+
*/
|
|
67264
|
+
function derivePseudoParametersFromRegion$1(region, accountId) {
|
|
67265
|
+
return derivePseudoParametersFromRegion(canonicalizeRegion(region), accountId);
|
|
67266
|
+
}
|
|
67267
|
+
|
|
67117
67268
|
//#endregion
|
|
67118
67269
|
//#region src/local/lambda-resolver.ts
|
|
67119
67270
|
var LocalInvokeResolutionError = class LocalInvokeResolutionError extends Error {
|
|
@@ -67323,7 +67474,7 @@ function extractImageUri$1(value, logicalId, stackName, resources, region) {
|
|
|
67323
67474
|
if (typeof sub === "string" && sub.length > 0) return sub;
|
|
67324
67475
|
if (Array.isArray(sub) && typeof sub[0] === "string") return sub[0];
|
|
67325
67476
|
if ("Fn::Join" in obj) {
|
|
67326
|
-
const pseudoParameters = derivePseudoParametersFromRegion(region);
|
|
67477
|
+
const pseudoParameters = derivePseudoParametersFromRegion$1(region);
|
|
67327
67478
|
const joinResolved = tryResolveImageFnJoin(value, resources, pseudoParameters ? { pseudoParameters } : void 0);
|
|
67328
67479
|
if (joinResolved.kind === "resolved") return joinResolved.uri;
|
|
67329
67480
|
if (joinResolved.kind === "needs-state") throw new LocalInvokeResolutionError(`Lambda '${logicalId}' in ${stackName} references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. cdkd local invoke cannot resolve the repository URI without state — deploy the stack first (so cdkd records the repository physical id), rebuild via lambda.DockerImageCode.fromImageAsset, or pin a public image.`);
|
|
@@ -71289,7 +71440,7 @@ function extractImageUri(value, logicalId, stackName, resources, region) {
|
|
|
71289
71440
|
if (typeof sub === "string" && sub.length > 0) return sub;
|
|
71290
71441
|
if (Array.isArray(sub) && typeof sub[0] === "string") return sub[0];
|
|
71291
71442
|
if ("Fn::Join" in obj) {
|
|
71292
|
-
const pseudoParameters = derivePseudoParametersFromRegion(region);
|
|
71443
|
+
const pseudoParameters = derivePseudoParametersFromRegion$1(region);
|
|
71293
71444
|
const joinResolved = tryResolveImageFnJoin(value, resources, pseudoParameters ? { pseudoParameters } : void 0);
|
|
71294
71445
|
if (joinResolved.kind === "resolved") return joinResolved.uri;
|
|
71295
71446
|
if (joinResolved.kind === "needs-state") throw new Error(`Lambda '${logicalId}' in ${stackName} references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. cdkd local start-api cannot resolve the repository URI without state — deploy the stack first (so cdkd records the repository physical id), rebuild via lambda.DockerImageCode.fromImageAsset, or pin a public image.`);
|
|
@@ -73366,6 +73517,7 @@ async function localInvokeAgentCoreCommand(target, options) {
|
|
|
73366
73517
|
const logger = getLogger();
|
|
73367
73518
|
if (options.verbose) logger.setLevel("debug");
|
|
73368
73519
|
warnIfDeprecatedRegion(options);
|
|
73520
|
+
if (options.region !== void 0) options.region = canonicalizeRegion(options.region);
|
|
73369
73521
|
let containerId;
|
|
73370
73522
|
let stopLogs;
|
|
73371
73523
|
let sigintHandler;
|
|
@@ -73786,7 +73938,7 @@ async function buildSigV4HeadersIfRequested(options, resolved, loaded, host, por
|
|
|
73786
73938
|
getLogger().warn(`Runtime '${resolved.logicalId}' declares a customJwtAuthorizer; --sigv4 ignored (JWT path takes precedence).`);
|
|
73787
73939
|
return;
|
|
73788
73940
|
}
|
|
73789
|
-
const region = options.region ?? options.stackRegion ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? resolved.stack.region;
|
|
73941
|
+
const region = canonicalizeRegion(options.region ?? options.stackRegion ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? resolved.stack.region);
|
|
73790
73942
|
if (!region) throw new CdkdError("--sigv4: no region resolved for the AgentCore signing scope. Pass --region <region>, set AWS_REGION, or use --from-cfn-stack with a region-bound stack.", "LOCAL_INVOKE_AGENTCORE_SIGV4_NO_REGION");
|
|
73791
73943
|
const signed = await signAgentCoreInvocation({
|
|
73792
73944
|
credentials: await resolveHostCredentialsForSigV4(options, resolved, loaded, region),
|
|
@@ -73932,7 +74084,7 @@ async function resolveAgentCoreCodeImageFromS3(resolved, code, s3Source, options
|
|
|
73932
74084
|
key: s3Source.key,
|
|
73933
74085
|
...s3Source.versionId !== void 0 && { versionId: s3Source.versionId }
|
|
73934
74086
|
};
|
|
73935
|
-
const region = options.region ?? options.stackRegion ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? resolved.stack.region;
|
|
74087
|
+
const region = canonicalizeRegion(options.region ?? options.stackRegion ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? resolved.stack.region);
|
|
73936
74088
|
const assumeRoleArn = resolveAssumeRoleArn(options, resolved, loaded);
|
|
73937
74089
|
let credentials;
|
|
73938
74090
|
if (assumeRoleArn) try {
|
|
@@ -73987,7 +74139,7 @@ async function buildContainerEnv(resolved, options, profileCredentials, profileC
|
|
|
73987
74139
|
resources: imageContext?.stateResources ?? loaded.resources,
|
|
73988
74140
|
consumerRegion: loaded.region
|
|
73989
74141
|
};
|
|
73990
|
-
const pseudo = imageContext?.pseudoParameters ?? derivePseudoParametersFromRegion(loaded.region);
|
|
74142
|
+
const pseudo = imageContext?.pseudoParameters ?? derivePseudoParametersFromRegion$1(loaded.region);
|
|
73991
74143
|
if (pseudo) subContext.pseudoParameters = pseudo;
|
|
73992
74144
|
if (imageContext?.stateParameters) subContext.parameters = imageContext.stateParameters;
|
|
73993
74145
|
if (imageContext?.stateSensitiveParameters?.length) subContext.sensitiveParameters = new Set(imageContext.stateSensitiveParameters);
|
|
@@ -74043,7 +74195,7 @@ async function resolveFromS3BucketIntrinsic(resolved, stateProvider, loaded, ima
|
|
|
74043
74195
|
resources: imageContext?.stateResources ?? loaded.resources,
|
|
74044
74196
|
consumerRegion: loaded.region
|
|
74045
74197
|
};
|
|
74046
|
-
const pseudo = imageContext?.pseudoParameters ?? derivePseudoParametersFromRegion(loaded.region);
|
|
74198
|
+
const pseudo = imageContext?.pseudoParameters ?? derivePseudoParametersFromRegion$1(loaded.region);
|
|
74047
74199
|
if (pseudo) subContext.pseudoParameters = pseudo;
|
|
74048
74200
|
const crossStackResolver = await stateProvider.buildCrossStackResolver(loaded.region);
|
|
74049
74201
|
if (crossStackResolver) subContext.crossStackResolver = crossStackResolver;
|
|
@@ -74071,7 +74223,7 @@ function describeIntrinsic(value) {
|
|
|
74071
74223
|
*/
|
|
74072
74224
|
async function buildAgentCoreImageContext(candidate, stateProvider, options) {
|
|
74073
74225
|
const logger = getLogger();
|
|
74074
|
-
const region = options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? candidate.region;
|
|
74226
|
+
const region = canonicalizeRegion(options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? candidate.region);
|
|
74075
74227
|
let accountId;
|
|
74076
74228
|
try {
|
|
74077
74229
|
accountId = await resolveCallerAccountId(region, options.profile);
|
|
@@ -74079,7 +74231,7 @@ async function buildAgentCoreImageContext(candidate, stateProvider, options) {
|
|
|
74079
74231
|
logger.warn(`--from-cfn-stack: STS GetCallerIdentity failed: ${err instanceof Error ? err.message : String(err)}. A same-stack ECR image URI referencing \${AWS::AccountId} may not resolve.`);
|
|
74080
74232
|
}
|
|
74081
74233
|
const context = {};
|
|
74082
|
-
const pseudo = derivePseudoParametersFromRegion(region, accountId);
|
|
74234
|
+
const pseudo = derivePseudoParametersFromRegion$1(region, accountId);
|
|
74083
74235
|
if (pseudo) context.pseudoParameters = pseudo;
|
|
74084
74236
|
const loaded = await stateProvider.load(candidate.stackName, candidate.region);
|
|
74085
74237
|
if (loaded) {
|
|
@@ -74123,7 +74275,7 @@ async function applyAgentCoreCredentialEnv(dockerEnv, args) {
|
|
|
74123
74275
|
const logger = getLogger();
|
|
74124
74276
|
let assumeSucceeded = false;
|
|
74125
74277
|
if (args.assumeRoleArn) {
|
|
74126
|
-
const stsRegion = args.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"];
|
|
74278
|
+
const stsRegion = canonicalizeRegion(args.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"]);
|
|
74127
74279
|
try {
|
|
74128
74280
|
const creds = await assumeAgentCoreExecutionRole(args.assumeRoleArn, stsRegion);
|
|
74129
74281
|
dockerEnv["AWS_ACCESS_KEY_ID"] = creds.accessKeyId;
|
|
@@ -76438,7 +76590,7 @@ function createMigrateCommand() {
|
|
|
76438
76590
|
*/
|
|
76439
76591
|
function buildProgram() {
|
|
76440
76592
|
const program = new Command();
|
|
76441
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.283.
|
|
76593
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.283.3");
|
|
76442
76594
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
76443
76595
|
const { profile } = actionCommand.optsWithGlobals();
|
|
76444
76596
|
if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
|