@go-to-k/cdkd 0.301.14 → 0.301.15

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.
@@ -2,12 +2,12 @@ import { r as getAwsClients } from "./aws-clients-B_CEQGE1.js";
2
2
  import { A as SECRET_REF_MAX_CODE_POINTS, H as safeMsg, I as displayIdent, L as displaySafe, R as displayStackName, S as generateResourceNameWithFallback, V as plainIdentOr, a as safeStringify, i as isAwsAuthoredFailure, n as describeAwsFailure, r as describeAwsStatusReason, s as getLogger, x as generateResourceName, z as isPasteableIdent } from "./aws-failure-text-CdgZn80O.js";
3
3
  import { $ as protectedReplacementAdvice, $n as markReplayMayCollide, $t as ambientCredentialConfig, A as isQuotableImportValue, B as isTerminalDeleteFailure, C as setBounded, D as VALUE_NOT_SHOWN, E as assertRegionMatch, F as resolveExplicitPhysicalId, Fn as isInertUnquoted, H as observeThenDisableProtection, Hn as withheldTargetClause, In as pasteableCommand, Kt as injectiveKey, L as ProtectionFlipRegistry, M as quotedRemedyLogicalId, Mt as markCreatedBeforeFailure, N as refusalTypeShown, Nn as commandHole, Nt as markSupersedesEarlierCreate, O as isPlainImportJson, P as remedyLogicalId, Pn as hasClauseBreak, Q as pasteableAwsCommand, Qn as markNameCollision, Qt as ambientClientDefaults, Rn as plainOrDescribed, S as replayedSendWindow, St as withDerivedNameMasks, T as RESOURCE_NOT_FOUND, Tt as clearCreatedBeforeFailure, U as protectionFlipKey, V as logGroupProtectionSite, Vn as shellQuote, W as rdsFamilyProtectionSite, X as WITHHELD_AWS_COMMAND, Y as UNNAMEABLE_ID_CLAUSE, Z as isAwsCliLiteral, Zt as withPasteableAwsProfile, _ as RecentIdSet, _r as markRedactedCause, _t as createMaskedLogSinks, a as onlySecretDerived, at as startInterruptWatch, b as isInsideWindow, bn as ResourceUpdateNotSupportedError, bt as maskDeep, c as recordedPrincipalsRepair, cr as isExplicitDenyError, ct as canonicalizeRoute53QueryName, dr as isTransientServerError, dt as compositeIdSkipResult, en as clientDefaultsFor, er as relayedNameCollision, et as renderDisableCommand, ft as logicalIdShown, g as AmbiguousCreateLatch, gr as markNonRetryable, gt as stateOrphanRecordRemedy, h as AMBIGUOUS_LATCH_TTL_MS, hr as isThrottlingError, ht as segmentAfterAnchor, i as holdsSecretDerivedEntry, in as CdkdError, ir as explicitDenyPolicyKind, it as isInterruptedWaitError, j as normalizeAwsTagsToCfn, jt as markAuxiliaryFailure, k as isPlainImportValue, lt as compositeIdFormatMessage, mr as isMarkedNonRetryable, nn as AccountIdUnavailableError, o as readPrincipalLists, ot as ElapsedBudgetRegistry, p as withRemovalDefaults, pr as THROTTLING_ERROR_NAMES, pt as packCompositeId, q as userPoolProtectionSite, qn as isNameCollisionError, qt as injectiveKeyPrefix, r as SECRET_DERIVED_READ_LIVE, sr as isAmbiguousOutcomeError, tn as credentialFingerprint, u as clearOnUpdateRemoval, ur as isRetryableTransientError, ut as compositeIdSeparatorRefusal, v as ambiguousAttemptLead, vn as ProvisioningError, vr as wrapMaskedAwsError, vt as createMaskedRetryLogger, w as withoutServerErrorRetries, x as replayFollowedAmbiguousAttempt, xt as maskerOrIdentity, y as createAttemptKey, yt as isSecretDerivedValue, z as deleteWithProtectionCompensation } from "./iam-policy-targets-Dap4bLyq.js";
4
4
  import { s as ambientRegion } from "./aws-client-defaults-DBXBcg0J.js";
