@go-to-k/cdkd 0.285.11 → 0.285.13

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.
@@ -1,8 +1,8 @@
1
- import { $ as DEFAULT_STATE_PREFIX, $n as resolveUseCdkBootstrapAssets, $t as isSingleDynamicReferenceToken, A as bold, An as validateAssetBucketName, Ar as LocalStartServiceError, At as requireConfigObject, B as secretBearingStateKeyWarning, Bn as runDockerStreaming, Bt as DiffCalculator, C as unsupportedFinalSnapshotError, Cn as BOOTSTRAP_MARKER_PREFIX, Ct as assertRegionMatch, D as isStatefulRecreateTargetSync, Dn as isCrossRegionRedirect, Dr as DynamicReferenceRegionAmbiguousError, Dt as readConfigString, E as MULTI_REGION_RECREATE_BLOCKED_TYPES, En as getBootstrapMarkerKey, Er as DeployCancelledError, Et as configStringRefusal, F as yellow, Fn as dockerSpawnEnvWithSensitive, Fr as ProvisioningError, Ft as s3BucketDomainName, G as clearOnUpdateRemoval, Gn as getDefaultStateBucketName, Gr as withErrorHandling, Gt as TemplateParser, H as getCurrentResourceSecrets, Hn as getDockerImageBySourceHash, Ht as describeTypeWithThrottleRetry, I as collectDeclaredOutputNames, In as formatDockerLoginError, Ir as ResourceTimeoutError, It as s3BucketDualStackDomainName, J as findSilentDropProperties, Jn as resolveAutoAssetStorage, Jr as isThrottlingError, Jt as TEMPLATE_SOURCED_RULES, K as ProviderRegistry, Kn as getLegacyStateBucketName, Kr as isMarkedNonRetryable, Kt as STATE_SOURCED_CROSS_GENERATION_RULES, L as collectPublishedOutputNames, Ln as getDockerCmd, Lr as ResourceUpdateNotSupportedError, Lt as s3BucketRegionalDomainName, M as gray, Mn as buildDenyExternalAccessPolicy, Mr as MissingCdkCliError, Mt as classifyReplaySecretRegion, N as green, Nn as describeAwsFailure, Nr as NestedStackChildDirectDestroyError, Nt as producerRegionsFromState, O as renderStatefulReason, On as parseBootstrapMarker, Or as LocalInvokeBuildError$1, Ot as replayWarn, P as red, Pn as buildDockerImage, Pr as PartialFailureError, Pt as s3BucketArn, Q as CUSTOM_RESOURCE_RESPONSE_PREFIX, Qn as resolveStateBucketWithDefaultAndSource, Qr as retryClassificationText, Qt as errorCauseChain, R as exportAliasCollisionScrubWarning, Rn as partitionSensitiveEnv, Rr as StackHasActiveImportsError, Rt as s3BucketWebsiteUrl, S as refusesFinalSnapshot, Sn as AssetModeResolver, Sr as CdkdError, St as resolveExplicitPhysicalId, T as extractDeploymentEventError, Tn as ensureAssetStorage, Tt as configBooleanRefusal, U as IAMRoleProvider, Un as Synthesizer, Ut as withRetry, V as stateKeySecretExposure, Vn as AssetManifestLoader, Vt as INTRINSIC_KEYS, W as collectInlinePolicyNamesManagedBySiblings, Wn as synthesisStatusMessage, Wr as normalizeAwsError, Wt as DagBuilder, X as maskDeep, Xn as resolveSkipPrefix, Xr as markNonRetryable, Xt as createSecretMasker, Y as createMaskedRetryLogger, Yn as resolveCaptureObservedState, Yr as isTransientServerError, Yt as carriesSecretMask, Z as maskerOrIdentity, Zn as resolveStateBucketWithDefault, Zr as markRedactedCause, Zt as dynamicReferenceTokens, _ as PRE_DELETE_SNAPSHOT_TYPES, _n as createAssetRedirectResolver, _r as AwsClients, _t as isUnboundTemplateParameter, a as DeploymentEventsStore, an as scrubResourceRecord, ar as findLargeInlineResources, at as CloudControlProvider, b as createPreDeleteFinalSnapshot, bn as escapeRegExp, br as setAwsClients, bt as WAFv2WebACLProvider, c as replayFailedOperations, cn as rebuildClientForBucketRegion, cr as displaySafe, ct as deleteIndeterminateGuards, d as updatePartialReason, dn as importableOutputs, dr as canonicalizeRegion, dt as isTerminationProtectionPropagationError, en as maskSecretsInError, er as stateBucketExistenceConfirmed, et as beginCommandInterruptScope, f as withResourceDeadline, fn as shouldRetainResource, fr as derivePartitionAndUrlSuffix, ft as IntrinsicFunctionResolver, g as ATOMIC_FINAL_SNAPSHOT_TYPES, gn as buildAssetRedirectMap, gr as resolveBucketRegion, gt as getAccountInfo, h as computeImplicitDeleteEdges, hn as WorkGraph, ht as coerceParameterTypedValue, i as DeploymentEventsReader, in as redactSecretsForState, ir as MIGRATE_TMP_PREFIX, it as startInterruptWatch, j as cyan, jn as validateContainerRepoName, jt as requireConfigString, k as formatResourceLine, kn as readBootstrapMarkerBody, kr as LocalMigrateError, kt as requireConfigArray, l as replayRollback, ln as exportNamesCarriedFrom, lr as expectedOwnerParam, lt as deleteSkipReason, m as IMPLICIT_DELETE_DEPENDENCIES, mn as stringifyValue, mr as processStackMessages, mt as cfnRefValueFromPhysicalId, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as recordMaskOnlyValue, nr as CFN_TEMPLATE_BODY_LIMIT, nt as interruptWatchListenerCount, o as planFailedOps, on as LockManager, or as uploadCfnTemplate, ot as slowCcOperationTimeoutMs, p as maskingRetryLogger, pn as AssetPublisher, pr as AssemblyReader, pt as carriesDynamicReference, q as findActionableSilentDrops, qn as resolveApp, qr as isRetryableTransientError, qt as STATE_SOURCED_READBACK_RULES, r as DeployEngine, rn as recoverMaskedOutput, rr as CFN_TEMPLATE_URL_LIMIT, rt as isInterruptedWaitError, s as planRollback, sn as S3StateBackend, sr as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, st as UNSPECIFIED_SKIP_REASON, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as maskSecretsInText, tr as warnDeprecatedNoPrefixCliFlag, tt as endCommandInterruptScope, u as updatePartialMessage, un as importableOutputKeys, ur as PARTITION_TABLE, ut as disableInstanceApiTermination, v as buildFinalSnapshotIdentifier, vn as loadPublishableAssetManifest, vr as getAwsClients, vt as parameterTypeMayLoseSecretIdentity, w as makeCanonicalizePropertiesFn, wn as assertAssetBucketRegion, wr as CrossAccountSecretRefusalError, wt as coerceCfnBoolean, x as isFinalSnapshotError, xn as stripControlChars, xt as normalizeAwsTagsToCfn, y as ccRoutedFinalSnapshotError, yn as rewriteTemplateAssetReferences, yr as resetAwsClients, yt as refStateLookupFromResource, z as isExportAliasCollision, zn as runDockerForeground, zr as StackTerminationProtectionError, zt as applyRoleArnIfSet } from "./deploy-engine-CJdl4I5l.js";
1
+ import { $ as DEFAULT_STATE_PREFIX, $n as resolveUseCdkBootstrapAssets, $t as isSingleDynamicReferenceToken, A as bold, An as validateAssetBucketName, Ar as LocalStartServiceError, At as requireConfigObject, B as secretBearingStateKeyWarning, Bn as runDockerStreaming, Bt as DiffCalculator, C as unsupportedFinalSnapshotError, Cn as BOOTSTRAP_MARKER_PREFIX, Ct as assertRegionMatch, D as isStatefulRecreateTargetSync, Dn as isCrossRegionRedirect, Dr as DynamicReferenceRegionAmbiguousError, Dt as readConfigString, E as MULTI_REGION_RECREATE_BLOCKED_TYPES, En as getBootstrapMarkerKey, Er as DeployCancelledError, Et as configStringRefusal, F as yellow, Fn as dockerSpawnEnvWithSensitive, Fr as ProvisioningError, Ft as s3BucketDomainName, G as clearOnUpdateRemoval, Gn as getDefaultStateBucketName, Gr as withErrorHandling, Gt as TemplateParser, H as getCurrentResourceSecrets, Hn as getDockerImageBySourceHash, Ht as describeTypeWithThrottleRetry, I as collectDeclaredOutputNames, In as formatDockerLoginError, Ir as ResourceTimeoutError, It as s3BucketDualStackDomainName, J as findSilentDropProperties, Jn as resolveAutoAssetStorage, Jr as isThrottlingError, Jt as TEMPLATE_SOURCED_RULES, K as ProviderRegistry, Kn as getLegacyStateBucketName, Kr as isMarkedNonRetryable, Kt as STATE_SOURCED_CROSS_GENERATION_RULES, L as collectPublishedOutputNames, Ln as getDockerCmd, Lr as ResourceUpdateNotSupportedError, Lt as s3BucketRegionalDomainName, M as gray, Mn as buildDenyExternalAccessPolicy, Mr as MissingCdkCliError, Mt as classifyReplaySecretRegion, N as green, Nn as describeAwsFailure, Nr as NestedStackChildDirectDestroyError, Nt as producerRegionsFromState, O as renderStatefulReason, On as parseBootstrapMarker, Or as LocalInvokeBuildError$1, Ot as replayWarn, P as red, Pn as buildDockerImage, Pr as PartialFailureError, Pt as s3BucketArn, Q as CUSTOM_RESOURCE_RESPONSE_PREFIX, Qn as resolveStateBucketWithDefaultAndSource, Qr as retryClassificationText, Qt as errorCauseChain, R as exportAliasCollisionScrubWarning, Rn as partitionSensitiveEnv, Rr as StackHasActiveImportsError, Rt as s3BucketWebsiteUrl, S as refusesFinalSnapshot, Sn as AssetModeResolver, Sr as CdkdError, St as resolveExplicitPhysicalId, T as extractDeploymentEventError, Tn as ensureAssetStorage, Tt as configBooleanRefusal, U as IAMRoleProvider, Un as Synthesizer, Ut as withRetry, V as stateKeySecretExposure, Vn as AssetManifestLoader, Vt as INTRINSIC_KEYS, W as collectInlinePolicyNamesManagedBySiblings, Wn as synthesisStatusMessage, Wr as normalizeAwsError, Wt as DagBuilder, X as maskDeep, Xn as resolveSkipPrefix, Xr as markNonRetryable, Xt as createSecretMasker, Y as createMaskedRetryLogger, Yn as resolveCaptureObservedState, Yr as isTransientServerError, Yt as carriesSecretMask, Z as maskerOrIdentity, Zn as resolveStateBucketWithDefault, Zr as markRedactedCause, Zt as dynamicReferenceTokens, _ as PRE_DELETE_SNAPSHOT_TYPES, _n as createAssetRedirectResolver, _r as AwsClients, _t as isUnboundTemplateParameter, a as DeploymentEventsStore, an as scrubResourceRecord, ar as findLargeInlineResources, at as CloudControlProvider, b as createPreDeleteFinalSnapshot, bn as escapeRegExp, br as setAwsClients, bt as WAFv2WebACLProvider, c as replayFailedOperations, cn as rebuildClientForBucketRegion, cr as displaySafe, ct as deleteIndeterminateGuards, d as updatePartialReason, dn as importableOutputs, dr as canonicalizeRegion, dt as isTerminationProtectionPropagationError, en as maskSecretsInError, er as stateBucketExistenceConfirmed, et as beginCommandInterruptScope, f as withResourceDeadline, fn as shouldRetainResource, fr as derivePartitionAndUrlSuffix, ft as IntrinsicFunctionResolver, g as ATOMIC_FINAL_SNAPSHOT_TYPES, gn as buildAssetRedirectMap, gr as resolveBucketRegion, gt as getAccountInfo, h as computeImplicitDeleteEdges, hn as WorkGraph, ht as coerceParameterTypedValue, i as DeploymentEventsReader, in as redactSecretsForState, ir as MIGRATE_TMP_PREFIX, it as startInterruptWatch, j as cyan, jn as validateContainerRepoName, jt as requireConfigString, k as formatResourceLine, kn as readBootstrapMarkerBody, kr as LocalMigrateError, kt as requireConfigArray, l as replayRollback, ln as exportNamesCarriedFrom, lr as expectedOwnerParam, lt as deleteSkipReason, m as IMPLICIT_DELETE_DEPENDENCIES, mn as stringifyValue, mr as processStackMessages, mt as cfnRefValueFromPhysicalId, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as recordMaskOnlyValue, nr as CFN_TEMPLATE_BODY_LIMIT, nt as interruptWatchListenerCount, o as planFailedOps, on as LockManager, or as uploadCfnTemplate, ot as slowCcOperationTimeoutMs, p as maskingRetryLogger, pn as AssetPublisher, pr as AssemblyReader, pt as carriesDynamicReference, q as findActionableSilentDrops, qn as resolveApp, qr as isRetryableTransientError, qt as STATE_SOURCED_READBACK_RULES, r as DeployEngine, rn as recoverMaskedOutput, rr as CFN_TEMPLATE_URL_LIMIT, rt as isInterruptedWaitError, s as planRollback, sn as S3StateBackend, sr as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, st as UNSPECIFIED_SKIP_REASON, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as maskSecretsInText, tr as warnDeprecatedNoPrefixCliFlag, tt as endCommandInterruptScope, u as updatePartialMessage, un as importableOutputKeys, ur as PARTITION_TABLE, ut as disableInstanceApiTermination, v as buildFinalSnapshotIdentifier, vn as loadPublishableAssetManifest, vr as getAwsClients, vt as parameterTypeMayLoseSecretIdentity, w as makeCanonicalizePropertiesFn, wn as assertAssetBucketRegion, wr as CrossAccountSecretRefusalError, wt as coerceCfnBoolean, x as isFinalSnapshotError, xn as stripControlChars, xt as normalizeAwsTagsToCfn, y as ccRoutedFinalSnapshotError, yn as rewriteTemplateAssetReferences, yr as resetAwsClients, yt as refStateLookupFromResource, z as isExportAliasCollision, zn as runDockerForeground, zr as StackTerminationProtectionError, zt as applyRoleArnIfSet } from "./deploy-engine-DhMm2M33.js";
2
2
  import { _ as withStackName, c as PATTERN_B_NAME_OPTIONS, f as generateResourceName, g as withSkipPrefix, i as reserveStdoutForPayload, l as PATTERN_B_NAME_PROPERTIES, m as getCurrentStackName, n as getLogger, o as runStackBuffered, p as generateResourceNameWithFallback, s as getLiveRenderer, u as PATTERN_B_RESOURCE_TYPES } from "./logger-Dw-3y48G.js";
