@go-to-k/cdkd 0.283.1 → 0.283.2

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
- 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-InwDI9o0.js";
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-DuYBir2W.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-R3IdAR_3.js";
4
+ import { t as ASGProvider } from "./asg-provider-Cl4ATw1l.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
- return `arn:aws:sqs:${await this.sqsClient.config.region()}:${accountId}:${queueName}`;
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
- return `arn:aws:sqs:unknown:unknown:${queueName}`;
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
- return `arn:aws:logs:${await this.logsClient.config.region() || process.env["AWS_REGION"] || "us-east-1"}:${accountId}:log-group:${logGroupName}:*`;
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
- return `arn:aws:logs:unknown:unknown:log-group:${logGroupName}:*`;
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
- return `arn:aws:cloudwatch:${await this.cloudWatchClient.config.region() || process.env["AWS_REGION"] || "us-east-1"}:*:alarm:${alarmName}`;
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
- return `arn:aws:cloudwatch:*:*:alarm:${alarmName}`;
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: `arn:aws:apigateway:{region}::/restapis/{restApiId}/stages/{stageName}`.
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
- return `arn:aws:apigateway:${await this.apiGatewayClient.config.region()}::/restapis/${restApiId}/stages/${stageName}`;
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:aws:servicediscovery:{region}:{account}:namespace/{namespaceId}
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
- return `arn:aws:servicediscovery:${await this.getClient().config.region()}:${accountId}:namespace/${namespaceId}`;
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`). Budgets ARNs carry no region component. The `aws`
43398
- * partition is assumed — consistent with other providers that construct
43399
- * ARNs; non-`aws` partitions are not supported by cdkd today.
43400
- */
43401
- budgetArn(accountId, budgetName) {
43402
- return `arn:aws:budgets::${accountId}:budget/${budgetName}`;
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:aws:budgets::{account}:budget/{name}`, verified
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: `arn:aws:s3express:{region}:{account}:bucket/{name}`.
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
- return `arn:aws:s3express:${await this.getRegion()}:${accountId ?? await this.getAccountId()}:bucket/${bucketName}`;
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
@@ -76438,7 +76520,7 @@ function createMigrateCommand() {
76438
76520
  */
76439
76521
  function buildProgram() {
76440
76522
  const program = new Command();
76441
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.283.1");
76523
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.283.2");
76442
76524
  program.hook("preAction", (_thisCommand, actionCommand) => {
76443
76525
  const { profile } = actionCommand.optsWithGlobals();
76444
76526
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;