5
- import { $r as reDisableInstanceApiTermination, Aa as refuseMalformedNestedChildOutputs, Ao as configStringRefusal, Bl as renderAssemblyPathEscape, Bo as canonicalLambdaFunctionName, Br as unchangedBehindSecretReference, C as hasCdkAutoDeleteTag, Co as isWarmThroughputDecrease, Cr as stringifyIfAssigned, Dl as canonicalizeRegion, Dn as getStackRecords, Do as coerceCfnInteger, Dt as isAccessDeniedError, E as markRefusedBeforeApplying, Eo as coerceCfnBoolean, Es as withoutPhysicalNameCopies, Et as chunks, F as findNestedTemplateTreeDefect, Fi as getAccountInfo, Fo as requireConfigString, Fs as physicalNameCopiesOf, Gi as parseWebACLArn, Gr as deleteSkipReason, Ho as sameLambdaFunctionAddress, I as isAbsoluteAssetPath, Is as recordAttributeIdCopy, Ji as passedParameterClassesOf, Jn as secretNamedAttributeNamesOf, Jr as markWaitAbandoned, Jt as REDACTED_DELETE_ADDRESS_SKIP_REASON, Kr as withIndeterminateGuard, Kt as getCurrentProducerRegions, L as listNestedTemplateRows, Mo as replayWarn, No as requireConfigArray, Nr as getCurrentResourceSecrets, Ol as derivePartitionAndUrlSuffix, Oo as configBooleanRefusal, Os as dynamicReferenceTokens, Ot as lookupEachName, Po as requireConfigObject, Ps as recoverMaskedOutput, Qr as observeThenDisableInstanceApiTermination, R as renderNestedTemplateTreeDefect, Rl as describeFileReadFailure, S as S3_AUTO_DELETE_OBJECTS_TAG, So as coerceWarmThroughput$1, Sr as definedAttributes, T as getPriorAttempts, Tc as rewriteTemplateAssetReferences, Tn as awaitInFlightSibling, To as toFiniteNumber, Vl as resolveAssemblyPath, Vo as lambdaFunctionNameForMask, Xa as refuseMalformedResourcesForDestroy, Xr as ec2InstanceProtectionSite, Xt as redactedDeleteAddressFields, Yt as isRedactedRecordedValue, Zr as isTerminationProtectionPropagationError, Zt as redactedDeleteAddressSkip, _ as deleteTableWithIndexBusyRetry, _r as planTagDiff, ai as isSettledInstanceState, b as waitForIndexesSettled, bc as stringifyValue, br as tagMapAsList, c as DynamoDBGlobalTableProvider, ci as s3BucketDualStackDomainName, co as withheldAccountClause, cr as earliestDefined, cs as recordReferenceProvenanceEntry, ct as getNestedRevertRun, d as compensateRemovedDeletionProtection, dt as revertNestedChildFromJournal, ei as reEnableInstanceApiTermination, es as passedNoEchoParametersOf, f as deleteBudgetKey, fo as withoutSilentDropProperties, fr as acquireIdempotencyToken, fs as hasMaskableValues, g as INDEX_SETTLE_POLL_INTERVAL_MS, gr as DBPROXY_TAG_OPTIONS, gt as withNestedStackContext, h as DELETE_INDEX_WAIT_PROCEED_NOTE, hi as outputReferenceProvenanceOf, hr as DBPROXY_TAGS_WHAT, ht as getCurrentNestedStackContext, jo as readConfigString, kn as replacedDeleteFailureVerdict, ko as configIntegerRefusal, kr as waitForLambdaFunctionActive, kt as withApiLimit, l as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, li as s3BucketRegionalDomainName, ls as snapshotPassProvenance, m as resolveDynamoDbDeleteBudgetMs, mr as markDeleteStarted, oi as s3BucketArn, os as markSameGenerationBag, p as resolveDynamoDbDeleteBudgetClock, pr as isRefusedByName, qr as isWaitAbandonedError, si as s3BucketDomainName, ss as redactForState, t as DeployEngine, ta as accountArgs, u as beginDeleteWait, ui as s3BucketWebsiteUrl, uo as findSilentDropProperties, ur as reserveStackCreateToken, v as maskedLogger, vr as readTagList, w as isTruthyCfnBoolean, wl as decodeListingKey, wo as toCfnInteger, x as ECR_AUTO_DELETE_IMAGES_TAG, xo as WARM_THROUGHPUT_MEMBERS, xr as tagPlanWarning, y as relayedIndexBusyDelete, yr as refuseMalformedDesiredTags, zl as displayAssemblyPath, zo as withRetry, zr as slowCcOperationTimeoutMs, zs as carriesSecretMask } from "./deploy-engine-B0ObJCy0.js";
6
- import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-CukWclVP.js";
7
- import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, s as resolvedResourceTimeoutMs, t as canonicalizeIpv4Cidr } from "./program-9BJEui0z.js";
8
- import { RDSProvider } from "./rds-provider-D0srL6Rb.js";
9
- import { NeptuneProvider } from "./neptune-provider-BTkMpImX.js";
10
- import { ASGProvider } from "./asg-provider-ak7zMqaQ.js";
5
+ import { $r as reDisableInstanceApiTermination, Aa as refuseMalformedNestedChildOutputs, Ao as configStringRefusal, Bl as renderAssemblyPathEscape, Bo as canonicalLambdaFunctionName, Br as unchangedBehindSecretReference, C as hasCdkAutoDeleteTag, Co as isWarmThroughputDecrease, Cr as stringifyIfAssigned, Dl as canonicalizeRegion, Dn as getStackRecords, Do as coerceCfnInteger, Dt as isAccessDeniedError, E as markRefusedBeforeApplying, Eo as coerceCfnBoolean, Es as withoutPhysicalNameCopies, Et as chunks, F as findNestedTemplateTreeDefect, Fi as getAccountInfo, Fo as requireConfigString, Fs as physicalNameCopiesOf, Gi as parseWebACLArn, Gr as deleteSkipReason, Ho as sameLambdaFunctionAddress, I as isAbsoluteAssetPath, Is as recordAttributeIdCopy, Ji as passedParameterClassesOf, Jn as secretNamedAttributeNamesOf, Jr as markWaitAbandoned, Jt as REDACTED_DELETE_ADDRESS_SKIP_REASON, Kr as withIndeterminateGuard, Kt as getCurrentProducerRegions, L as listNestedTemplateRows, Mo as replayWarn, No as requireConfigArray, Nr as getCurrentResourceSecrets, Ol as derivePartitionAndUrlSuffix, Oo as configBooleanRefusal, Os as dynamicReferenceTokens, Ot as lookupEachName, Po as requireConfigObject, Ps as recoverMaskedOutput, Qr as observeThenDisableInstanceApiTermination, R as renderNestedTemplateTreeDefect, Rl as describeFileReadFailure, S as S3_AUTO_DELETE_OBJECTS_TAG, So as coerceWarmThroughput$1, Sr as definedAttributes, T as getPriorAttempts, Tc as rewriteTemplateAssetReferences, Tn as awaitInFlightSibling, To as toFiniteNumber, Vl as resolveAssemblyPath, Vo as lambdaFunctionNameForMask, Xa as refuseMalformedResourcesForDestroy, Xr as ec2InstanceProtectionSite, Xt as redactedDeleteAddressFields, Yt as isRedactedRecordedValue, Zr as isTerminationProtectionPropagationError, Zt as redactedDeleteAddressSkip, _ as deleteTableWithIndexBusyRetry, _r as planTagDiff, ai as isSettledInstanceState, b as waitForIndexesSettled, bc as stringifyValue, br as tagMapAsList, c as DynamoDBGlobalTableProvider, ci as s3BucketDualStackDomainName, co as withheldAccountClause, cr as earliestDefined, cs as recordReferenceProvenanceEntry, ct as getNestedRevertRun, d as compensateRemovedDeletionProtection, dt as revertNestedChildFromJournal, ei as reEnableInstanceApiTermination, es as passedNoEchoParametersOf, f as deleteBudgetKey, fo as withoutSilentDropProperties, fr as acquireIdempotencyToken, fs as hasMaskableValues, g as INDEX_SETTLE_POLL_INTERVAL_MS, gr as DBPROXY_TAG_OPTIONS, gt as withNestedStackContext, h as DELETE_INDEX_WAIT_PROCEED_NOTE, hi as outputReferenceProvenanceOf, hr as DBPROXY_TAGS_WHAT, ht as getCurrentNestedStackContext, jo as readConfigString, kn as replacedDeleteFailureVerdict, ko as configIntegerRefusal, kr as waitForLambdaFunctionActive, kt as withApiLimit, l as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, li as s3BucketRegionalDomainName, ls as snapshotPassProvenance, m as resolveDynamoDbDeleteBudgetMs, mr as markDeleteStarted, oi as s3BucketArn, os as markSameGenerationBag, p as resolveDynamoDbDeleteBudgetClock, pr as isRefusedByName, qr as isWaitAbandonedError, si as s3BucketDomainName, ss as redactForState, t as DeployEngine, ta as accountArgs, u as beginDeleteWait, ui as s3BucketWebsiteUrl, uo as findSilentDropProperties, ur as reserveStackCreateToken, v as maskedLogger, vr as readTagList, w as isTruthyCfnBoolean, wl as decodeListingKey, wo as toCfnInteger, x as ECR_AUTO_DELETE_IMAGES_TAG, xo as WARM_THROUGHPUT_MEMBERS, xr as tagPlanWarning, y as relayedIndexBusyDelete, yr as refuseMalformedDesiredTags, zl as displayAssemblyPath, zo as withRetry, zr as slowCcOperationTimeoutMs, zs as carriesSecretMask } from "./deploy-engine-Dy7N7-Il.js";
6
+ import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-C8Icvrf7.js";
7
+ import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, s as resolvedResourceTimeoutMs, t as canonicalizeIpv4Cidr } from "./program-CXvao3wc.js";
8
+ import { RDSProvider } from "./rds-provider-BMQvQTTS.js";
9
+ import { NeptuneProvider } from "./neptune-provider-CtnwSAGM.js";
10
+ import { ASGProvider } from "./asg-provider-ClDYCUia.js";
11
11
  import { createHash, randomUUID } from "node:crypto";