3
3
  import { t as awsClientDefaults } from "./aws-client-defaults-D-iYiIJ6.js";
4
- import { t as getCdkdVersion } from "./version-CHHsJMqE.js";
5
- import { t as ASGProvider } from "./asg-provider--XFrKRbw.js";
4
+ import { t as getCdkdVersion } from "./version-FLW4rE5A.js";
5
+ import { t as ASGProvider } from "./asg-provider-DcFgnQQO.js";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
7
7
  import { createHash, randomBytes, randomUUID } from "node:crypto";
8
8
  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";
@@ -45,6 +45,7 @@ import { writeFileSync as writeFileSync$1 } from "fs";
45
45
  import { Document, Pair, Scalar, YAMLMap, YAMLSeq, isScalar, parse, stringify, visit } from "yaml";
46
46
  import * as zlib from "node:zlib";
47
47
  import { ApplicationAutoScalingClient, DeleteScalingPolicyCommand, DeregisterScalableTargetCommand, DescribeScalableTargetsCommand, DescribeScalingPoliciesCommand, PutScalingPolicyCommand, RegisterScalableTargetCommand } from "@aws-sdk/client-application-auto-scaling";
48
+ import { isDeepStrictEqual, promisify } from "node:util";
48
49
  import { ApiGatewayV2Client, CreateApiCommand, CreateAuthorizerCommand as CreateAuthorizerCommand$1, CreateIntegrationCommand, CreateRouteCommand as CreateRouteCommand$1, CreateStageCommand as CreateStageCommand$1, DeleteAccessLogSettingsCommand, DeleteApiCommand, DeleteAuthorizerCommand as DeleteAuthorizerCommand$1, DeleteCorsConfigurationCommand, DeleteIntegrationCommand, DeleteRouteCommand as DeleteRouteCommand$1, DeleteRouteRequestParameterCommand, DeleteRouteSettingsCommand, DeleteStageCommand as DeleteStageCommand$1, GetApiCommand, GetAuthorizerCommand as GetAuthorizerCommand$1, GetIntegrationCommand, GetRouteCommand, GetStageCommand as GetStageCommand$1, NotFoundException as NotFoundException$3, UpdateApiCommand, UpdateAuthorizerCommand as UpdateAuthorizerCommand$1, UpdateIntegrationCommand, UpdateRouteCommand, UpdateStageCommand as UpdateStageCommand$1 } from "@aws-sdk/client-apigatewayv2";
49
50
  import { CreateStateMachineCommand, DeleteStateMachineCommand, DescribeStateMachineCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$11, SFNClient, StateMachineDoesNotExist, TagResourceCommand as TagResourceCommand$13, UntagResourceCommand as UntagResourceCommand$13, UpdateStateMachineCommand } from "@aws-sdk/client-sfn";
50
51
  import { CreateClusterCommand, CreateServiceCommand, DeleteClusterCommand, DeleteServiceCommand, DeregisterTaskDefinitionCommand, DescribeClustersCommand, DescribeServicesCommand, DescribeTaskDefinitionCommand, ECSClient, PutClusterCapacityProvidersCommand, RegisterTaskDefinitionCommand, TagResourceCommand as TagResourceCommand$14, UntagResourceCommand as UntagResourceCommand$14, UpdateClusterCommand, UpdateServiceCommand, waitUntilServicesStable } from "@aws-sdk/client-ecs";
@@ -73,7 +74,6 @@ import { CreateNamespaceCommand, CreateTableBucketCommand, CreateTableCommand as
73
74
  import { createLocalStartAgentCoreCommand, createLocalStartCloudFrontCommand, createLocalStateProvider, getEmbedConfig, isCfnFlagPresent, listTargets, rejectExplicitCfnStackWithMultipleStacks, resolveCfnFallbackRegion, setEmbedConfig, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync } from "cdk-local";
74
75
  import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, EcsTaskResolutionError, HOST_GATEWAY_MIN_VERSION, LocalInvokeBuildError, MCP_CONTAINER_PORT, MCP_PATH, a2aInvokeOnce, addAlbSpecificOptions, addCommonEcsServiceOptions, addStartServiceSpecificOptions, albStrategy, architectureToPlatform, attachAuthorizers, attachStageContext, availableApiIdentifiers, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildStageMap, classifySourceChange, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, filterRoutesByApiIdentifier, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, materializeLayerFromArn, mcpInvokeOnce, parseConnectionsPath, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readMtlsMaterialsFromDisk, resolveAgentCoreTarget, resolveEnvVars, resolveHostGatewayExtraHosts, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, runEcsServiceEmulator, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing } from "cdk-local/internal";
75
76
  import { createServer } from "node:net";
76
- import { promisify } from "node:util";
77
77
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
78
78
  import { mkdtemp, rm, writeFile } from "node:fs/promises";
79
79
  import { WebSocketServer } from "ws";