12
12
  import { 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, ListBucketsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client } from "@aws-sdk/client-s3";
13
13
  import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateAccessKeyCommand, UpdateLoginProfileCommand } from "@aws-sdk/client-iam";
@@ -34,7 +34,7 @@ import * as fs from "node:fs";
34
34
  import * as path from "node:path";
35
35
  import { AssociateVPCWithHostedZoneCommand, ChangeResourceRecordSetsCommand, ChangeTagsForResourceCommand, CreateHostedZoneCommand, CreateQueryLoggingConfigCommand, DeleteHostedZoneCommand, DeleteQueryLoggingConfigCommand, DisassociateVPCFromHostedZoneCommand, GetHostedZoneCommand, HostedZoneAlreadyExists, ListHostedZonesByNameCommand, ListQueryLoggingConfigsCommand, ListResourceRecordSetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$8, Route53Client, UpdateHostedZoneCommentCommand, UpdateHostedZoneFeaturesCommand } from "@aws-sdk/client-route-53";
36
36
  import { AddTagsCommand, CreateListenerCommand, CreateLoadBalancerCommand, CreateTargetGroupCommand, DeleteListenerCommand, DeleteLoadBalancerCommand, DeleteTargetGroupCommand, DeregisterTargetsCommand, DescribeCapacityReservationCommand, DescribeListenerAttributesCommand, DescribeListenersCommand, DescribeLoadBalancerAttributesCommand, DescribeLoadBalancersCommand, DescribeTagsCommand, DescribeTargetGroupAttributesCommand, DescribeTargetGroupsCommand, DescribeTargetHealthCommand, ElasticLoadBalancingV2Client, ModifyCapacityReservationCommand, ModifyIpPoolsCommand, ModifyListenerAttributesCommand, ModifyListenerCommand, ModifyLoadBalancerAttributesCommand, ModifyTargetGroupAttributesCommand, ModifyTargetGroupCommand, RegisterTargetsCommand, RemoveTagsCommand, SetIpAddressTypeCommand, SetSecurityGroupsCommand, SetSubnetsCommand, waitUntilLoadBalancerAvailable } from "@aws-sdk/client-elastic-load-balancing-v2";
37
- import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, EnableKeyCommand, EnableKeyRotationCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, KMSClient, ListAliasesCommand, ListKeysCommand, ListResourceTagsCommand, NotFoundException as NotFoundException$2, PutKeyPolicyCommand, ScheduleKeyDeletionCommand, TagResourceCommand as TagResourceCommand$11, UntagResourceCommand as UntagResourceCommand$11, UpdateAliasCommand, UpdateKeyDescriptionCommand } from "@aws-sdk/client-kms";
37
+ import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, DisabledException, EnableKeyCommand, EnableKeyRotationCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, KMSClient, ListAliasesCommand, ListKeysCommand, ListResourceTagsCommand, NotFoundException as NotFoundException$2, PutKeyPolicyCommand, ScheduleKeyDeletionCommand, TagResourceCommand as TagResourceCommand$11, UntagResourceCommand as UntagResourceCommand$11, UpdateAliasCommand, UpdateKeyDescriptionCommand } from "@aws-sdk/client-kms";
38
38
  import { CreateRepositoryCommand, DeleteLifecyclePolicyCommand, DeleteRepositoryCommand, DeleteRepositoryPolicyCommand, DescribeRepositoriesCommand, ECRClient, GetLifecyclePolicyCommand, LifecyclePolicyNotFoundException, ListTagsForResourceCommand as ListTagsForResourceCommand$9, PutImageScanningConfigurationCommand, PutImageTagMutabilityCommand, PutLifecyclePolicyCommand, RepositoryNotEmptyException, RepositoryNotFoundException, SetRepositoryPolicyCommand, TagResourceCommand as TagResourceCommand$12, UntagResourceCommand as UntagResourceCommand$12 } from "@aws-sdk/client-ecr";
39
39
  import { isDeepStrictEqual } from "node:util";
40
40
  import { AddTagsToResourceCommand as AddTagsToResourceCommand$2, CreateDBProxyCommand, CreateDBProxyEndpointCommand, DBProxyEndpointNotFoundFault, DBProxyNotFoundFault, DBProxyTargetGroupNotFoundFault, DBProxyTargetNotFoundFault, DeleteDBProxyCommand, DeleteDBProxyEndpointCommand, DeregisterDBProxyTargetsCommand, DescribeDBProxiesCommand, DescribeDBProxyEndpointsCommand, DescribeDBProxyTargetGroupsCommand, DescribeDBProxyTargetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$10, ModifyDBProxyCommand, ModifyDBProxyEndpointCommand, ModifyDBProxyTargetGroupCommand, RDSClient, RegisterDBProxyTargetsCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$2 } from "@aws-sdk/client-rds";
@@ -9134,6 +9134,14 @@ const KINDS_WITH_ZERO_BATCHING_WINDOW_DEFAULT = /* @__PURE__ */ new Set([
9134
9134
  "dynamodb"
9135
9135
  ]);
9136
9136
  const KINDS_WITH_STREAM_NUMERICS = /* @__PURE__ */ new Set(["kinesis", "dynamodb"]);
9137
+ const DEFAULT_BATCH_SIZE_BY_KIND = /* @__PURE__ */ new Map([
9138
+ ["sqs", 10],
9139
+ ["kinesis", 100],
9140
+ ["dynamodb", 100],
9141
+ ["kafka", 100],
9142
+ ["mq", 100],
9143
+ ["documentdb", 100]
9144
+ ]);
9137
9145
  var LambdaEventSourceMappingProvider = class {
9138
9146
  lambdaClient;
9139
9147
  createClient;
@@ -9353,6 +9361,14 @@ var LambdaEventSourceMappingProvider = class {
9353
9361
  if (wasSet("TumblingWindowInSeconds")) updateParams.TumblingWindowInSeconds = 0;
9354
9362
  }
9355
9363
  if (wasSet("MaximumBatchingWindowInSeconds") && KINDS_WITH_ZERO_BATCHING_WINDOW_DEFAULT.has(prevKind)) updateParams.MaximumBatchingWindowInSeconds = 0;
9364
+ if (wasSet("BatchSize")) {
9365
+ const defaultBatchSize = DEFAULT_BATCH_SIZE_BY_KIND.get(prevKind);
9366
+ if (defaultBatchSize !== void 0) updateParams.BatchSize = defaultBatchSize;
9367
+ }
9368
+ if (prevKind === "kafka") {
9369
+ if (wasSet("LoggingConfig")) updateParams.LoggingConfig = {};
9370
+ if (wasSet("ProvisionedPollerConfig")) updateParams.ProvisionedPollerConfig = {};
9371
+ }
9356
9372
  const updateResp = await this.lambdaClient.send(new UpdateEventSourceMappingCommand(updateParams));
9357
9373
  const eventSourceMappingArn = updateResp.EventSourceMappingArn;
9358
9374
  if (eventSourceMappingArn) await this.applyTagDiff(eventSourceMappingArn, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], log);
@@ -20905,6 +20921,7 @@ var ApiGatewayV2Provider = class {
20905
20921
  "IdentityValidationExpression"
20906
20922
  ])]
20907
20923
  ]);
20924
+ removalDefaults = /* @__PURE__ */ new Map([["AWS::ApiGatewayV2::Authorizer", /* @__PURE__ */ new Map([["IdentitySource", []]])]]);
20908
20925
  unhandledByDesign = /* @__PURE__ */ new Map([["AWS::ApiGatewayV2::Api", /* @__PURE__ */ new Map([
20909
20926
  ["Body", "OpenAPI/Swagger inline spec; routed through ImportApi, not the field-by-field CreateApi path."],
20910
20927
  ["BodyS3Location", "OpenAPI/Swagger spec on S3; routed through ImportApi, not the field-by-field CreateApi path."],
@@ -20961,9 +20978,9 @@ var ApiGatewayV2Provider = class {
20961
20978
  switch (resourceType) {
20962
20979
  case "AWS::ApiGatewayV2::Api": return this.updateApi(logicalId, physicalId, resourceType, properties, previousProperties, log);
20963
20980
  case "AWS::ApiGatewayV2::Stage": return this.updateStage(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
20964
- case "AWS::ApiGatewayV2::Integration": return this.updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
20981
+ case "AWS::ApiGatewayV2::Integration": return this.updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true, context);
20965
20982
  case "AWS::ApiGatewayV2::Route": return this.updateRoute(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
20966
- case "AWS::ApiGatewayV2::Authorizer": return this.updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log);
20983
+ case "AWS::ApiGatewayV2::Authorizer": return this.updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log, context);
20967
20984
  default: throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "Unsupported API Gateway V2 resource type for in-place update in cdkd; re-deploy with cdkd deploy --replace, or destroy + redeploy the stack.");
20968
20985
  }
20969
20986
  }
@@ -21725,7 +21742,7 @@ var ApiGatewayV2Provider = class {
21725
21742
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Stage ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
21726
21743
  }
21727
21744
  }
21728
- async updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, restoreFromAws = false) {
21745
+ async updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, restoreFromAws = false, context) {
21729
21746
  const apiId = properties["ApiId"] ?? previousProperties["ApiId"];
21730
21747
  if (!apiId) throw new ProvisioningError(`ApiId is required to update Integration ${logicalId}`, resourceType, logicalId, physicalId);
21731
21748
  if (properties["ApiId"] !== void 0 && previousProperties["ApiId"] !== void 0 && properties["ApiId"] !== previousProperties["ApiId"]) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "ApiId is immutable on AWS::ApiGatewayV2::Integration; re-deploy with cdkd deploy --replace");
@@ -21788,7 +21805,32 @@ var ApiGatewayV2Provider = class {
21788
21805
  input.IntegrationSubtype = properties["IntegrationSubtype"];
21789
21806
  changed = true;
21790
21807
  }
21791
- if (input.IntegrationSubtype === void 0) {
21808
+ const subtypeRemoved = context?.removedProperties !== void 0 ? context.removedProperties.has("IntegrationSubtype") : previousProperties["IntegrationSubtype"] != null && properties["IntegrationSubtype"] == null;
21809
+ let effectiveProperties;
21810
+ if (subtypeRemoved && (context?.replayingState !== true || properties["IntegrationUri"] != null)) {
21811
+ if (properties["IntegrationUri"] == null) throw markNonRetryable(new ProvisioningError(safeMsg`${logicalId} (${resourceType}): the previous deploy recorded IntegrationSubtype and this template does not declare it. CloudFormation fails that update (AWS refuses a service integration without its subtype: Invalid integration URI specified). Keep IntegrationSubtype declared, or declare an IntegrationUri to turn this into a URI-based integration. The integration was not updated.`, resourceType, logicalId, physicalId));
21812
+ input.IntegrationUri = properties["IntegrationUri"];
21813
+ changed = true;
21814
+ } else if (subtypeRemoved) {
21815
+ let liveSubtype;
21816
+ try {
21817
+ liveSubtype = (await this.getClient().send(new GetIntegrationCommand({
21818
+ ApiId: apiId,
21819
+ IntegrationId: physicalId
21820
+ }))).IntegrationSubtype;
21821
+ } catch (error) {
21822
+ const cause = error instanceof Error ? error : void 0;
21823
+ throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to read API Gateway V2 Integration ${logicalId} before restoring it: ${text}`, resourceType, logicalId, physicalId, cause));
21824
+ }
21825
+ if (liveSubtype) {
21826
+ input.IntegrationSubtype = liveSubtype;
21827
+ effectiveProperties = {
21828
+ ...properties,
21829
+ IntegrationSubtype: liveSubtype
21830
+ };
21831
+ log.warn(safeMsg`${logicalId} (${resourceType}): the state being restored does not declare IntegrationSubtype; the rollback keeps the integration's current subtype, because AWS refuses a service integration without it.`);
21832
+ }
21833
+ } else if (input.IntegrationSubtype === void 0) {
21792
21834
  const liveSubtype = properties["IntegrationSubtype"] ?? previousProperties["IntegrationSubtype"];
21793
21835
  if (liveSubtype !== void 0) input.IntegrationSubtype = liveSubtype;
21794
21836
  }
@@ -21813,11 +21855,13 @@ var ApiGatewayV2Provider = class {
21813
21855
  input.TlsConfig = properties["TlsConfig"];
21814
21856
  changed = true;
21815
21857
  }
21858
+ if (changed && input.IntegrationSubtype !== void 0) input.RequestParameters = this.serviceIntegrationParameters(logicalId, physicalId, resourceType, input.RequestParameters ?? properties["RequestParameters"]);
21816
21859
  if (!changed) {
21817
21860
  log.debug(`No mutable Integration fields changed for ${logicalId}; skipping UpdateIntegration`);
21818
21861
  return {
21819
21862
  physicalId,
21820
- wasReplaced: false
21863
+ wasReplaced: false,
21864
+ ...effectiveProperties && { effectiveProperties }
21821
21865
  };
21822
21866
  }
21823
21867
  log.debug(`Updating API Gateway V2 Integration ${logicalId}: ${physicalId}`);
@@ -21825,7 +21869,8 @@ var ApiGatewayV2Provider = class {
21825
21869
  await this.getClient().send(new UpdateIntegrationCommand(input));
21826
21870
  return {
21827
21871
  physicalId,
21828
- wasReplaced: false
21872
+ wasReplaced: false,
21873
+ ...effectiveProperties && { effectiveProperties }
21829
21874
  };
21830
21875
  } catch (error) {
21831
21876
  const cause = error instanceof Error ? error : void 0;
@@ -21930,7 +21975,8 @@ var ApiGatewayV2Provider = class {
21930
21975
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Route ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
21931
21976
  }
21932
21977
  }
21933
- async updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log) {
21978
+ async updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log, context) {
21979
+ properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
21934
21980
  const apiId = properties["ApiId"] ?? previousProperties["ApiId"];
21935
21981
  if (!apiId) throw new ProvisioningError(`ApiId is required to update Authorizer ${logicalId}`, resourceType, logicalId, physicalId);
21936
21982
  if (properties["ApiId"] !== void 0 && previousProperties["ApiId"] !== void 0 && properties["ApiId"] !== previousProperties["ApiId"]) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "ApiId is immutable on AWS::ApiGatewayV2::Authorizer; re-deploy with cdkd deploy --replace");
@@ -22002,6 +22048,15 @@ var ApiGatewayV2Provider = class {
22002
22048
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Authorizer ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
22003
22049
  }
22004
22050
  }