@@ -1098,7 +1098,10 @@ async function resolveSdkDefaultRegion(profile) {
1098
1098
  const { STSClient } = await import("@aws-sdk/client-sts");
1099
1099
  let client;
1100
1100
  try {
1101
- client = new STSClient({ ...profile && { profile } });
1101
+ client = new STSClient({
1102
+ ...awsClientDefaults({ profile }),
1103
+ ...profile && { profile }
1104
+ });
1102
1105
  return await client.config.region() || void 0;
1103
1106
  } catch {
1104
1107
  return;
@@ -1290,6 +1293,7 @@ async function emptyAndDeleteBucket(s3Client, bucket, accountId, label, logger,
1290
1293
  */
1291
1294
  async function deleteContainerRepo(containerRepo, region, profile, logger) {
1292
1295
  const ecrClient = new ECRClient({
1296
+ ...awsClientDefaults({ profile }),
1293
1297
  region,
1294
1298
  ...profile && { profile }
1295
1299
  });
@@ -1390,6 +1394,7 @@ async function bootstrapDestroyCommand(options) {
1390
1394
  let region = effective.region;
1391
1395
  if (regionNeedsReconciliation(effective)) {
1392
1396
  const probeBackend = new S3StateBackend(new S3Client({
1397
+ ...awsClientDefaults({ profile: options.profile }),
1393
1398
  region: effective.region,
1394
1399
  ...options.profile && { profile: options.profile }
1395
1400
  }), {
@@ -1418,6 +1423,7 @@ async function bootstrapDestroyCommand(options) {
1418
1423
  if (awsClients !== accountClients) accountClients.destroy();
1419
1424
  setAwsClients(awsClients);
1420
1425
  const markerS3Client = new S3Client({
1426
+ ...awsClientDefaults({ profile: options.profile }),
1421
1427
  region,
1422
1428
  ...options.profile && { profile: options.profile }
1423
1429
  });
@@ -19281,7 +19287,10 @@ var DynamoDBGlobalTableProvider = class {
19281
19287
  getRegionalClient(region) {
19282
19288
  const cached = this.regionalClientCache.get(region);
19283
19289
  if (cached) return cached;
19284
- const client = new DynamoDBClient({ region });
19290
+ const client = new DynamoDBClient({
19291
+ ...awsClientDefaults(),
19292
+ region
19293
+ });
19285
19294
  this.regionalClientCache.set(region, client);
19286
19295
  return client;
19287
19296
  }
@@ -19299,7 +19308,10 @@ var DynamoDBGlobalTableProvider = class {
19299
19308
  getRegionalAutoScalingClient(region) {
19300
19309
  const cached = this.regionalAutoScalingClientCache.get(region);
19301
19310
  if (cached) return cached;
19302
- const client = new ApplicationAutoScalingClient({ region });
19311
+ const client = new ApplicationAutoScalingClient({
19312
+ ...awsClientDefaults(),
19313
+ region
19314
+ });
19303
19315
  this.regionalAutoScalingClientCache.set(region, client);
19304
19316
  return client;
19305
19317
  }
@@ -19314,7 +19326,10 @@ var DynamoDBGlobalTableProvider = class {
19314
19326
  async getLocalAutoScalingClient() {
19315
19327
  if (this.localAutoScalingClient) return this.localAutoScalingClient;
19316
19328
  const region = await this.dynamoDBClient.config.region() ?? "";
19317
- this.localAutoScalingClient = new ApplicationAutoScalingClient({ region });
19329
+ this.localAutoScalingClient = new ApplicationAutoScalingClient({
19330
+ ...awsClientDefaults(),
19331
+ region
19332
+ });
19318
19333
  return this.localAutoScalingClient;
19319
19334
  }
19320
19335
  /**
@@ -20916,7 +20931,10 @@ var DynamoDBGlobalTableProvider = class {
20916
20931
  async readAutoScalingSettings(tableName, scalableDimension, client, indexName) {
20917
20932
  const resourceId = autoScalingResourceId(tableName, indexName);
20918
20933
  try {
20919
- const asClient = client ?? new ApplicationAutoScalingClient({ region: await this.dynamoDBClient.config.region() ?? "" });
20934
+ const asClient = client ?? new ApplicationAutoScalingClient({
20935
+ ...awsClientDefaults(),
20936
+ region: await this.dynamoDBClient.config.region() ?? ""
20937
+ });
20920
20938
  const targets = (await asClient.send(new DescribeScalableTargetsCommand({
20921
20939
  ServiceNamespace: "dynamodb",
20922
20940
  ResourceIds: [resourceId],
@@ -23673,6 +23691,27 @@ function hasDescriptor(params) {
23673
23691
  //#endregion
23674
23692
  //#region src/provisioning/providers/secretsmanager-secret-provider.ts
23675
23693
  /**
23694
+ * `value` after a JSON round-trip: `undefined` members dropped, exactly the
23695
+ * shape state.json can hold. Used so the two sides of the issue-#2472
23696
+ * comparison in {@link SecretsManagerSecretProvider.changedSecretValue} are
23697
+ * spelled the same way, and so a null-prototype object (what
23698
+ * `redactSecretsForState` builds) compares equal to a plain one —
23699
+ * `isDeepStrictEqual` checks prototypes. `undefined` round-trips to `undefined`.
23700
+ */
23701
+ function asJson(value) {
23702
+ return value === void 0 ? void 0 : JSON.parse(JSON.stringify(value));
23703
+ }
23704
+ /**
23705
+ * A `SecretString` about to go on the wire must be a string. Pre-#2472 a
23706
+ * non-string was forwarded through a cast and left to AWS; a silent drop is
23707
+ * the worse failure for a value the user wrote, so the SHAPE is named — never
23708
+ * the value. Shared by `create()` and `update()` so the two cannot disagree.
23709
+ */
23710
+ function requireSecretStringShape(literal) {
23711
+ if (typeof literal === "string") return literal;
23712
+ throw new Error(`SecretString must be a string, got ${literal === null ? "null" : Array.isArray(literal) ? "array" : typeof literal}`);
23713
+ }
23714
+ /**
23676
23715
  * AWS Secrets Manager Secret Provider
23677
23716
  *
23678
23717
  * Implements resource provisioning for AWS::SecretsManager::Secret using the Secrets Manager SDK.
@@ -23709,7 +23748,7 @@ var SecretsManagerSecretProvider = class {
23709
23748
  let secretString;
23710
23749
  const generateConfig = properties["GenerateSecretString"];
23711
23750
  if (generateConfig) secretString = this.generateSecretString(generateConfig);
23712
- else if (properties["SecretString"]) secretString = properties["SecretString"];
23751
+ else if (properties["SecretString"] !== void 0 && properties["SecretString"] !== "") secretString = requireSecretStringShape(properties["SecretString"]);
23713
23752
  const createParams = { Name: name };
23714
23753
  if (secretString) createParams.SecretString = secretString;
23715
23754
  if (properties["Description"]) createParams.Description = properties["Description"];
@@ -23738,12 +23777,9 @@ var SecretsManagerSecretProvider = class {
23738
23777
  async update(logicalId, physicalId, resourceType, properties, previousProperties) {
23739
23778
  this.logger.debug(`Updating secret ${logicalId}: ${physicalId}`);
23740
23779
  try {
23741
- let secretString;
23742
- const generateConfig = properties["GenerateSecretString"];
23743
- if (generateConfig) secretString = this.generateSecretString(generateConfig);
23744
- else if (properties["SecretString"]) secretString = properties["SecretString"];
23780
+ const secretString = this.changedSecretValue(properties, previousProperties);
23745
23781
  const updateParams = { SecretId: physicalId };
23746
- if (secretString) updateParams.SecretString = secretString;
23782
+ if (secretString !== void 0) updateParams.SecretString = secretString;
23747
23783
  const description = clearOnUpdateRemoval(properties["Description"], previousProperties["Description"], "");
23748
23784
  if (description !== void 0) updateParams.Description = description;
23749
23785
  const newKmsKeyId = properties["KmsKeyId"];
@@ -23825,6 +23861,104 @@ var SecretsManagerSecretProvider = class {
23825
23861
  }
23826
23862
  }
23827
23863
  /**
23864
+ * The `SecretString` an in-place update must send, or `undefined` when the
23865
+ * value's SOURCE is unchanged (issue #2472).
23866
+ *
23867
+ * The source is `GenerateSecretString` when present (CloudFormation gives it
23868
+ * precedence over a literal) and `SecretString` otherwise. A generated value
23869
+ * is minted only when the `GenerateSecretString` block differs from the
23870
+ * previous one — every in-place update re-runs this method, so comparing
23871
+ * the block rather than the (never persisted, never read back) value is
23872
+ * the only way to keep an unrelated update from re-rolling the password. A
23873
+ * literal is sent only when it differs from the previous literal. Switching
23874
+ * source in either direction counts as a change (the previous side of the
23875
+ * new source is `undefined`), and a bag that carries NEITHER source keeps
23876
+ * the live value untouched, as CloudFormation does.
23877
+ *
23878
+ * One consequence of the precedence: a PREVIOUS bag carrying both a block
23879
+ * and an ignored `SecretString: 'x'` masks a block-to-literal switch whose
23880
+ * literal is still `'x'` (the literal compares equal, nothing is sent).
23881
+ * CloudFormation rejects a template declaring both, so such a record is
23882
+ * cdkd-created only and the miss is accepted.
23883
+ *
23884
+ * THE PREVIOUS BAG IS WHAT STATE PERSISTED, so the block is compared in
23885
+ * that spelling. On the deploy path a `{{resolve:...}}` inside
23886
+ * `SecretStringTemplate` reaches this method as plaintext while state holds
23887
+ * the redacted expression (GHSA-p5qg-v9gv-hc7w); compared raw, such a block
23888
+ * ALWAYS differs and every Tags-only update re-rolls the password — the
23889
+ * defect this method exists to close, for exactly the shape that embeds a
23890
+ * secret. {@link asPersisted} rewrites the desired block through the same
23891
+ * redaction the state writer uses, so the two sides meet. A pre-GHSA record
23892
+ * still holding plaintext matches the raw comparison instead; either match
23893
+ * means "unchanged".
23894
+ *
23895
+ * The same rewrite means an upstream ROTATION behind an unchanged reference
23896
+ * in `SecretStringTemplate` does NOT regenerate (the expression is the same
23897
+ * on both sides), where CloudFormation, which re-resolves at update time,
23898
+ * would. That is the intended trade for the generated source: the harmful
23899
+ * direction is the unrequested re-roll.
23900
+ *
23901
+ * RESIDUAL, permanent rather than one-shot: two references in the block
23902
+ * that resolve to the SAME plaintext. The resolver records one pair per
23903
+ * plaintext (last expression wins), so this value scan rewrites BOTH leaves
23904
+ * to the survivor expression, while the persisted previous holds each
23905
+ * leaf's own expression (the state writer redacts by POSITION, with the
23906
+ * template as its source) — the two spellings differ on every in-place
23907
+ * update, and that shape re-rolls on every Tags-only deploy. Threading a
23908
+ * position source through here would close it, but the only source this
23909
+ * method holds is the PREVIOUS block, and substituting its leaves would
23910
+ * also erase a genuine reference switch in a secret leaf; left open for a
23911
+ * shape that is rare (two secrets with identical plaintext in one block).
23912
+ *
23913
+ * A LITERAL IS DELIBERATELY NOT REDACTED BEFORE COMPARING. A
23914
+ * `SecretString: '{{resolve:...}}'` (a secret mirroring another one) is
23915
+ * re-sent on every in-place update: cdkd cannot tell whether the REFERENCED
23916
+ * value changed since the last deploy — state holds only the expression —
23917
+ * and CloudFormation re-applies it when the resolved value changed. A
23918
+ * redundant version is the milder failure; a stale copy is a wrong value.
23919
+ *
23920
+ * `isDeepStrictEqual` over a JSON round-trip rather than `JSON.stringify`
23921
+ * equality: the previous bag comes back from state.json while the new one
23922
+ * comes from the resolver, so a key-order difference is not a change, and
23923
+ * an explicit `undefined` member (which state.json cannot hold) must not
23924
+ * read as one either — that failure direction is a silent re-roll.
23925
+ *
23926
+ * KNOWN EDGE, accepted: the redaction is a VALUE scan, so a literal in the
23927
+ * block that happens to EQUAL a plaintext this resource resolved from a
23928
+ * reference elsewhere in its bag is rewritten to that reference's
23929
+ * expression too. Replacing a `{{resolve:...}}` in the template with the
23930
+ * literal it currently resolves to therefore compares equal and does NOT
23931
+ * regenerate, where CloudFormation would. This is the same rewrite the
23932
+ * state writer applies to that literal when it persists the record, so the
23933
+ * two sides stay consistent, and the miss is in the safe direction (no
23934
+ * unrequested re-roll) for an edit that puts a secret's plaintext into a
23935
+ * template.
23936
+ */
23937
+ changedSecretValue(properties, previousProperties) {
23938
+ const generateConfig = properties["GenerateSecretString"];
23939
+ if (generateConfig) {
23940
+ const previous = previousProperties["GenerateSecretString"];
23941
+ return isDeepStrictEqual(asJson(generateConfig), asJson(previous)) || isDeepStrictEqual(asJson(this.asPersisted(generateConfig)), asJson(previous)) ? void 0 : this.generateSecretString(generateConfig);
23942
+ }
23943
+ const literal = properties["SecretString"];
23944
+ if (literal === void 0) return void 0;
23945
+ if (isDeepStrictEqual(asJson(literal), asJson(previousProperties["SecretString"]))) return;
23946
+ return requireSecretStringShape(literal);
23947
+ }
23948
+ /**
23949
+ * `bag` as the state writer would persist it: every plaintext this
23950
+ * provider call resolved from a `{{resolve:...}}` reference is rewritten
23951
+ * back to its expression. The pairs come from the per-resource scope the
23952
+ * deploy engine / rollback executor bind around the provider call
23953
+ * (`resource-secrets-scope.ts`); absent (drift `--revert`, import, tests)
23954
+ * the bag is returned as-is. The map is handed to the redaction helper
23955
+ * only — never enumerated, never logged.
23956
+ */
23957
+ asPersisted(bag) {
23958
+ const secrets = getCurrentResourceSecrets();
23959
+ return secrets !== void 0 && secrets.size > 0 ? redactSecretsForState(bag, secrets) : bag;
23960
+ }
23961
+ /**
23828
23962
  * Generate a secret string from GenerateSecretString configuration
23829
23963
  *
23830
23964
  * Simple implementation that generates a random string based on the config.
@@ -30477,7 +30611,10 @@ var ApiGatewayV2Provider = class {
30477
30611
  ["CredentialsArn", "Quick-create shortcut (paired with RouteKey/Target); cdkd models the integration as an explicit AWS::ApiGatewayV2::Integration resource instead."]
30478
30612
  ])]]);
30479
30613
  getClient() {
30480
- if (!this.client) this.client = new ApiGatewayV2Client(this.providerRegion ? { region: this.providerRegion } : {});
30614
+ if (!this.client) this.client = new ApiGatewayV2Client({
30615
+ ...awsClientDefaults(),
30616
+ ...this.providerRegion ? { region: this.providerRegion } : {}
30617
+ });
30481
30618
  return this.client;
30482
30619
  }
30483
30620
  /**
@@ -34203,11 +34340,17 @@ var StepFunctionsProvider = class {
34203
34340
  "EncryptionConfiguration"
34204
34341
  ])]]);
34205
34342
  getClient() {
34206
- if (!this.sfnClient) this.sfnClient = new SFNClient(this.providerRegion ? { region: this.providerRegion } : {});
34343
+ if (!this.sfnClient) this.sfnClient = new SFNClient({
34344
+ ...awsClientDefaults(),
34345
+ ...this.providerRegion ? { region: this.providerRegion } : {}
34346
+ });
34207
34347
  return this.sfnClient;
34208
34348
  }
34209
34349
  getS3Client() {
34210
- if (!this.s3Client) this.s3Client = new S3Client(this.providerRegion ? { region: this.providerRegion } : {});
34350
+ if (!this.s3Client) this.s3Client = new S3Client({
34351
+ ...awsClientDefaults(),
34352
+ ...this.providerRegion ? { region: this.providerRegion } : {}
34353
+ });
34211
34354
  return this.s3Client;
34212
34355
  }
34213
34356
  /**
@@ -34834,7 +34977,10 @@ var ECSProvider = class {
34834
34977
  ]);
34835
34978
  unhandledByDesign = /* @__PURE__ */ new Map([["AWS::ECS::TaskDefinition", /* @__PURE__ */ new Map([["InferenceAccelerators", "AWS Elastic Inference end-of-life 2024-04; use AWS Inferentia / Trainium accelerator instance families instead"]])]]);
34836
34979
  getClient() {
34837
- if (!this.ecsClient) this.ecsClient = new ECSClient(this.providerRegion ? { region: this.providerRegion } : {});
34980
+ if (!this.ecsClient) this.ecsClient = new ECSClient({
34981
+ ...awsClientDefaults(),
34982
+ ...this.providerRegion ? { region: this.providerRegion } : {}
34983
+ });
34838
34984
  return this.ecsClient;
34839
34985
  }
34840
34986
  async create(logicalId, resourceType, properties) {
@@ -36622,7 +36768,10 @@ var ELBv2Provider = class {
36622
36768
  ])]
36623
36769
  ]);
36624
36770
  getClient() {
36625
- if (!this.elbv2Client) this.elbv2Client = new ElasticLoadBalancingV2Client(this.providerRegion ? { region: this.providerRegion } : {});
36771
+ if (!this.elbv2Client) this.elbv2Client = new ElasticLoadBalancingV2Client({
36772
+ ...awsClientDefaults(),
36773
+ ...this.providerRegion ? { region: this.providerRegion } : {}
36774
+ });
36626
36775
  return this.elbv2Client;
36627
36776
  }
36628
36777
  /**
@@ -37891,7 +38040,10 @@ var RDSProvider = class {
37891
38040
  ["DeleteAutomatedBackups", "delete-time lifecycle flag not threaded through cdkd destroy; final snapshots are governed by DeletionPolicy: Snapshot (issue #1352), which this flag does not control"]
37892
38041
  ])]]);
37893
38042
  getClient() {
37894
- if (!this.rdsClient) this.rdsClient = new RDSClient(this.providerRegion ? { region: this.providerRegion } : {});
38043
+ if (!this.rdsClient) this.rdsClient = new RDSClient({
38044
+ ...awsClientDefaults(),
38045
+ ...this.providerRegion ? { region: this.providerRegion } : {}
38046
+ });
37895
38047
  return this.rdsClient;
37896
38048
  }
37897
38049
  async create(logicalId, resourceType, properties) {
@@ -38642,7 +38794,10 @@ var RDSDBProxyProvider = class {
38642
38794
  "Tags"
38643
38795
  ])]]);
38644
38796
  getClient() {
38645
- if (!this.rdsClient) this.rdsClient = new RDSClient(this.providerRegion ? { region: this.providerRegion } : {});
38797
+ if (!this.rdsClient) this.rdsClient = new RDSClient({
38798
+ ...awsClientDefaults(),
38799
+ ...this.providerRegion ? { region: this.providerRegion } : {}
38800
+ });
38646
38801
  return this.rdsClient;
38647
38802
  }
38648
38803
  async create(logicalId, resourceType, properties) {
@@ -38974,7 +39129,10 @@ var RDSDBProxyEndpointProvider = class {
38974
39129
  "Tags"
38975
39130
  ])]]);
38976
39131
  getClient() {
38977
- if (!this.rdsClient) this.rdsClient = new RDSClient(this.providerRegion ? { region: this.providerRegion } : {});
39132
+ if (!this.rdsClient) this.rdsClient = new RDSClient({
39133
+ ...awsClientDefaults(),
39134
+ ...this.providerRegion ? { region: this.providerRegion } : {}
39135
+ });
38978
39136
  return this.rdsClient;
38979
39137
  }
38980
39138
  async create(logicalId, resourceType, properties) {
@@ -39280,7 +39438,10 @@ var RDSDBProxyTargetGroupProvider = class {
39280
39438
  "ConnectionPoolConfigurationInfo"
39281
39439
  ])]]);
39282
39440
  getClient() {
39283
- if (!this.rdsClient) this.rdsClient = new RDSClient(this.providerRegion ? { region: this.providerRegion } : {});
39441
+ if (!this.rdsClient) this.rdsClient = new RDSClient({
39442
+ ...awsClientDefaults(),
39443
+ ...this.providerRegion ? { region: this.providerRegion } : {}
39444
+ });
39284
39445
  return this.rdsClient;
39285
39446
  }
39286
39447
  async create(logicalId, resourceType, properties, context) {
@@ -39591,7 +39752,10 @@ var DocDBProvider = class {
39591
39752
  ])]
39592
39753
  ]);
39593
39754
  getClient() {
39594
- if (!this.docdbClient) this.docdbClient = new DocDBClient(this.providerRegion ? { region: this.providerRegion } : {});
39755
+ if (!this.docdbClient) this.docdbClient = new DocDBClient({
39756
+ ...awsClientDefaults(),
39757
+ ...this.providerRegion ? { region: this.providerRegion } : {}
39758
+ });
39595
39759
  return this.docdbClient;
39596
39760
  }
39597
39761
  async create(logicalId, resourceType, properties) {
@@ -40224,7 +40388,10 @@ var NeptuneProvider = class {
40224
40388
  ])]
40225
40389
  ]);
40226
40390
  getClient() {
40227
- if (!this.neptuneClient) this.neptuneClient = new NeptuneClient(this.providerRegion ? { region: this.providerRegion } : {});
40391
+ if (!this.neptuneClient) this.neptuneClient = new NeptuneClient({
40392
+ ...awsClientDefaults(),
40393
+ ...this.providerRegion ? { region: this.providerRegion } : {}
40394
+ });
40228
40395
  return this.neptuneClient;
40229
40396
  }
40230
40397
  async create(logicalId, resourceType, properties) {
@@ -40985,7 +41152,10 @@ var Route53Provider = class {
40985
41152
  "CidrRoutingConfig"
40986
41153
  ])]]);
40987
41154
  getClient() {
40988
- if (!this.route53Client) this.route53Client = new Route53Client(this.providerRegion ? { region: this.providerRegion } : {});
41155
+ if (!this.route53Client) this.route53Client = new Route53Client({
41156
+ ...awsClientDefaults(),
41157
+ ...this.providerRegion ? { region: this.providerRegion } : {}
41158
+ });
40989
41159
  return this.route53Client;
40990
41160
  }
40991
41161
  async create(logicalId, resourceType, properties, context) {
@@ -42997,7 +43167,10 @@ var CognitoUserPoolProvider = class {
42997
43167
  return narrowMfaConfiguration(properties);
42998
43168
  }
42999
43169
  getClient() {
43000
- if (!this.cognitoClient) this.cognitoClient = new CognitoIdentityProviderClient(this.providerRegion ? { region: this.providerRegion } : {});
43170
+ if (!this.cognitoClient) this.cognitoClient = new CognitoIdentityProviderClient({
43171
+ ...awsClientDefaults(),
43172
+ ...this.providerRegion ? { region: this.providerRegion } : {}
43173
+ });
43001
43174
  return this.cognitoClient;
43002
43175
  }
43003
43176
  /**
@@ -43749,7 +43922,10 @@ var ElastiCacheProvider = class {
43749
43922
  ])]]);
43750
43923
  unhandledByDesign = /* @__PURE__ */ new Map([["AWS::ElastiCache::CacheCluster", /* @__PURE__ */ new Map([["CacheSecurityGroupNames", "EC2-Classic-only — use VpcSecurityGroupIds for VPC-deployed clusters (EC2-Classic retired 2022-08-15)"]])]]);
43751
43924
  getClient() {
43752
- if (!this.client) this.client = new ElastiCacheClient(this.providerRegion ? { region: this.providerRegion } : {});
43925
+ if (!this.client) this.client = new ElastiCacheClient({
43926
+ ...awsClientDefaults(),
43927
+ ...this.providerRegion ? { region: this.providerRegion } : {}
43928
+ });
43753
43929
  return this.client;
43754
43930
  }
43755
43931
  async create(logicalId, resourceType, properties) {
@@ -44278,11 +44454,17 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
44278
44454
  ])]
44279
44455
  ]);
44280
44456
  getClient() {
44281
- if (!this.client) this.client = new ServiceDiscoveryClient(this.providerRegion ? { region: this.providerRegion } : {});
44457
+ if (!this.client) this.client = new ServiceDiscoveryClient({
44458
+ ...awsClientDefaults(),
44459
+ ...this.providerRegion ? { region: this.providerRegion } : {}
44460
+ });
44282
44461
  return this.client;
44283
44462
  }
44284
44463
  getStsClient() {
44285
- if (!this.stsClient) this.stsClient = new STSClient(this.providerRegion ? { region: this.providerRegion } : {});
44464
+ if (!this.stsClient) this.stsClient = new STSClient({
44465
+ ...awsClientDefaults(),
44466
+ ...this.providerRegion ? { region: this.providerRegion } : {}
44467
+ });
44286
44468
  return this.stsClient;
44287
44469
  }
44288
44470
  /**
@@ -45328,7 +45510,10 @@ var AppSyncProvider = class {
45328
45510
  ])]
45329
45511
  ]);
45330
45512
  getClient() {
45331
- if (!this.client) this.client = new AppSyncClient(this.providerRegion ? { region: this.providerRegion } : {});
45513
+ if (!this.client) this.client = new AppSyncClient({
45514
+ ...awsClientDefaults(),
45515
+ ...this.providerRegion ? { region: this.providerRegion } : {}
45516
+ });
45332
45517
  return this.client;
45333
45518
  }
45334
45519
  /**
@@ -45520,7 +45705,10 @@ var AppSyncProvider = class {
45520
45705
  * implementation).
45521
45706
  */
45522
45707
  getS3Client() {
45523
- if (!this.s3Client) this.s3Client = new S3Client(this.providerRegion ? { region: this.providerRegion } : {});
45708
+ if (!this.s3Client) this.s3Client = new S3Client({
45709
+ ...awsClientDefaults(),
45710
+ ...this.providerRegion ? { region: this.providerRegion } : {}
45711
+ });
45524
45712
  return this.s3Client;
45525
45713
  }
45526
45714
  async create(logicalId, resourceType, properties, context) {
@@ -47151,7 +47339,10 @@ var GlueProvider = class {
47151
47339
  "OpenTableFormatInput"
47152
47340
  ])]]);
47153
47341
  getClient() {
47154
- if (!this.client) this.client = new GlueClient(this.providerRegion ? { region: this.providerRegion } : {});
47342
+ if (!this.client) this.client = new GlueClient({
47343
+ ...awsClientDefaults(),
47344
+ ...this.providerRegion ? { region: this.providerRegion } : {}
47345
+ });
47155
47346
  return this.client;
47156
47347
  }
47157
47348
  async create(logicalId, resourceType, properties, context) {
@@ -48002,7 +48193,10 @@ var GlueWorkflowProvider = class {
48002
48193
  "Tags"
48003
48194
  ])]]);