22051
+ serviceIntegrationParameters(logicalId, physicalId, resourceType, sent) {
22052
+ if (sent == null) return void 0;
22053
+ const redacted = Object.keys(sent).filter((key) => {
22054
+ const value = sent[key];
22055
+ return typeof value === "string" && (dynamicReferenceTokens(value).length > 0 || value === "***");
22056
+ });
22057
+ if (redacted.length > 0) throw markNonRetryable(new ProvisioningError(safeMsg`${logicalId} (${resourceType}): this update must re-send the service integration's RequestParameters (AWS re-validates the full mapping beside IntegrationSubtype), but the value of ${redacted.join(", ")} is a redacted secret reference that cdkd cannot send. The integration was not updated.`, resourceType, logicalId, physicalId));
22058
+ return sent;
22059
+ }
22005
22060
  clearableUpdate(next, previous, resetValue) {
22006
22061
  const resolved = next !== void 0 ? next : previous !== void 0 ? resetValue : void 0;
22007
22062
  return {
@@ -25549,7 +25604,7 @@ const CLEARED_BY_TLS_DOWNGRADE = /* @__PURE__ */ new Set(["SslPolicy", "Certific
25549
25604
  const listenerLeftInPlaceWarning = (logicalId, names, caller) => {
25550
25605
  const one = names.length === 1;
25551
25606
  const subject = one ? "property" : "properties";
25552
- return caller === "rollback" ? safeMsg`${logicalId} (AWS::ElasticLoadBalancingV2::Listener): ${subject} ${names.join(", ")} ${one ? "is" : "are"} absent from the state being restored; ModifyListener keeps a setting it is not sent, so the rollback leaves the value the failed deploy applied in place.` : safeMsg`${logicalId} (AWS::ElasticLoadBalancingV2::Listener): ${subject} ${names.join(", ")} ${one ? "was" : "were"} removed from the template; ModifyListener keeps a setting it is not sent and cdkd sends no reset, so the current AWS value stays in place. Declare the intended value explicitly to change it.`;
25607
+ return caller === "rollback" ? safeMsg`${logicalId} (AWS::ElasticLoadBalancingV2::Listener): ${subject} ${names.join(", ")} ${one ? "is" : "are"} absent from the state being restored; ModifyListener keeps a setting it is not sent, so the rollback leaves the value the failed deploy applied in place.` : safeMsg`${logicalId} (AWS::ElasticLoadBalancingV2::Listener): ${subject} ${names.join(", ")} ${one ? "was" : "were"} removed from the template and ${one ? "keeps its" : "keep their"} current AWS value, as CloudFormation leaves ${one ? "it" : "them"}; ModifyListener keeps a setting it is not sent. Declare the intended value explicitly to change it.`;
25553
25608
  };
25554
25609
  var ELBv2Provider = class {
25555
25610
  elbv2Client;
@@ -28709,6 +28764,10 @@ function templateZoneVisibility(properties) {
28709
28764
  if (!Array.isArray(vpcs)) return void 0;
28710
28765
  return vpcs.some((v) => typeof v === "object" && v !== null && !Array.isArray(v) && !isIntrinsicOnly(v)) ? true : void 0;
28711
28766
  }
28767
+ const VPCS_KEPT_ON_REMOVAL_NOTE = "A private hosted zone stays private and keeps at least one VPC; to change its associations, declare the VPCs you want and deploy.";
28768
+ function declaresNoVpcs(vpcs) {
28769
+ return vpcs == null || Array.isArray(vpcs) && vpcs.length === 0;
28770
+ }
28712
28771
  function sentence$1(text) {
28713
28772
  return text.endsWith(".") ? text : `${text}.`;
28714
28773
  }
@@ -28789,7 +28848,7 @@ var Route53Provider = class {
28789
28848
  }
28790
28849
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
28791
28850
  switch (resourceType) {
28792
- case "AWS::Route53::HostedZone": return this.updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, context?.maskSecrets);
28851
+ case "AWS::Route53::HostedZone": return this.updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, context?.maskSecrets, context);
28793
28852
  case "AWS::Route53::RecordSet": return this.updateRecordSet(logicalId, physicalId, resourceType, properties, previousProperties, context);
28794
28853
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
28795
28854
  }
@@ -28934,7 +28993,7 @@ var Route53Provider = class {
28934
28993
  } : void 0;
28935
28994
  }
28936
28995
  }
28937
- async updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, mask) {
28996
+ async updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, mask, context) {
28938
28997
  this.logger.debug(`Updating Route 53 hosted zone ${logicalId}: ${physicalId}`);
28939
28998
  try {
28940
28999
  const hostedZoneConfig = properties["HostedZoneConfig"];
@@ -28954,6 +29013,7 @@ var Route53Provider = class {
28954
29013
  }));
28955
29014
  const nameServers = (await this.getClient().send(new GetHostedZoneCommand({ Id: physicalId }))).DelegationSet?.NameServers ?? [];
28956
29015
  this.logger.debug(`Successfully updated hosted zone ${logicalId}`);
29016
+ if (context?.desiredFromAwsReadback !== true && declaresNoVpcs(properties["VPCs"]) && Array.isArray(previousProperties["VPCs"]) && previousProperties["VPCs"].length > 0) this.logger.warn(context?.replayingState ? safeMsg`${logicalId} (AWS::Route53::HostedZone): VPCs is absent from the state being restored, so the rollback leaves the zone's VPC associations in place. ${VPCS_KEPT_ON_REMOVAL_NOTE}` : safeMsg`${logicalId} (AWS::Route53::HostedZone): VPCs was removed from the template, and the zone keeps its current VPC associations, as CloudFormation leaves them. ${VPCS_KEPT_ON_REMOVAL_NOTE}`);
28957
29017
  return {
28958
29018
  physicalId,
28959
29019
  wasReplaced: false,
@@ -36450,6 +36510,7 @@ var KMSProvider = class {
36450
36510
  "Origin",
36451
36511
  "BypassPolicyLockoutSafetyCheck"
36452
36512
  ])], ["AWS::KMS::Alias", /* @__PURE__ */ new Set(["AliasName", "TargetKeyId"])]]);