48004
48195
  getClient() {
48005
- if (!this.client) this.client = new GlueClient(this.providerRegion ? { region: this.providerRegion } : {});
48196
+ if (!this.client) this.client = new GlueClient({
48197
+ ...awsClientDefaults(),
48198
+ ...this.providerRegion ? { region: this.providerRegion } : {}
48199
+ });
48006
48200
  return this.client;
48007
48201
  }
48008
48202
  async create(logicalId, resourceType, properties) {
@@ -48128,7 +48322,10 @@ var GlueWorkflowProvider = class {
48128
48322
  }
48129
48323
  async getAccountId() {
48130
48324
  if (this.cachedAccountId) return this.cachedAccountId;
48131
- if (!this.stsClient) this.stsClient = new STSClient(this.providerRegion ? { region: this.providerRegion } : {});
48325
+ if (!this.stsClient) this.stsClient = new STSClient({
48326
+ ...awsClientDefaults(),
48327
+ ...this.providerRegion ? { region: this.providerRegion } : {}
48328
+ });
48132
48329
  const identity = await this.stsClient.send(new GetCallerIdentityCommand({}));
48133
48330
  if (!identity.Account) throw new Error("Failed to resolve AWS account id from STS");
48134
48331
  this.cachedAccountId = identity.Account;
@@ -48153,7 +48350,10 @@ var GlueSecurityConfigurationProvider = class {
48153
48350
  logger = getLogger().child("GlueSecurityConfigurationProvider");
48154
48351
  handledProperties = /* @__PURE__ */ new Map([["AWS::Glue::SecurityConfiguration", /* @__PURE__ */ new Set(["Name", "EncryptionConfiguration"])]]);
48155
48352
  getClient() {
48156
- if (!this.client) this.client = new GlueClient(this.providerRegion ? { region: this.providerRegion } : {});
48353
+ if (!this.client) this.client = new GlueClient({
48354
+ ...awsClientDefaults(),
48355
+ ...this.providerRegion ? { region: this.providerRegion } : {}
48356
+ });
48157
48357
  return this.client;
48158
48358
  }
48159
48359
  async create(logicalId, resourceType, properties) {
@@ -48512,11 +48712,17 @@ var GlueJobProvider = class {
48512
48712
  "Tags"
48513
48713
  ])]]);
48514
48714
  getClient() {
48515
- if (!this.client) this.client = new GlueClient(this.providerRegion ? { region: this.providerRegion } : {});
48715
+ if (!this.client) this.client = new GlueClient({
48716
+ ...awsClientDefaults(),
48717
+ ...this.providerRegion ? { region: this.providerRegion } : {}
48718
+ });
48516
48719
  return this.client;
48517
48720
  }
48518
48721
  getStsClient() {
48519
- if (!this.stsClient) this.stsClient = new STSClient(this.providerRegion ? { region: this.providerRegion } : {});
48722
+ if (!this.stsClient) this.stsClient = new STSClient({
48723
+ ...awsClientDefaults(),
48724
+ ...this.providerRegion ? { region: this.providerRegion } : {}
48725
+ });
48520
48726
  return this.stsClient;
48521
48727
  }
48522
48728
  async create(logicalId, resourceType, properties) {
@@ -48882,11 +49088,17 @@ var GlueCrawlerProvider = class {
48882
49088
  "Tags"
48883
49089
  ])]]);
48884
49090
  getClient() {
48885
- if (!this.client) this.client = new GlueClient(this.providerRegion ? { region: this.providerRegion } : {});
49091
+ if (!this.client) this.client = new GlueClient({
49092
+ ...awsClientDefaults(),
49093
+ ...this.providerRegion ? { region: this.providerRegion } : {}
49094
+ });
48886
49095
  return this.client;
48887
49096
  }
48888
49097
  getStsClient() {
48889
- if (!this.stsClient) this.stsClient = new STSClient(this.providerRegion ? { region: this.providerRegion } : {});
49098
+ if (!this.stsClient) this.stsClient = new STSClient({
49099
+ ...awsClientDefaults(),
49100
+ ...this.providerRegion ? { region: this.providerRegion } : {}
49101
+ });
48890
49102
  return this.stsClient;
48891
49103
  }
48892
49104
  async create(logicalId, resourceType, properties) {
@@ -49190,7 +49402,10 @@ var GlueConnectionProvider = class {
49190
49402
  logger = getLogger().child("GlueConnectionProvider");
49191
49403
  handledProperties = /* @__PURE__ */ new Map([["AWS::Glue::Connection", /* @__PURE__ */ new Set(["ConnectionInput", "CatalogId"])]]);
49192
49404
  getClient() {
49193
- if (!this.client) this.client = new GlueClient(this.providerRegion ? { region: this.providerRegion } : {});
49405
+ if (!this.client) this.client = new GlueClient({
49406
+ ...awsClientDefaults(),
49407
+ ...this.providerRegion ? { region: this.providerRegion } : {}
49408
+ });
49194
49409
  return this.client;
49195
49410
  }
49196
49411
  async create(logicalId, resourceType, properties) {
@@ -49352,11 +49567,17 @@ var GlueTriggerProvider = class {
49352
49567
  "Tags"
49353
49568
  ])]]);
49354
49569
  getClient() {
49355
- if (!this.client) this.client = new GlueClient(this.providerRegion ? { region: this.providerRegion } : {});
49570
+ if (!this.client) this.client = new GlueClient({
49571
+ ...awsClientDefaults(),
49572
+ ...this.providerRegion ? { region: this.providerRegion } : {}
49573
+ });
49356
49574
  return this.client;
49357
49575
  }