36513
+ removalDefaults = /* @__PURE__ */ new Map([["AWS::KMS::Key", /* @__PURE__ */ new Map([["RotationPeriodInDays", 365]])]]);
36453
36514
  getClient() {
36454
36515
  if (!this.client) this.client = new KMSClient({
36455
36516
  ...ambientClientDefaults(),
@@ -36474,7 +36535,7 @@ var KMSProvider = class {
36474
36535
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
36475
36536
  assertRegionMatch(context?.expectedRegion ? await this.getClient().config.region() : void 0, context?.expectedRegion, resourceType, logicalId, physicalId, "pre-update");
36476
36537
  switch (resourceType) {
36477
- case "AWS::KMS::Key": return this.updateKey(logicalId, physicalId, resourceType, properties, _previousProperties, context?.maskSecrets);
36538
+ case "AWS::KMS::Key": return this.updateKey(logicalId, physicalId, resourceType, properties, _previousProperties, context);
36478
36539
  case "AWS::KMS::Alias": return this.updateAlias(logicalId, physicalId, resourceType, properties, context?.maskSecrets);
36479
36540
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
36480
36541
  }
@@ -36493,7 +36554,7 @@ var KMSProvider = class {
36493
36554
  const keyPolicy = properties["KeyPolicy"];
36494
36555
  const keySpec = properties["KeySpec"];
36495
36556
  const keyUsage = properties["KeyUsage"];
36496
- const enableKeyRotation = properties["EnableKeyRotation"];
36557
+ const enableKeyRotation = templateBool(properties["EnableKeyRotation"]);
36497
36558
  const multiRegion = properties["MultiRegion"];
36498
36559
  const origin = properties["Origin"];
36499
36560
  const bypassPolicyLockoutSafetyCheck = properties["BypassPolicyLockoutSafetyCheck"];
@@ -36514,7 +36575,7 @@ var KMSProvider = class {
36514
36575
  const inputDigest = createHash("sha256").update(JSON.stringify({
36515
36576
  input,
36516
36577
  enableKeyRotation: enableKeyRotation === true,
36517
- enabled: properties["Enabled"] !== false
36578
+ enabled: templateBool(properties["Enabled"]) !== false
36518
36579
  })).digest("hex");
36519
36580
  let createdKeyId;
36520
36581
  let supersededPending = false;
@@ -36550,7 +36611,7 @@ var KMSProvider = class {
36550
36611
  if (replayWindow !== void 0) await this.reportPossibleOrphanKeys(logicalId, input, replayWindow);
36551
36612
  }
36552
36613
  createdKeyId = keyId;
36553
- if (enableKeyRotation) {
36614
+ if (enableKeyRotation === true) {
36554
36615
  const rotationPeriodInDays = properties["RotationPeriodInDays"];
36555
36616
  this.logger.debug(`Enabling key rotation for KMS Key ${logicalId}`);
36556
36617
  await this.getClient().send(new EnableKeyRotationCommand({
@@ -36558,7 +36619,7 @@ var KMSProvider = class {
36558
36619
  ...rotationPeriodInDays !== void 0 && { RotationPeriodInDays: rotationPeriodInDays }
36559
36620
  }));
36560
36621
  }
36561
- if (properties["Enabled"] === false) {
36622
+ if (templateBool(properties["Enabled"]) === false) {
36562
36623
  this.logger.debug(`Disabling KMS Key ${logicalId}`);
36563
36624
  await this.getClient().send(new DisableKeyCommand({ KeyId: keyId }));
36564
36625
  }
@@ -36698,9 +36759,13 @@ var KMSProvider = class {
36698
36759
  const deletion = shown.map((keyId) => aws`aws kms schedule-key-deletion --key-id ${keyId}${region} --pending-window-in-days 7`.render()).join(" ; ");
36699
36760
  this.logger.warn(safeMsg`${lead}, and KMS may have created a key then that no cdkd state records. ${candidates.length} customer managed key(s) created between ${since} and ${until} match this key's settings: ${shown.join(", ")}${candidates.length > shown.length ? ", ..." : ""}. cdkd does not adopt or delete them, because a key has no name or token that ties it to ${logicalId} -- another key with the same settings is indistinguishable. ${window.replayedInSend === true ? "cdkd recorded the key the create returned, so the orphan (if any) and that key both exist." : "Creating a new key now, so the orphan (if any) and the new key will both exist."} First inspect each candidate: ${inspect}. Only after confirming a key is this deploy's orphan and no other deploy uses it, schedule its deletion: ${deletion}.${incomplete}`);
36700
36761
  }
36701
- async updateKey(logicalId, physicalId, resourceType, properties, previousProperties, mask) {
36762
+ async updateKey(logicalId, physicalId, resourceType, properties, previousProperties, context) {
36702
36763
  this.logger.debug(`Updating KMS Key ${logicalId}: ${physicalId}`);
36764
+ const mask = context?.maskSecrets;
36765
+ properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
36703
36766
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
36767
+ const newEnabled = templateBool(properties["Enabled"]);
36768
+ const enabledChange = newEnabled === templateBool(previousProperties["Enabled"]) ? void 0 : newEnabled === false ? "disable" : "enable";
36704
36769
  try {
36705
36770
  const newDescription = properties["Description"];
36706
36771
  if (newDescription !== previousProperties["Description"]) {
@@ -36710,41 +36775,49 @@ var KMSProvider = class {
36710
36775
  Description: newDescription ?? ""
36711
36776
  }));
36712
36777
  }
36713
- const newEnableKeyRotation = properties["EnableKeyRotation"];
36714
- if (newEnableKeyRotation !== previousProperties["EnableKeyRotation"]) {
36715
- if (newEnableKeyRotation) {
36716
- const rotationPeriodInDays = properties["RotationPeriodInDays"];
36778
+ if (enabledChange === "enable") {
36779
+ this.logger.debug(`Enabling KMS Key ${logicalId}`);
36780
+ await this.getClient().send(new EnableKeyCommand({ KeyId: physicalId }));
36781
+ }
36782
+ const newEnableKeyRotation = templateBool(properties["EnableKeyRotation"]);
36783
+ const oldEnableKeyRotation = templateBool(previousProperties["EnableKeyRotation"]);
36784
+ const rotationPeriodInDays = properties["RotationPeriodInDays"];
36785
+ if (newEnableKeyRotation === true) {
36786
+ if (newEnableKeyRotation !== oldEnableKeyRotation || rotationPeriodInDays !== void 0 && rotationPeriodInDays !== previousProperties["RotationPeriodInDays"]) {
36717
36787
  this.logger.debug(`Enabling key rotation for KMS Key ${logicalId}`);
36718
- await this.getClient().send(new EnableKeyRotationCommand({
36788
+ await this.sendRotation(() => this.getClient().send(new EnableKeyRotationCommand({
36719
36789
  KeyId: physicalId,
36720
36790
  ...rotationPeriodInDays !== void 0 && { RotationPeriodInDays: rotationPeriodInDays }
36721
- }));
36722
- } else {
36723
- this.logger.debug(`Disabling key rotation for KMS Key ${logicalId}`);
36724
- await this.getClient().send(new DisableKeyRotationCommand({ KeyId: physicalId }));
36791
+ })), enabledChange === "enable", resourceType, logicalId, physicalId);
36725
36792
  }
36793
+ } else if (newEnableKeyRotation !== oldEnableKeyRotation) {
36794
+ this.logger.debug(`Disabling key rotation for KMS Key ${logicalId}`);
36795
+ await this.sendRotation(() => this.getClient().send(new DisableKeyRotationCommand({ KeyId: physicalId })), enabledChange === "enable", resourceType, logicalId, physicalId);
36726
36796
  }
36727
- const newEnabled = properties["Enabled"];
36728
- if (newEnabled !== previousProperties["Enabled"]) {
36729
- if (newEnabled === false) {
36730
- this.logger.debug(`Disabling KMS Key ${logicalId}`);
36731
- await this.getClient().send(new DisableKeyCommand({ KeyId: physicalId }));
36732
- } else {
36733
- this.logger.debug(`Enabling KMS Key ${logicalId}`);
36734
- await this.getClient().send(new EnableKeyCommand({ KeyId: physicalId }));
36735
- }
36797
+ if (enabledChange === "disable") {
36798
+ this.logger.debug(`Disabling KMS Key ${logicalId}`);
36799
+ await this.getClient().send(new DisableKeyCommand({ KeyId: physicalId }));
36736
36800
  }
36737
36801
  await this.applyTagDiff(physicalId, resourceType, logicalId, previousProperties["Tags"], properties["Tags"]);
36738
36802
  const newKeyPolicy = properties["KeyPolicy"];
36739
36803
  const oldKeyPolicy = previousProperties["KeyPolicy"];
36740
36804
  const newPolicyStr = newKeyPolicy ? typeof newKeyPolicy === "string" ? newKeyPolicy : JSON.stringify(newKeyPolicy) : void 0;
36741
- if (newPolicyStr !== (oldKeyPolicy ? typeof oldKeyPolicy === "string" ? oldKeyPolicy : JSON.stringify(oldKeyPolicy) : void 0) && newPolicyStr) {
36805
+ const oldPolicyStr = oldKeyPolicy ? typeof oldKeyPolicy === "string" ? oldKeyPolicy : JSON.stringify(oldKeyPolicy) : void 0;
36806
+ const policyRemoved = context?.removedProperties !== void 0 ? context.removedProperties.has("KeyPolicy") : oldKeyPolicy !== void 0 && newKeyPolicy === void 0;
36807
+ if (newPolicyStr !== oldPolicyStr && newPolicyStr) {
36742
36808
  this.logger.debug(`Updating key policy for KMS Key ${logicalId}`);
36743
36809
  await this.getClient().send(new PutKeyPolicyCommand({
36744
36810
  KeyId: physicalId,
36745
36811
  PolicyName: "default",
36746
36812
  Policy: newPolicyStr
36747
36813
  }));
36814
+ } else if (policyRemoved && newKeyPolicy === void 0) {
36815
+ this.logger.debug(safeMsg`Resetting key policy for KMS Key ${logicalId} to the default`);
36816
+ await this.getClient().send(new PutKeyPolicyCommand({
36817
+ KeyId: physicalId,
36818
+ PolicyName: "default",
36819
+ Policy: await this.defaultKeyPolicy(physicalId)
36820
+ }));
36748
36821
  }
36749
36822
  this.logger.debug(`Successfully updated KMS Key ${logicalId}`);
36750
36823
  return {
@@ -36752,10 +36825,35 @@ var KMSProvider = class {
36752
36825
  wasReplaced: false
36753
36826
  };
36754
36827
  } catch (error) {
36828
+ if (error instanceof CdkdError) throw error;
36755
36829
  const cause = error instanceof Error ? error : void 0;
36756
36830
  throw this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to update KMS Key ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
36757
36831
  }
36758
36832
  }
36833
+ async sendRotation(send, justEnabled, resourceType, logicalId, physicalId) {
36834
+ try {
36835
+ await send();
36836
+ } catch (error) {
36837
+ if (!(error instanceof DisabledException) || justEnabled) throw error;
36838
+ throw markNonRetryable(new ProvisioningError(safeMsg`Failed to update KMS Key ${logicalId}: the key is currently disabled in AWS, and KMS refuses a key rotation change on a disabled key (CloudFormation fails this update too). Enable the key first (declare Enabled: true, or enable it in AWS), or drop the rotation change from this update.`, resourceType, logicalId, physicalId, error));
36839
+ }
36840
+ }
36841
+ async defaultKeyPolicy(keyId) {
36842
+ const resp = await this.getClient().send(new DescribeKeyCommand({ KeyId: keyId }));
36843
+ const match = /^arn:([^:]+):kms:[^:]*:(\d{12}):key\//.exec(resp.KeyMetadata?.Arn ?? "");
36844
+ if (match === null) throw new Error("DescribeKey returned no key ARN, so the default key policy cannot name the account");
36845
+ return JSON.stringify({
36846
+ Version: "2012-10-17",
36847
+ Id: "key-default-1",
36848
+ Statement: [{
36849
+ Sid: "Enable IAM User Permissions",
36850
+ Effect: "Allow",
36851
+ Principal: { AWS: `arn:${match[1]}:iam::${match[2]}:root` },
36852
+ Action: "kms:*",
36853
+ Resource: "*"
36854
+ }]
36855
+ });
36856
+ }
36759
36857
  async deleteKey(logicalId, physicalId, resourceType, properties, context) {
36760
36858
  this.logger.debug(`Scheduling deletion for KMS Key ${logicalId}: ${physicalId}`);
36761
36859
  const pendingWindowInDays = properties?.["PendingWindowInDays"] ?? 7;
@@ -36962,6 +37060,11 @@ var KMSProvider = class {
36962
37060
  return null;
36963
37061
  }
36964
37062
  };
37063
+ function templateBool(value) {
37064
+ if (value === void 0 || value === null) return void 0;
37065
+ if (typeof value === "string") return value.toLowerCase() === "true";
37066
+ return Boolean(value);
37067
+ }
36965
37068
 
36966
37069
  //#endregion
36967
37070
  //#region src/provisioning/providers/budgets-budget-provider.ts
@@ -47189,4 +47292,4 @@ var ACMCertificateProvider = class {
47189
47292
 
47190
47293
  //#endregion
47191
47294
  export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, AppSyncProvider, BudgetsBudgetProvider, CloudFrontDistributionProvider, CloudFrontOACProvider, CloudFrontOAIProvider, CloudTrailProvider, CloudWatchAlarmProvider, CloudWatchAnomalyDetectorProvider, CodeBuildProvider, CodeCommitRepositoryProvider, CognitoUserPoolProvider, DLMLifecyclePolicyProvider, DocDBProvider, DocDBSubnetGroupProvider, DynamoDBGlobalTableProvider, DynamoDBTableProvider, EC2Provider, ECRProvider, ECSProvider, EFSProvider, ELBv2Provider, EMRClusterProvider, EMRInstanceFleetConfigProvider, EMRInstanceGroupConfigProvider, ElastiCacheProvider, EventBridgeBusProvider, EventBridgeRuleProvider, FSxFileSystemProvider, FirehoseProvider, GlueConnectionProvider, GlueCrawlerProvider, GlueJobProvider, GlueProvider, GlueSecurityConfigurationProvider, GlueTriggerProvider, GlueWorkflowProvider, IAMAccessKeyProvider, IAMInstanceProfileProvider, IAMManagedPolicyProvider, IAMPolicyProvider, IAMRoleProvider, IAMUserGroupProvider, KMSProvider, KinesisStreamConsumerProvider, KinesisStreamProvider, LambdaEventInvokeConfigProvider, LambdaEventSourceMappingProvider, LambdaFunctionProvider, LambdaLayerVersionProvider, LambdaMicrovmImageProvider, LambdaNetworkConnectorProvider, LambdaPermissionProvider, LambdaUrlProvider, LambdaWebFunctionEndpointProvider, LambdaWebFunctionRevisionProvider, LogsLogGroupProvider, NeptuneProvider, NestedStackProvider, PipesPipeProvider, RDSDBProxyEndpointProvider, RDSDBProxyProvider, RDSDBProxyTargetGroupProvider, RDSProvider, Route53Provider, S3BucketPolicyProvider, S3BucketProvider, S3DirectoryBucketProvider, S3TablesProvider, S3VectorsProvider, SNSSubscriptionProvider, SNSTopicPolicyProvider, SNSTopicProvider, SQSQueuePolicyProvider, SQSQueueProvider, SSMParameterProvider, SchedulerScheduleProvider, SecretsManagerSecretProvider, ServiceDiscoveryProvider, StepFunctionsProvider, WAFv2WebACLProvider, WaitConditionHandleProvider };
47192
- //# sourceMappingURL=provider-classes-Dmz-lVVh.js.map
47295
+ //# sourceMappingURL=provider-classes-CBbWGsK0.js.map