49358
49576
  getStsClient() {
49359
- if (!this.stsClient) this.stsClient = new STSClient(this.providerRegion ? { region: this.providerRegion } : {});
49577
+ if (!this.stsClient) this.stsClient = new STSClient({
49578
+ ...awsClientDefaults(),
49579
+ ...this.providerRegion ? { region: this.providerRegion } : {}
49580
+ });
49360
49581
  return this.stsClient;
49361
49582
  }
49362
49583
  async create(logicalId, resourceType, properties) {
@@ -49570,7 +49791,10 @@ var KMSProvider = class {
49570
49791
  "BypassPolicyLockoutSafetyCheck"
49571
49792
  ])], ["AWS::KMS::Alias", /* @__PURE__ */ new Set(["AliasName", "TargetKeyId"])]]);
49572
49793
  getClient() {
49573
- if (!this.client) this.client = new KMSClient(this.providerRegion ? { region: this.providerRegion } : {});
49794
+ if (!this.client) this.client = new KMSClient({
49795
+ ...awsClientDefaults(),
49796
+ ...this.providerRegion ? { region: this.providerRegion } : {}
49797
+ });
49574
49798
  return this.client;
49575
49799
  }
49576
49800
  async create(logicalId, resourceType, properties) {
@@ -50009,7 +50233,10 @@ var BudgetsBudgetProvider = class {
50009
50233
  "ResourceTags"
50010
50234
  ])]]);
50011
50235
  getClient() {
50012
- if (!this.client) this.client = new BudgetsClient(this.providerRegion ? { region: this.providerRegion } : {});
50236
+ if (!this.client) this.client = new BudgetsClient({
50237
+ ...awsClientDefaults(),
50238
+ ...this.providerRegion ? { region: this.providerRegion } : {}
50239
+ });
50013
50240
  return this.client;
50014
50241
  }
50015
50242
  /**
@@ -50622,7 +50849,10 @@ var KinesisStreamProvider = class {
50622
50849
  "MaxRecordSizeInKiB"
50623
50850
  ])]]);
50624
50851
  getClient() {
50625
- if (!this.client) this.client = new KinesisClient(this.providerRegion ? { region: this.providerRegion } : {});
50852
+ if (!this.client) this.client = new KinesisClient({
50853
+ ...awsClientDefaults(),
50854
+ ...this.providerRegion ? { region: this.providerRegion } : {}
50855
+ });
50626
50856
  return this.client;
50627
50857
  }
50628
50858
  /**
@@ -51094,7 +51324,10 @@ var KinesisStreamConsumerProvider = class {
51094
51324
  "Tags"
51095
51325
  ])]]);
51096
51326
  getClient() {
51097
- if (!this.client) this.client = new KinesisClient(this.providerRegion ? { region: this.providerRegion } : {});
51327
+ if (!this.client) this.client = new KinesisClient({
51328
+ ...awsClientDefaults(),
51329
+ ...this.providerRegion ? { region: this.providerRegion } : {}
51330
+ });
51098
51331
  return this.client;
51099
51332
  }
51100
51333
  /**
@@ -51378,7 +51611,10 @@ var SchedulerScheduleProvider = class {
51378
51611
  "Target"
51379
51612
  ])]]);
51380
51613
  getClient() {
51381
- if (!this.client) this.client = new SchedulerClient(this.providerRegion ? { region: this.providerRegion } : {});
51614
+ if (!this.client) this.client = new SchedulerClient({
51615
+ ...awsClientDefaults(),
51616
+ ...this.providerRegion ? { region: this.providerRegion } : {}
51617
+ });
51382
51618
  return this.client;
51383
51619
  }
51384
51620
  /**
@@ -51671,7 +51907,10 @@ var EFSProvider = class {
51671
51907
  ]);
51672
51908
  unhandledByDesign = /* @__PURE__ */ new Map([["AWS::EFS::FileSystem", /* @__PURE__ */ new Map([["ReplicationConfiguration", "Cross-region EFS replication (CreateReplicationConfiguration) provisions a separate destination file system in another region with its own lifecycle, KMS key, and availability-zone placement; replicating + then tearing down the destination on destroy is a multi-resource, cross-region orchestration that is out of scope for the single-resource SDK provider. Tracked as a follow-up to issue #609."]])], ["AWS::EFS::AccessPoint", /* @__PURE__ */ new Map([["ClientToken", "cdkd supplies its own retry-stable ClientToken on CreateAccessPoint (issues #2039 and #2080), so a template-supplied value would be overwritten. The SDK does not own this field either: measured against @aws-sdk/client-efs 3.1018.0, an omitted ClientToken is auto-filled with a FRESH uuid per attempt, which leaves a retried 500 free to mint a second access point, while a caller-supplied value goes on the wire verbatim."]])]]);
51673
51909
  getClient() {
51674
- if (!this.client) this.client = new EFSClient(this.providerRegion ? { region: this.providerRegion } : {});
51910
+ if (!this.client) this.client = new EFSClient({
51911
+ ...awsClientDefaults(),
51912
+ ...this.providerRegion ? { region: this.providerRegion } : {}
51913
+ });
51675
51914
  return this.client;
51676
51915
  }
51677
51916
  async create(logicalId, resourceType, properties) {
@@ -52585,7 +52824,10 @@ var FSxFileSystemProvider = class {
52585
52824
  ])]]);
52586
52825
  unhandledByDesign = /* @__PURE__ */ new Map();
52587
52826
  getClient() {
52588
- if (!this.client) this.client = new FSxClient(this.providerRegion ? { region: this.providerRegion } : {});
52827
+ if (!this.client) this.client = new FSxClient({
52828
+ ...awsClientDefaults(),
52829
+ ...this.providerRegion ? { region: this.providerRegion } : {}
52830
+ });
52589
52831
  return this.client;
52590
52832
  }
52591
52833
  /**
@@ -53693,7 +53935,10 @@ var EMRClusterProvider = class {
53693
53935
  "VisibleToAllUsers"
53694
53936
  ])]]);
53695
53937
  getClient() {
53696
- if (!this.client) this.client = new EMRClient(this.providerRegion ? { region: this.providerRegion } : {});
53938
+ if (!this.client) this.client = new EMRClient({
53939
+ ...awsClientDefaults(),
53940
+ ...this.providerRegion ? { region: this.providerRegion } : {}
53941
+ });
53697
53942
  return this.client;
53698
53943
  }
53699
53944
  /**
@@ -54455,7 +54700,10 @@ var EMRInstanceGroupConfigProvider = class {
54455
54700
  "Name"
54456
54701
  ])]]);
54457
54702
  getClient() {
54458
- if (!this.client) this.client = new EMRClient(this.providerRegion ? { region: this.providerRegion } : {});
54703
+ if (!this.client) this.client = new EMRClient({
54704
+ ...awsClientDefaults(),
54705
+ ...this.providerRegion ? { region: this.providerRegion } : {}
54706
+ });
54459
54707
  return this.client;
54460
54708
  }
54461
54709
  getMinResourceTimeoutMs() {
@@ -54768,7 +55016,10 @@ var EMRInstanceFleetConfigProvider = class {
54768
55016
  "TargetSpotCapacity"
54769
55017
  ])]]);
54770
55018
  getClient() {
54771
- if (!this.client) this.client = new EMRClient(this.providerRegion ? { region: this.providerRegion } : {});
55019
+ if (!this.client) this.client = new EMRClient({
55020
+ ...awsClientDefaults(),
55021
+ ...this.providerRegion ? { region: this.providerRegion } : {}
55022
+ });
54772
55023
  return this.client;
54773
55024
  }
54774
55025
  getMinResourceTimeoutMs() {
@@ -55066,7 +55317,10 @@ var FirehoseProvider = class {
55066
55317
  "DeliveryStreamEncryptionConfigurationInput"
55067
55318
  ])]]);
55068
55319
  getClient() {
55069
- if (!this.client) this.client = new FirehoseClient(this.providerRegion ? { region: this.providerRegion } : {});
55320
+ if (!this.client) this.client = new FirehoseClient({
55321
+ ...awsClientDefaults(),
55322
+ ...this.providerRegion ? { region: this.providerRegion } : {}
55323
+ });
55070
55324
  return this.client;
55071
55325
  }
55072
55326
  /**
@@ -56411,7 +56665,10 @@ var CloudTrailProvider = class {
56411
56665
  "IsOrganizationTrail"
56412
56666
  ])]]);
56413
56667
  getClient() {
56414
- if (!this.client) this.client = new CloudTrailClient(this.providerRegion ? { region: this.providerRegion } : {});
56668
+ if (!this.client) this.client = new CloudTrailClient({
56669
+ ...awsClientDefaults(),
56670
+ ...this.providerRegion ? { region: this.providerRegion } : {}
56671
+ });
56415
56672
  return this.client;
56416
56673
  }
56417
56674
  async create(logicalId, resourceType, properties) {
@@ -56753,7 +57010,10 @@ var CodeBuildProvider = class {
56753
57010
  "AutoRetryLimit"
56754
57011
  ])]]);
56755
57012
  getClient() {
56756
- if (!this.client) this.client = new CodeBuildClient(this.providerRegion ? { region: this.providerRegion } : {});
57013
+ if (!this.client) this.client = new CodeBuildClient({
57014
+ ...awsClientDefaults(),
57015
+ ...this.providerRegion ? { region: this.providerRegion } : {}
57016
+ });
56757
57017
  return this.client;
56758
57018
  }
56759
57019
  /**
@@ -57314,11 +57574,17 @@ var CodeCommitRepositoryProvider = class {
57314
57574
  "Triggers"
57315
57575
  ])]]);
57316
57576
  getClient() {
57317
- if (!this.client) this.client = new CodeCommitClient(this.providerRegion ? { region: this.providerRegion } : {});
57577
+ if (!this.client) this.client = new CodeCommitClient({
57578
+ ...awsClientDefaults(),
57579
+ ...this.providerRegion ? { region: this.providerRegion } : {}
57580
+ });
57318
57581
  return this.client;
57319
57582
  }
57320
57583
  getS3Client() {
57321
- if (!this.s3Client) this.s3Client = new S3Client(this.providerRegion ? { region: this.providerRegion } : {});
57584
+ if (!this.s3Client) this.s3Client = new S3Client({
57585
+ ...awsClientDefaults(),
57586
+ ...this.providerRegion ? { region: this.providerRegion } : {}
57587
+ });
57322
57588
  return this.s3Client;
57323
57589
  }
57324
57590
  /**
@@ -57748,7 +58014,10 @@ var DLMLifecyclePolicyProvider = class {
57748
58014
  "Exclusions"
57749
58015
  ])]]);
57750
58016
  getClient() {
57751
- if (!this.client) this.client = new DLMClient(this.providerRegion ? { region: this.providerRegion } : {});
58017
+ if (!this.client) this.client = new DLMClient({
58018
+ ...awsClientDefaults(),
58019
+ ...this.providerRegion ? { region: this.providerRegion } : {}
58020
+ });
57752
58021
  return this.client;
57753
58022
  }
57754
58023
  /**
@@ -58040,7 +58309,10 @@ var S3VectorsProvider = class {
58040
58309
  "Tags"
58041
58310
  ])]]);
58042
58311
  getClient() {
58043
- if (!this.client) this.client = new S3VectorsClient(this.providerRegion ? { region: this.providerRegion } : {});
58312
+ if (!this.client) this.client = new S3VectorsClient({
58313
+ ...awsClientDefaults(),
58314
+ ...this.providerRegion ? { region: this.providerRegion } : {}
58315
+ });
58044
58316
  return this.client;
58045
58317
  }
58046
58318
  async create(logicalId, resourceType, properties) {
@@ -58290,7 +58562,10 @@ var S3DirectoryBucketProvider = class {
58290
58562
  this.stsClient = awsClients.sts;
58291
58563
  }
58292
58564
  getEc2Client() {
58293
- if (!this.ec2Client) this.ec2Client = new EC2Client(this.providerRegion ? { region: this.providerRegion } : {});
58565
+ if (!this.ec2Client) this.ec2Client = new EC2Client({
58566
+ ...awsClientDefaults(),
58567
+ ...this.providerRegion ? { region: this.providerRegion } : {}
58568
+ });
58294
58569
  return this.ec2Client;
58295
58570
  }
58296
58571
  /**
@@ -58301,7 +58576,10 @@ var S3DirectoryBucketProvider = class {
58301
58576
  * `s3express:UntagResource` / `s3express:ListTagsForResource` permissions).
58302
58577
  */
58303
58578
  getS3ControlClient() {
58304
- if (!this.s3ControlClient) this.s3ControlClient = new S3ControlClient(this.providerRegion ? { region: this.providerRegion } : {});
58579
+ if (!this.s3ControlClient) this.s3ControlClient = new S3ControlClient({
58580
+ ...awsClientDefaults(),
58581
+ ...this.providerRegion ? { region: this.providerRegion } : {}
58582
+ });
58305
58583
  return this.s3ControlClient;
58306
58584
  }
58307
58585
  /**
@@ -58713,7 +58991,10 @@ var S3TablesProvider = class {
58713
58991
  ])]
58714
58992
  ]);
58715
58993
  getClient() {
58716
- if (!this.client) this.client = new S3TablesClient(this.providerRegion ? { region: this.providerRegion } : {});
58994
+ if (!this.client) this.client = new S3TablesClient({
58995
+ ...awsClientDefaults(),
58996
+ ...this.providerRegion ? { region: this.providerRegion } : {}
58997
+ });
58717
58998
  return this.client;
58718
58999
  }
58719
59000
  async create(logicalId, resourceType, properties, context) {
@@ -59506,7 +59787,10 @@ var ECRProvider = class {
59506
59787
  "ImageTagMutabilityExclusionFilters"
59507
59788
  ])]]);
59508
59789
  getClient() {
59509
- if (!this.client) this.client = new ECRClient(this.providerRegion ? { region: this.providerRegion } : {});
59790
+ if (!this.client) this.client = new ECRClient({
59791
+ ...awsClientDefaults(),
59792
+ ...this.providerRegion ? { region: this.providerRegion } : {}
59793
+ });
59510
59794
  return this.client;
59511
59795
  }
59512
59796
  /**
@@ -62078,7 +62362,10 @@ async function deployCommand(stacks, options) {
62078
62362
  });
62079
62363
  await synthesizer.expandMacrosForStacks(targetStacks, synthOptions);
62080
62364
  const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
62081
- const stsClient = new STSClient({ region: namedCliRegion(options.region) ?? "us-east-1" });
62365
+ const stsClient = new STSClient({
62366
+ ...awsClientDefaults(),
62367
+ region: namedCliRegion(options.region) ?? "us-east-1"
62368
+ });
62082
62369
  const accountId = (await stsClient.send(new GetCallerIdentityCommand({}))).Account;
62083
62370
  stsClient.destroy();
62084
62371
  const assetPublisher = new AssetPublisher();
@@ -70369,7 +70656,11 @@ async function stateMigrateCommand(options) {
70369
70656
  logger.info("Migrating state bucket:");
70370
70657
  logger.info(` source: ${legacyBucket} (resolved for --region ${region})`);
70371
70658
  logger.info(` destination: ${newBucket}`);
70372
- const probe = new S3Client({ region: "us-east-1" });
70659
+ const probeRegion = "us-east-1";
70660
+ const probe = new S3Client({
70661
+ ...awsClientDefaults(),
70662
+ region: probeRegion
70663
+ });
70373
70664
  let sourceExists;
70374
70665
  try {
70375
70666
  sourceExists = await bucketExists(probe, legacyBucket);
@@ -70379,7 +70670,10 @@ async function stateMigrateCommand(options) {
70379
70670
  if (!sourceExists) throw new Error(`Source bucket '${legacyBucket}' does not exist. Nothing to migrate. (Tip: run \`cdkd state info\` to confirm which bucket cdkd is reading from.)`);
70380
70671
  const legacyRegion = await resolveBucketRegion(legacyBucket);
70381
70672
  logger.info(` source bucket actual region: ${legacyRegion}`);
70382
- const legacyS3 = new S3Client({ region: legacyRegion });
70673
+ const legacyS3 = new S3Client({
70674
+ ...awsClientDefaults(),
70675
+ region: legacyRegion
70676
+ });
70383
70677
  try {
70384
70678
  await assertNoActiveLocks(legacyS3, legacyBucket);
70385
70679
  const sourceObjects = await listAllObjects(legacyS3, legacyBucket);
@@ -70479,7 +70773,10 @@ async function assertNoActiveLocks(s3, bucket) {
70479
70773
  }
70480
70774
  }
70481
70775
  async function ensureDestinationBucket(bucketName, region, accountId, logger) {
70482
- const probe = new S3Client({ region });
70776
+ const probe = new S3Client({
70777
+ ...awsClientDefaults(),
70778
+ region
70779
+ });
70483
70780
  let exists;
70484
70781
  try {
70485
70782
  exists = await bucketExists(probe, bucketName);
@@ -70490,10 +70787,16 @@ async function ensureDestinationBucket(bucketName, region, accountId, logger) {
70490
70787
  logger.info(`Destination bucket ${bucketName} already exists; reusing it.`);
70491
70788
  const actual = await resolveBucketRegion(bucketName);
70492
70789
  if (actual !== region) logger.warn(`Destination bucket lives in ${actual}, but source is in ${region}. Cross-region copy is supported but slower; objects will be replicated to ${actual}.`);
70493
- return new S3Client({ region: actual });
70790
+ return new S3Client({
70791
+ ...awsClientDefaults(),
70792
+ region: actual
70793
+ });
70494
70794
  }
70495
70795
  logger.info(`Creating destination bucket ${bucketName} in ${region}...`);
70496
- const s3 = new S3Client({ region });
70796
+ const s3 = new S3Client({
70797
+ ...awsClientDefaults(),
70798
+ region
70799
+ });
70497
70800
  const createParams = { Bucket: bucketName };
70498
70801
  if (region !== "us-east-1") createParams.CreateBucketConfiguration = { LocationConstraint: region };
70499
70802
  await s3.send(new CreateBucketCommand(createParams));
@@ -71755,7 +72058,7 @@ const PRE_DELETE_HANDLERS = {
71755
72058
  const { ApiGatewayV2Client, DeleteStageCommand, NotFoundException } = await import("@aws-sdk/client-apigatewayv2");
71756
72059
  const apiId = entry.properties["ApiId"];
71757
72060
  if (typeof apiId !== "string" || !apiId) throw new Error(`cdkd state's properties for ${entry.logicalId} (${entry.resourceType}) is missing 'ApiId'`);
71758
- const client = new ApiGatewayV2Client({});
72061
+ const client = new ApiGatewayV2Client({ ...awsClientDefaults() });
71759
72062
  try {
71760
72063
  await client.send(new DeleteStageCommand({
71761
72064
  ApiId: apiId,
@@ -71774,7 +72077,7 @@ const PRE_DELETE_HANDLERS = {
71774
72077
  const users = entry.properties["Users"];
71775
72078
  const groups = entry.properties["Groups"];
71776
72079
  if (!((roles?.length ?? 0) + (users?.length ?? 0) + (groups?.length ?? 0) > 0)) throw new Error(`cdkd state's properties for ${entry.logicalId} (${entry.resourceType}) has no Roles/Users/Groups attachment recorded — cannot pre-delete the inline policy. State may be from a pre-v0.74 cdkd binary; re-run \`cdkd state refresh-observed\` before export.`);
71777
- const client = new IAMClient({});
72080
+ const client = new IAMClient({ ...awsClientDefaults() });
71778
72081
  const deleteSafely = async (op) => {
71779
72082
  try {
71780
72083
  await op();
@@ -77372,6 +77675,7 @@ async function gcCommand(options) {
77372
77675
  const accountId = (await accountClients.sts.send(new GetCallerIdentityCommand({}))).Account;
77373
77676
  const bucketName = options.stateBucket ?? getDefaultStateBucketName(accountId);
77374
77677
  const markerS3Client = new S3Client({
77678
+ ...awsClientDefaults({ profile: options.profile }),
77375
77679
  region: effective.region,
77376
77680
  ...options.profile && { profile: options.profile }
77377
77681
  });
@@ -77396,6 +77700,7 @@ async function gcCommand(options) {
77396
77700
  if (awsClients !== accountClients) accountClients.destroy();
77397
77701
  setAwsClients(awsClients);
77398
77702
  const ecrClient = new ECRClient({
77703
+ ...awsClientDefaults({ profile: options.profile }),
77399
77704
  region,
77400
77705
  ...options.profile && { profile: options.profile }
77401
77706
  });
@@ -78285,7 +78590,10 @@ async function publishAssetsCommand(stacks, options) {
78285
78590
  if (targetStacks.length === 0) throw new Error(stackPatterns.length > 0 ? `No stacks matching ${stackPatterns.join(", ")} found in assembly. Available: ${allStacks.map(describeStack).join(", ")}` : "No stacks found in assembly");
78286
78591
  const baseRegion = namedCliRegion(options.region) ?? "us-east-1";
78287
78592
  const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
78288
- const stsClient = new STSClient({ region: baseRegion });
78593
+ const stsClient = new STSClient({
78594
+ ...awsClientDefaults(),
78595
+ region: baseRegion
78596
+ });
78289
78597
  const accountId = (await stsClient.send(new GetCallerIdentityCommand({}))).Account;
78290
78598
  stsClient.destroy();
78291
78599
  const useCdkBootstrapAssets = resolveUseCdkBootstrapAssets(options.useCdkBootstrapAssets);
@@ -82034,7 +82342,10 @@ async function pullEcrImage(imageUri, options) {
82034
82342
  const callerIdentityKey = callerRegion ?? "_unset";
82035
82343
  let callerAccount = CALLER_IDENTITY_CACHE.get(callerIdentityKey);
82036
82344
  if (callerAccount === void 0) {
82037
- const sts = new STSClient({ ...callerRegion && { region: callerRegion } });
82345
+ const sts = new STSClient({
82346
+ ...awsClientDefaults(),
82347
+ ...callerRegion && { region: callerRegion }
82348
+ });
82038
82349
  try {
82039
82350
  const identity = await sts.send(new GetCallerIdentityCommand({}));
82040
82351
  if (!identity.Account) throw new LocalInvokeBuildError$1("STS GetCallerIdentity returned no Account. Verify your AWS credentials.");
@@ -82061,6 +82372,7 @@ async function pullEcrImage(imageUri, options) {
82061
82372
  } else if (crossAccount) logger.info(`Cross-account ECR pull: image account ${parsed.accountId} != caller ${callerAccount}. Using the caller's credentials; pass --ecr-role-arn <arn> if AWS rejects with AccessDenied.`);
82062
82373
  if (crossRegion) logger.info(`Cross-region ECR pull: image region ${parsed.region} != caller ${callerRegion ?? "(unset)"}. Authenticating against the image region directly.`);
82063
82374
  const ecr = new ECRClient({
82375
+ ...awsClientDefaults(),
82064
82376
  region: parsed.region,
82065
82377
  ...assumed && { credentials: assumed }
82066
82378
  });
@@ -82086,7 +82398,10 @@ async function pullEcrImage(imageUri, options) {
82086
82398
  */
82087
82399
  async function assumeRoleForEcr(roleArn, callerRegion, logger) {
82088
82400
  logger.debug(`Assuming role ${roleArn} for ECR pull...`);
82089
- const sts = new STSClient({ ...callerRegion && { region: callerRegion } });
82401
+ const sts = new STSClient({
82402
+ ...awsClientDefaults(),
82403
+ ...callerRegion && { region: callerRegion }
82404
+ });
82090
82405
  try {
82091
82406
  const creds = (await sts.send(new AssumeRoleCommand({
82092
82407
  RoleArn: roleArn,
@@ -84415,7 +84730,10 @@ function forwardAwsEnv$2(env) {
84415
84730
  */
84416
84731
  async function resolveProfileCredentials(profile) {
84417
84732
  const { STSClient } = await import("@aws-sdk/client-sts");
84418
- const sts = new STSClient({ profile });
84733
+ const sts = new STSClient({
84734
+ ...awsClientDefaults({ profile }),
84735
+ profile
84736
+ });
84419
84737
  try {
84420
84738
  const credsProvider = sts.config.credentials;
84421
84739
  const creds = typeof credsProvider === "function" ? await credsProvider() : credsProvider;
@@ -84436,7 +84754,10 @@ async function resolveProfileCredentials(profile) {
84436
84754
  */
84437
84755
  async function assumeLambdaExecutionRole$1(roleArn, region) {
84438
84756
  const { STSClient, AssumeRoleCommand } = await import("@aws-sdk/client-sts");
84439
- const sts = new STSClient({ ...region && { region } });
84757
+ const sts = new STSClient({
84758
+ ...awsClientDefaults(),
84759
+ ...region && { region }
84760
+ });
84440
84761
  try {
84441
84762
  const creds = (await sts.send(new AssumeRoleCommand({
84442
84763
  RoleArn: roleArn,
@@ -84715,7 +85036,10 @@ async function resolvePseudoParametersForStartApi(stateRegion, options) {
84715
85036
  let accountId;
84716
85037
  try {
84717
85038
  const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
84718
- const sts = new STSClient({ ...region && { region } });
85039
+ const sts = new STSClient({
85040
+ ...awsClientDefaults(),
85041
+ ...region && { region }
85042
+ });
84719
85043
  try {
84720
85044
  accountId = (await sts.send(new GetCallerIdentityCommand({}))).Account;
84721
85045
  } finally {
@@ -84990,8 +85314,14 @@ var EcsSecretsResolutionError = class EcsSecretsResolutionError extends Error {
84990
85314
  async function resolveEcsSecrets(entries, options = {}) {
84991
85315
  if (entries.length === 0) return [];
84992
85316
  const logger = getLogger().child("ecs-secrets");
84993
- const secretsClient = options.secretsManagerClient ?? new SecretsManagerClient({ ...options.region && { region: options.region } });
84994
- const ssmClient = options.ssmClient ?? new SSMClient({ ...options.region && { region: options.region } });
85317
+ const secretsClient = options.secretsManagerClient ?? new SecretsManagerClient({
85318
+ ...awsClientDefaults(),
85319
+ ...options.region && { region: options.region }
85320
+ });
85321
+ const ssmClient = options.ssmClient ?? new SSMClient({
85322
+ ...awsClientDefaults(),
85323
+ ...options.region && { region: options.region }
85324
+ });
84995
85325
  const ownsSecretsClient = options.secretsManagerClient === void 0;
84996
85326
  const ownsSsmClient = options.ssmClient === void 0;
84997
85327
  try {
@@ -85785,7 +86115,10 @@ async function localRunTaskCommand(target, options) {
85785
86115
  async function resolvePlaceholderAccount(arn, region) {
85786
86116
  if (!arn.includes("${AWS::AccountId}")) return arn;
85787
86117
  const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
85788
- const sts = new STSClient({ ...region && { region } });
86118
+ const sts = new STSClient({
86119
+ ...awsClientDefaults(),
86120
+ ...region && { region }
86121
+ });
85789
86122
  try {
85790
86123
  const account = (await sts.send(new GetCallerIdentityCommand({}))).Account;
85791
86124
  if (!account) throw new Error(`--assume-task-role: GetCallerIdentity returned no Account; cannot resolve placeholder ARN '${arn}'. Pass the ARN explicitly: --assume-task-role <arn>`);
@@ -85800,7 +86133,10 @@ async function resolvePlaceholderAccount(arn, region) {
85800
86133
  */
85801
86134
  async function assumeTaskRole(roleArn, region) {
85802
86135
  const { STSClient, AssumeRoleCommand } = await import("@aws-sdk/client-sts");
85803
- const sts = new STSClient({ ...region && { region } });
86136
+ const sts = new STSClient({
86137
+ ...awsClientDefaults(),
86138
+ ...region && { region }
86139
+ });
85804
86140
  try {
85805
86141
  const creds = (await sts.send(new AssumeRoleCommand({
85806
86142
  RoleArn: roleArn,
@@ -85939,7 +86275,10 @@ function pickCandidateStack(stackPattern, stacks) {
85939
86275
  }
85940
86276
  async function resolveCallerAccountId$1(region) {
85941
86277
  const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
85942
- const sts = new STSClient({ ...region && { region } });
86278
+ const sts = new STSClient({
86279
+ ...awsClientDefaults(),
86280
+ ...region && { region }
86281
+ });
85943
86282
  try {
85944
86283
  return (await sts.send(new GetCallerIdentityCommand({}))).Account;
85945
86284
  } finally {
@@ -87099,6 +87438,7 @@ async function buildAgentCoreImageContext(candidate, stateProvider, options) {
87099
87438
  async function resolveCallerAccountId(region, profile) {
87100
87439
  const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
87101
87440
  const sts = new STSClient({
87441
+ ...awsClientDefaults({ profile }),
87102
87442
  ...region && { region },
87103
87443
  ...profile && { profile }
87104
87444
  });
@@ -87291,7 +87631,10 @@ function forwardAwsEnv$1(env) {
87291
87631
  }
87292
87632
  async function assumeAgentCoreExecutionRole(roleArn, region) {
87293
87633
  const { STSClient, AssumeRoleCommand } = await import("@aws-sdk/client-sts");
87294
- const sts = new STSClient({ ...region && { region } });
87634
+ const sts = new STSClient({
87635
+ ...awsClientDefaults(),
87636
+ ...region && { region }
87637
+ });
87295
87638
  try {
87296
87639
  const creds = (await sts.send(new AssumeRoleCommand({
87297
87640
  RoleArn: roleArn,
@@ -88078,7 +88421,10 @@ async function resolvePseudoParametersForInvoke(stackRegion, options) {
88078
88421
  let accountId;
88079
88422
  try {
88080
88423
  const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
88081
- const sts = new STSClient({ ...region && { region } });
88424
+ const sts = new STSClient({
88425
+ ...awsClientDefaults(),
88426
+ ...region && { region }
88427
+ });
88082
88428
  try {
88083
88429
  accountId = (await sts.send(new GetCallerIdentityCommand({}))).Account;
88084
88430
  } finally {
@@ -88221,7 +88567,10 @@ async function applyLambdaCredentialEnv(dockerEnv, args) {
88221
88567
  */
88222
88568
  async function assumeLambdaExecutionRole(roleArn, region) {
88223
88569
  const { STSClient, AssumeRoleCommand } = await import("@aws-sdk/client-sts");
88224
- const sts = new STSClient({ ...region && { region } });
88570
+ const sts = new STSClient({
88571
+ ...awsClientDefaults(),
88572
+ ...region && { region }
88573
+ });
88225
88574
  try {
88226
88575
  const creds = (await sts.send(new AssumeRoleCommand({
88227
88576
  RoleArn: roleArn,
@@ -89544,4 +89893,4 @@ function buildProgram() {
89544
89893
 
89545
89894
  //#endregion
89546
89895
  export { buildProgram };
89547
- //# sourceMappingURL=program-BeYoZQIP.js.map
89896
+ //# sourceMappingURL=program-DHJ4G_ZZ.js.map