@go-to-k/cdkd 0.301.14 → 0.302.0

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.
Files changed (33) hide show
  1. package/dist/{asg-provider-ak7zMqaQ.js → asg-provider-BRr_hsky.js} +5 -5
  2. package/dist/asg-provider-BRr_hsky.js.map +1 -0
  3. package/dist/{aws-failure-text-CdgZn80O.js → aws-failure-text-BDZdavf4.js} +310 -35
  4. package/dist/aws-failure-text-BDZdavf4.js.map +1 -0
  5. package/dist/cli.js +2 -2
  6. package/dist/{deploy-engine-B0ObJCy0.js → deploy-engine-DU0BoQqo.js} +1575 -492
  7. package/dist/deploy-engine-DU0BoQqo.js.map +1 -0
  8. package/dist/{iam-policy-targets-Dap4bLyq.js → iam-policy-targets-Dnk6FCsr.js} +2 -2
  9. package/dist/{iam-policy-targets-Dap4bLyq.js.map → iam-policy-targets-Dnk6FCsr.js.map} +1 -1
  10. package/dist/{iam-role-provider-CukWclVP.js → iam-role-provider-WGsb9RxZ.js} +14 -5
  11. package/dist/iam-role-provider-WGsb9RxZ.js.map +1 -0
  12. package/dist/index.d.ts +31 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +4 -4
  15. package/dist/{neptune-provider-BTkMpImX.js → neptune-provider-WE1O3kXY.js} +7 -16
  16. package/dist/neptune-provider-WE1O3kXY.js.map +1 -0
  17. package/dist/{program-9BJEui0z.js → program-BVLiidXb.js} +172 -30
  18. package/dist/program-BVLiidXb.js.map +1 -0
  19. package/dist/{provider-classes-Dmz-lVVh.js → provider-classes-CXSiWJVn.js} +235 -125
  20. package/dist/provider-classes-CXSiWJVn.js.map +1 -0
  21. package/dist/{rds-provider-D0srL6Rb.js → rds-provider-6RgDTDCV.js} +7 -16
  22. package/dist/rds-provider-6RgDTDCV.js.map +1 -0
  23. package/dist/{version-BTi3OoSX.js → version-C2XBsD-i.js} +2 -2
  24. package/dist/{version-BTi3OoSX.js.map → version-C2XBsD-i.js.map} +1 -1
  25. package/package.json +1 -1
  26. package/dist/asg-provider-ak7zMqaQ.js.map +0 -1
  27. package/dist/aws-failure-text-CdgZn80O.js.map +0 -1
  28. package/dist/deploy-engine-B0ObJCy0.js.map +0 -1
  29. package/dist/iam-role-provider-CukWclVP.js.map +0 -1
  30. package/dist/neptune-provider-BTkMpImX.js.map +0 -1
  31. package/dist/program-9BJEui0z.js.map +0 -1
  32. package/dist/provider-classes-Dmz-lVVh.js.map +0 -1
  33. package/dist/rds-provider-D0srL6Rb.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { r as getAwsClients } from "./aws-clients-B_CEQGE1.js";
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
- 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";
2
+ import { C as generateResourceName, G as displayIdent, J as isPasteableIdent, K as displaySafe, T as generatedNameFor, X as plainIdentOr, Z as safeMsg, a as safeStringify, i as isAwsAuthoredFailure, j as recordedGeneratedNameKept, n as describeAwsFailure, q as displayStackName, r as describeAwsStatusReason, s as getLogger, w as generateResourceNameWithFallback, z as SECRET_REF_MAX_CODE_POINTS } from "./aws-failure-text-BDZdavf4.js";
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-Dnk6FCsr.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 { Ar as markDeleteStarted, Bo as toCfnInteger, C as hasCdkAutoDeleteTag, Ci as s3BucketDomainName, Cs as redactForState, Dt as isAccessDeniedError, E as markRefusedBeforeApplying, Ei as s3BucketWebsiteUrl, Eo as findSilentDropProperties, Er as reserveStackCreateToken, Et as chunks, F as findNestedTemplateTreeDefect, Fn as replacedDeleteFailureVerdict, Fr as refuseMalformedDesiredTags, Go as configIntegerRefusal, Gr as waitForLambdaFunctionActive, Ho as coerceCfnBoolean, Hs as withoutPhysicalNameCopies, I as isAbsoluteAssetPath, Ir as tagMapAsList, Jo as replayWarn, Jt as REDACTED_DELETE_ADDRESS_SKIP_REASON, Ka as refuseMalformedNestedChildOutputs, Kl as canonicalizeRegion, Ko as configStringRefusal, Kt as getCurrentProducerRegions, L as listNestedTemplateRows, Lo as WARM_THROUGHPUT_MEMBERS, Lr as tagPlanWarning, Mr as DBPROXY_TAG_OPTIONS, Nn as getStackRecords, Nr as planTagDiff, Oo as withoutSilentDropProperties, Or as acquireIdempotencyToken, Os as hasMaskableValues, Ot as lookupEachName, Pr as readTagList, Qs as recordAttributeIdCopy, R as renderNestedTemplateTreeDefect, Ro as coerceWarmThroughput$1, Rr as definedAttributes, S as S3_AUTO_DELETE_OBJECTS_TAG, Si as s3BucketArn, Ss as markSameGenerationBag, T as getPriorAttempts, Ti as s3BucketRegionalDomainName, Ts as snapshotPassProvenance, Ul as decodeListingKey, Uo as coerceCfnInteger, Vo as toFiniteNumber, Wc as rewriteTemplateAssetReferences, Wo as configBooleanRefusal, Ws as dynamicReferenceTokens, Xo as requireConfigObject, Xs as recoverMaskedOutput, Xt as redactedDeleteAddressFields, Yo as requireConfigArray, Yr as getCurrentResourceSecrets, Yt as isRedactedRecordedValue, Zi as getAccountInfo, Zo as requireConfigString, Zs as physicalNameCopiesOf, Zt as redactedDeleteAddressSkip, _ as deleteTableWithIndexBusyRetry, _a as accountArgs, au as renderAssemblyPathEscape, b as waitForIndexesSettled, c as DynamoDBGlobalTableProvider, ci as withIndeterminateGuard, ct as getNestedRevertRun, d as compensateRemovedDeletionProtection, dt as revertNestedChildFromJournal, f as deleteBudgetKey, fi as ec2InstanceProtectionSite, fo as refuseMalformedResourcesForDestroy, g as INDEX_SETTLE_POLL_INTERVAL_MS, gi as reEnableInstanceApiTermination, gs as passedNoEchoParametersOf, gt as withNestedStackContext, h as DELETE_INDEX_WAIT_PROCEED_NOTE, hi as reDisableInstanceApiTermination, ht as getCurrentNestedStackContext, is as sameLambdaFunctionAddress, iu as displayAssemblyPath, ji as outputReferenceProvenanceOf, jn as awaitInFlightSibling, jr as DBPROXY_TAGS_WHAT, kr as isRefusedByName, kt as withApiLimit, l as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, li as isWaitAbandonedError, m as resolveDynamoDbDeleteBudgetMs, mi as observeThenDisableInstanceApiTermination, ni as unchangedBehindSecretReference, ns as canonicalLambdaFunctionName, ou as resolveAssemblyPath, p as resolveDynamoDbDeleteBudgetClock, pi as isTerminationProtectionPropagationError, ql as derivePartitionAndUrlSuffix, qo as readConfigString, rs as lambdaFunctionNameForMask, ru as describeFileReadFailure, sa as parseWebACLArn, si as deleteSkipReason, t as DeployEngine, tc as carriesSecretMask, ti as slowCcOperationTimeoutMs, ts as withRetry, u as beginDeleteWait, ua as passedParameterClassesOf, ui as markWaitAbandoned, ur as secretNamedAttributeNamesOf, v as maskedLogger, w as isTruthyCfnBoolean, wi as s3BucketDualStackDomainName, wo as withheldAccountClause, wr as earliestDefined, ws as recordReferenceProvenanceEntry, x as ECR_AUTO_DELETE_IMAGES_TAG, xi as isSettledInstanceState, y as relayedIndexBusyDelete, zc as stringifyValue, zo as isWarmThroughputDecrease, zr as stringifyIfAssigned } from "./deploy-engine-DU0BoQqo.js";
6
+ import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-WGsb9RxZ.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-BVLiidXb.js";
8
+ import { RDSProvider } from "./rds-provider-6RgDTDCV.js";
9
+ import { NeptuneProvider } from "./neptune-provider-WE1O3kXY.js";
10
+ import { ASGProvider } from "./asg-provider-BRr_hsky.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";
@@ -133,7 +133,7 @@ var IAMPolicyProvider = class {
133
133
  const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
134
134
  const { value: v } = log;
135
135
  log.debug(`Creating IAM policy ${logicalId}`);
136
- const policyName = properties["PolicyName"] || generateResourceName(logicalId, { maxLength: 64 });
136
+ const policyName = properties["PolicyName"] || generatedNameFor("AWS::IAM::Policy", logicalId);
137
137
  const policyDocument = properties["PolicyDocument"];
138
138
  const targets = readPolicyTargetLists(properties);
139
139
  if ("malformed" in targets) throw new ProvisioningError(`${targets.malformed.join(" / ")} of IAM policy ${logicalId} is not a list of IAM names — no inline policy was attached`, resourceType, logicalId);
@@ -239,7 +239,15 @@ var IAMPolicyProvider = class {
239
239
  const log = withDerivedNameMasks(this.logger, createMaskedLogSinks(this.logger, context?.maskSecrets), [[previousProperties["PolicyName"], oldPolicyName]]);
240
240
  const { value: v } = log;
241
241
  log.debug(`Updating IAM policy ${logicalId}: ${v(physicalId)}`);
242
- const newPolicyName = properties["PolicyName"] || generateResourceName(logicalId, { maxLength: 64 });
242
+ const derivedPolicyName = properties["PolicyName"] || generatedNameFor("AWS::IAM::Policy", logicalId);
243
+ const newPolicyName = oldPolicyName !== void 0 && recordedGeneratedNameKept({
244
+ recorded: oldPolicyName,
245
+ derived: derivedPolicyName,
246
+ declaredName: properties["PolicyName"],
247
+ previousDeclaredName: previousProperties["PolicyName"],
248
+ logicalId,
249
+ options: { maxLength: 64 }
250
+ }) ? oldPolicyName : derivedPolicyName;
243
251
  const recordedPolicyName = previousProperties["PolicyName"];
244
252
  const oldPolicyNames = [...new Set([oldPolicyName, recordedPolicyName].filter((name) => typeof name === "string" && IAM_POLICY_NAME.test(name)))];
245
253
  const newTargets = readPolicyTargetLists(properties);
@@ -675,7 +683,16 @@ var IAMManagedPolicyProvider = class {
675
683
  log.debug(`Updating IAM managed policy ${logicalId}: ${v(physicalId)}`);
676
684
  const revertKeepsName = context?.desiredFromAwsReadback === true && derivedPolicyName !== oldPolicyName;
677
685
  if (revertKeepsName) log.warn(`IAM managed policy ${logicalId}: ManagedPolicyName is not reverted — the policy ${v(oldPolicyName)} keeps its name (the reverted properties derive ${v(derivedPolicyName)}), since a drift revert never replaces a policy. 'cdkd drift' keeps reporting the name until 'cdkd drift --accept' records the live one; only a deploy renames the policy.`);
678
- const newPolicyName = revertKeepsName ? oldPolicyName : derivedPolicyName;
686
+ const generatedNameKept = recordedGeneratedNameKept({
687
+ recorded: oldPolicyName,
688
+ derived: derivedPolicyName,
689
+ declaredName: properties["ManagedPolicyName"],
690
+ previousDeclaredName: previousProperties["ManagedPolicyName"],
691
+ logicalId,
692
+ options: { maxLength: 128 }
693
+ });
694
+ if (generatedNameKept) log.debug(`IAM managed policy ${logicalId}: keeping its generated name ${v(oldPolicyName)} (the template names no policy)`);
695
+ const newPolicyName = revertKeepsName || generatedNameKept ? oldPolicyName : derivedPolicyName;
679
696
  const newPrincipals = principalsOf(properties);
680
697
  const oldPrincipals = principalsOf(previousProperties);
681
698
  const liveKinds = !("malformed" in newPrincipals) && onlySecretDerived(oldPrincipals) ? oldPrincipals.malformed : [];
@@ -5403,11 +5420,7 @@ var S3BucketProvider = class S3BucketProvider {
5403
5420
  }
5404
5421
  generatedCreateName(_resourceType, logicalId, properties) {
5405
5422
  if (properties["BucketName"]) return void 0;
5406
- return generateResourceName(logicalId, {
5407
- maxLength: 63,
5408
- lowercase: true,
5409
- allowedPattern: /[^a-z0-9.-]/g
5410
- });
5423
+ return generatedNameFor("AWS::S3::Bucket", logicalId);
5411
5424
  }
5412
5425
  async import(input) {
5413
5426
  const explicit = resolveExplicitPhysicalId(input, "BucketName");
@@ -5754,7 +5767,7 @@ var SQSQueueProvider = class {
5754
5767
  }
5755
5768
  generatedCreateName(_resourceType, logicalId, properties) {
5756
5769
  if (properties["QueueName"]) return void 0;
5757
- return generateResourceName(logicalId, { maxLength: 80 });
5770
+ return generatedNameFor("AWS::SQS::Queue", logicalId);
5758
5771
  }
5759
5772
  async holderCreatedAt(_resourceType, physicalId) {
5760
5773
  const resp = await this.sqsClient.send(new GetQueueAttributesCommand({
@@ -5835,7 +5848,7 @@ var SQSQueueProvider = class {
5835
5848
  QueueUrl: physicalId,
5836
5849
  AttributeNames: ["QueueArn"]
5837
5850
  }));
5838
- const queueName = properties["QueueName"] || generateResourceName(logicalId, { maxLength: 80 });
5851
+ const queueName = properties["QueueName"] || physicalId.split("/").pop() || generatedNameFor("AWS::SQS::Queue", logicalId);
5839
5852
  return {
5840
5853
  physicalId,
5841
5854
  wasReplaced: false,
@@ -6845,7 +6858,7 @@ var SNSTopicProvider = class {
6845
6858
  }
6846
6859
  generatedCreateName(_resourceType, logicalId, properties) {
6847
6860
  if (properties["TopicName"]) return void 0;
6848
- return generateResourceName(logicalId, { maxLength: 256 });
6861
+ return generatedNameFor("AWS::SNS::Topic", logicalId);
6849
6862
  }
6850
6863
  async import(input) {
6851
6864
  if (input.knownPhysicalId) try {
@@ -7837,7 +7850,7 @@ var LambdaFunctionProvider = class {
7837
7850
  this.ec2Client = awsClients.ec2;
7838
7851
  }
7839
7852
  async create(logicalId, resourceType, properties, context) {
7840
- const functionName = properties["FunctionName"] || generateResourceName(logicalId, { maxLength: 64 });
7853
+ const functionName = properties["FunctionName"] || generatedNameFor("AWS::Lambda::Function", logicalId);
7841
7854
  const log = lambdaOperationSinks(this.logger, context?.maskSecrets, [[properties["FunctionName"], functionName]], properties);
7842
7855
  log.debug(`Creating Lambda function ${logicalId}`);
7843
7856
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
@@ -9134,6 +9147,14 @@ const KINDS_WITH_ZERO_BATCHING_WINDOW_DEFAULT = /* @__PURE__ */ new Set([
9134
9147
  "dynamodb"
9135
9148
  ]);
9136
9149
  const KINDS_WITH_STREAM_NUMERICS = /* @__PURE__ */ new Set(["kinesis", "dynamodb"]);
9150
+ const DEFAULT_BATCH_SIZE_BY_KIND = /* @__PURE__ */ new Map([
9151
+ ["sqs", 10],
9152
+ ["kinesis", 100],
9153
+ ["dynamodb", 100],
9154
+ ["kafka", 100],
9155
+ ["mq", 100],
9156
+ ["documentdb", 100]
9157
+ ]);
9137
9158
  var LambdaEventSourceMappingProvider = class {
9138
9159
  lambdaClient;
9139
9160
  createClient;
@@ -9353,6 +9374,14 @@ var LambdaEventSourceMappingProvider = class {
9353
9374
  if (wasSet("TumblingWindowInSeconds")) updateParams.TumblingWindowInSeconds = 0;
9354
9375
  }
9355
9376
  if (wasSet("MaximumBatchingWindowInSeconds") && KINDS_WITH_ZERO_BATCHING_WINDOW_DEFAULT.has(prevKind)) updateParams.MaximumBatchingWindowInSeconds = 0;
9377
+ if (wasSet("BatchSize")) {
9378
+ const defaultBatchSize = DEFAULT_BATCH_SIZE_BY_KIND.get(prevKind);
9379
+ if (defaultBatchSize !== void 0) updateParams.BatchSize = defaultBatchSize;
9380
+ }
9381
+ if (prevKind === "kafka") {
9382
+ if (wasSet("LoggingConfig")) updateParams.LoggingConfig = {};
9383
+ if (wasSet("ProvisionedPollerConfig")) updateParams.ProvisionedPollerConfig = {};
9384
+ }
9356
9385
  const updateResp = await this.lambdaClient.send(new UpdateEventSourceMappingCommand(updateParams));
9357
9386
  const eventSourceMappingArn = updateResp.EventSourceMappingArn;
9358
9387
  if (eventSourceMappingArn) await this.applyTagDiff(eventSourceMappingArn, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], log);
@@ -9560,7 +9589,7 @@ var LambdaLayerVersionProvider = class {
9560
9589
  });
9561
9590
  }
9562
9591
  async create(logicalId, resourceType, properties, context) {
9563
- const layerName = properties["LayerName"] || generateResourceName(logicalId, { maxLength: 64 });
9592
+ const layerName = properties["LayerName"] || generatedNameFor("AWS::Lambda::LayerVersion", logicalId);
9564
9593
  const log = withDerivedNameMasks(this.logger, createMaskedLogSinks(this.logger, context?.maskSecrets), [[properties["LayerName"], layerName], [properties["LayerName"], layerNameSegment(layerName)]]);
9565
9594
  log.debug(`Creating Lambda layer version ${logicalId}`);
9566
9595
  const content = properties["Content"];
@@ -11064,7 +11093,7 @@ var LambdaNetworkConnectorProvider = class {
11064
11093
  async create(logicalId, resourceType, properties, context) {
11065
11094
  this.logger.debug(safeMsg`Creating Lambda network connector ${logicalId}`);
11066
11095
  const tagList = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
11067
- const name = typeof properties["Name"] === "string" && properties["Name"] !== "" ? properties["Name"] : generateResourceName(logicalId, { maxLength: 64 });
11096
+ const name = typeof properties["Name"] === "string" && properties["Name"] !== "" ? properties["Name"] : generatedNameFor("AWS::Lambda::NetworkConnector", logicalId);
11068
11097
  const vpc = this.readVpcEgress(properties, logicalId, resourceType, void 0);
11069
11098
  const createToken = acquireIdempotencyToken({
11070
11099
  scope: "CreateNetworkConnector",
@@ -11948,6 +11977,10 @@ const deleteTableRetryDelays = {};
11948
11977
  function maskLeafValue(value, maskSecrets) {
11949
11978
  return maskDeep(value, maskSecrets);
11950
11979
  }
11980
+ const tableNameReleaseWait = {
11981
+ maxPolls: 600,
11982
+ intervalMs: INDEX_SETTLE_POLL_INTERVAL_MS
11983
+ };
11951
11984
  var DynamoDBTableProvider = class {
11952
11985
  dynamoDBClient;
11953
11986
  createClient;
@@ -12008,7 +12041,7 @@ var DynamoDBTableProvider = class {
12008
12041
  const debug = (message) => this.logger.debug(maskSecrets(message));
12009
12042
  this.logger.debug(`Creating DynamoDB table ${logicalId}`);
12010
12043
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
12011
- const tableName = properties["TableName"] || generateResourceName(logicalId, { maxLength: 255 });
12044
+ const tableName = properties["TableName"] || generatedNameFor("AWS::DynamoDB::Table", logicalId);
12012
12045
  const keySchema = properties["KeySchema"];
12013
12046
  const attributeDefinitions = properties["AttributeDefinitions"];
12014
12047
  if (!keySchema) throw new ProvisioningError(`KeySchema is required for DynamoDB table ${logicalId}`, resourceType, logicalId);
@@ -12356,6 +12389,22 @@ var DynamoDBTableProvider = class {
12356
12389
  throw this.wrapCaughtError(maskSecrets, error, (text) => new ProvisioningError(`Failed to update DynamoDB table ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
12357
12390
  }
12358
12391
  }
12392
+ async waitForNameReleased(logicalId, physicalId, _resourceType, context) {
12393
+ const mask = context.maskSecrets ?? ((text) => text);
12394
+ this.logger.info(mask(` Waiting for the deleted DynamoDB table ${physicalId} to release its name...`));
12395
+ for (let poll = 0; poll < tableNameReleaseWait.maxPolls; poll++) {
12396
+ if (context.isInterrupted()) return;
12397
+ try {
12398
+ await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: physicalId }));
12399
+ } catch (error) {
12400
+ if (error instanceof ResourceNotFoundException$1) return;
12401
+ this.logger.debug(mask(`DynamoDB table ${logicalId}: name-release check failed: ${describeAwsFailure(error).detail}`));
12402
+ if (!isThrottlingError(error) && !isTransientServerError(error)) return;
12403
+ }
12404
+ await new Promise((resolve) => setTimeout(resolve, tableNameReleaseWait.intervalMs));
12405
+ }
12406
+ this.logger.debug(mask(`DynamoDB table ${logicalId} (${physicalId}) still held its name after the wait`));
12407
+ }
12359
12408
  async delete(logicalId, physicalId, resourceType, _properties, context) {
12360
12409
  const flip = this.protectionFlips.acquire(deleteBudgetKey(physicalId, context?.expectedRegion), DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, resolveDynamoDbDeleteBudgetClock());
12361
12410
  try {
@@ -13417,10 +13466,7 @@ var LogsLogGroupProvider = class {
13417
13466
  }
13418
13467
  generatedCreateName(_resourceType, logicalId, properties) {
13419
13468
  if (properties["LogGroupName"]) return void 0;
13420
- return `/cdkd/${generateResourceName(logicalId, {
13421
- maxLength: 506,
13422
- allowedPattern: /[^a-zA-Z0-9-/_]/g
13423
- })}`;
13469
+ return generatedNameFor("AWS::Logs::LogGroup", logicalId);
13424
13470
  }
13425
13471
  async holderCreatedAt(_resourceType, physicalId) {
13426
13472
  const group = (await this.logsClient.send(new DescribeLogGroupsCommand({ logGroupNamePrefix: physicalId }))).logGroups?.find((g) => g.logGroupName === physicalId);
@@ -14111,7 +14157,7 @@ var CloudWatchAlarmProvider = class {
14111
14157
  }
14112
14158
  generatedCreateName(_resourceType, logicalId, properties) {
14113
14159
  if (properties["AlarmName"]) return void 0;
14114
- return generateResourceName(logicalId, { maxLength: 256 });
14160
+ return generatedNameFor("AWS::CloudWatch::Alarm", logicalId);
14115
14161
  }
14116
14162
  async lookupNames(_resourceType, names) {
14117
14163
  const wanted = new Set(names);
@@ -14430,10 +14476,7 @@ var SecretsManagerSecretProvider = class {
14430
14476
  const { value: v } = log;
14431
14477
  log.debug(`Creating secret ${logicalId}`);
14432
14478
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
14433
- const name = properties["Name"] || generateResourceName(logicalId, {
14434
- maxLength: 512,
14435
- allowedPattern: /[^a-zA-Z0-9-/_]/g
14436
- });
14479
+ const name = properties["Name"] || generatedNameFor("AWS::SecretsManager::Secret", logicalId);
14437
14480
  try {
14438
14481
  let secretString;
14439
14482
  const rawGenerate = properties["GenerateSecretString"];
@@ -14784,10 +14827,7 @@ var SSMParameterProvider = class SSMParameterProvider {
14784
14827
  const ssmTags = SSMParameterProvider.desiredSsmTags(properties["Tags"], resourceType, logicalId);
14785
14828
  const debug = (message) => this.logger.debug(mask(message));
14786
14829
  debug(`Creating SSM parameter ${displaySafe(logicalId)}`);
14787
- const name = properties["Name"] || `/${generateResourceName(logicalId, {
14788
- maxLength: 1023,
14789
- allowedPattern: /[^a-zA-Z0-9-/_]/g
14790
- })}`;
14830
+ const name = properties["Name"] || generatedNameFor("AWS::SSM::Parameter", logicalId);
14791
14831
  const type = properties["Type"] || "String";
14792
14832
  const value = properties["Value"];
14793
14833
  if (!value) throw new ProvisioningError(`Value is required for SSM parameter ${displaySafe(logicalId)}`, resourceType, logicalId);
@@ -15175,7 +15215,8 @@ var EventBridgeRuleProvider = class {
15175
15215
  this.logger.debug(`Updating EventBridge rule ${logicalId}: ${physicalId}`);
15176
15216
  assertRegionMatch(context?.expectedRegion ? await this.eventBridgeClient.config.region() : void 0, context?.expectedRegion, resourceType, logicalId, physicalId, "pre-update");
15177
15217
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
15178
- const ruleName = properties["Name"] || generateResourceName(logicalId, { maxLength: 64 });
15218
+ const recordedRuleName = physicalId.split("/").pop() ?? "";
15219
+ const ruleName = properties["Name"] || recordedRuleName || generatedNameFor("AWS::Events::Rule", logicalId);
15179
15220
  const newTargets = properties["Targets"];
15180
15221
  const oldTargets = previousProperties["Targets"];
15181
15222
  try {
@@ -15338,7 +15379,7 @@ var EventBridgeRuleProvider = class {
15338
15379
  }
15339
15380
  generatedCreateName(_resourceType, logicalId, properties) {
15340
15381
  if (properties["Name"]) return void 0;
15341
- return generateResourceName(logicalId, { maxLength: 64 });
15382
+ return generatedNameFor("AWS::Events::Rule", logicalId);
15342
15383
  }
15343
15384
  lookupNeedsResolvedProperties(_resourceType, properties) {
15344
15385
  const bus = properties["EventBusName"];
@@ -17273,7 +17314,7 @@ var EC2Provider = class {
17273
17314
  try {
17274
17315
  const createClient = await this.getCreateClient();
17275
17316
  const { response, tagsApplied } = await this.sendTaggedCreate(logicalId, "security-group", desiredTags, (TagSpecifications) => createClient.send(new CreateSecurityGroupCommand({
17276
- GroupName: properties["GroupName"] ?? logicalId,
17317
+ GroupName: properties["GroupName"] ?? generatedNameFor("AWS::EC2::SecurityGroup", logicalId),
17277
17318
  Description: groupDescription,
17278
17319
  VpcId: properties["VpcId"] ?? void 0,
17279
17320
  ...TagSpecifications && { TagSpecifications }
@@ -20905,6 +20946,7 @@ var ApiGatewayV2Provider = class {
20905
20946
  "IdentityValidationExpression"
20906
20947
  ])]
20907
20948
  ]);
20949
+ removalDefaults = /* @__PURE__ */ new Map([["AWS::ApiGatewayV2::Authorizer", /* @__PURE__ */ new Map([["IdentitySource", []]])]]);
20908
20950
  unhandledByDesign = /* @__PURE__ */ new Map([["AWS::ApiGatewayV2::Api", /* @__PURE__ */ new Map([
20909
20951
  ["Body", "OpenAPI/Swagger inline spec; routed through ImportApi, not the field-by-field CreateApi path."],
20910
20952
  ["BodyS3Location", "OpenAPI/Swagger spec on S3; routed through ImportApi, not the field-by-field CreateApi path."],
@@ -20961,9 +21003,9 @@ var ApiGatewayV2Provider = class {
20961
21003
  switch (resourceType) {
20962
21004
  case "AWS::ApiGatewayV2::Api": return this.updateApi(logicalId, physicalId, resourceType, properties, previousProperties, log);
20963
21005
  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);
21006
+ case "AWS::ApiGatewayV2::Integration": return this.updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true, context);
20965
21007
  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);
21008
+ case "AWS::ApiGatewayV2::Authorizer": return this.updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log, context);
20967
21009
  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
21010
  }
20969
21011
  }
@@ -21725,7 +21767,7 @@ var ApiGatewayV2Provider = class {
21725
21767
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Stage ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
21726
21768
  }
21727
21769
  }
21728
- async updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, restoreFromAws = false) {
21770
+ async updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, restoreFromAws = false, context) {
21729
21771
  const apiId = properties["ApiId"] ?? previousProperties["ApiId"];
21730
21772
  if (!apiId) throw new ProvisioningError(`ApiId is required to update Integration ${logicalId}`, resourceType, logicalId, physicalId);
21731
21773
  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 +21830,32 @@ var ApiGatewayV2Provider = class {
21788
21830
  input.IntegrationSubtype = properties["IntegrationSubtype"];
21789
21831
  changed = true;
21790
21832
  }
21791
- if (input.IntegrationSubtype === void 0) {
21833
+ const subtypeRemoved = context?.removedProperties !== void 0 ? context.removedProperties.has("IntegrationSubtype") : previousProperties["IntegrationSubtype"] != null && properties["IntegrationSubtype"] == null;
21834
+ let effectiveProperties;
21835
+ if (subtypeRemoved && (context?.replayingState !== true || properties["IntegrationUri"] != null)) {
21836
+ 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));
21837
+ input.IntegrationUri = properties["IntegrationUri"];
21838
+ changed = true;
21839
+ } else if (subtypeRemoved) {
21840
+ let liveSubtype;
21841
+ try {
21842
+ liveSubtype = (await this.getClient().send(new GetIntegrationCommand({
21843
+ ApiId: apiId,
21844
+ IntegrationId: physicalId
21845
+ }))).IntegrationSubtype;
21846
+ } catch (error) {
21847
+ const cause = error instanceof Error ? error : void 0;
21848
+ throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to read API Gateway V2 Integration ${logicalId} before restoring it: ${text}`, resourceType, logicalId, physicalId, cause));
21849
+ }
21850
+ if (liveSubtype) {
21851
+ input.IntegrationSubtype = liveSubtype;
21852
+ effectiveProperties = {
21853
+ ...properties,
21854
+ IntegrationSubtype: liveSubtype
21855
+ };
21856
+ 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.`);
21857
+ }
21858
+ } else if (input.IntegrationSubtype === void 0) {
21792
21859
  const liveSubtype = properties["IntegrationSubtype"] ?? previousProperties["IntegrationSubtype"];
21793
21860
  if (liveSubtype !== void 0) input.IntegrationSubtype = liveSubtype;
21794
21861
  }
@@ -21813,11 +21880,13 @@ var ApiGatewayV2Provider = class {
21813
21880
  input.TlsConfig = properties["TlsConfig"];
21814
21881
  changed = true;
21815
21882
  }
21883
+ if (changed && input.IntegrationSubtype !== void 0) input.RequestParameters = this.serviceIntegrationParameters(logicalId, physicalId, resourceType, input.RequestParameters ?? properties["RequestParameters"]);
21816
21884
  if (!changed) {
21817
21885
  log.debug(`No mutable Integration fields changed for ${logicalId}; skipping UpdateIntegration`);
21818
21886
  return {
21819
21887
  physicalId,
21820
- wasReplaced: false
21888
+ wasReplaced: false,
21889
+ ...effectiveProperties && { effectiveProperties }
21821
21890
  };
21822
21891
  }
21823
21892
  log.debug(`Updating API Gateway V2 Integration ${logicalId}: ${physicalId}`);
@@ -21825,7 +21894,8 @@ var ApiGatewayV2Provider = class {
21825
21894
  await this.getClient().send(new UpdateIntegrationCommand(input));
21826
21895
  return {
21827
21896
  physicalId,
21828
- wasReplaced: false
21897
+ wasReplaced: false,
21898
+ ...effectiveProperties && { effectiveProperties }
21829
21899
  };
21830
21900
  } catch (error) {
21831
21901
  const cause = error instanceof Error ? error : void 0;
@@ -21930,7 +22000,8 @@ var ApiGatewayV2Provider = class {
21930
22000
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Route ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
21931
22001
  }
21932
22002
  }
21933
- async updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log) {
22003
+ async updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log, context) {
22004
+ properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
21934
22005
  const apiId = properties["ApiId"] ?? previousProperties["ApiId"];
21935
22006
  if (!apiId) throw new ProvisioningError(`ApiId is required to update Authorizer ${logicalId}`, resourceType, logicalId, physicalId);
21936
22007
  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 +22073,15 @@ var ApiGatewayV2Provider = class {
22002
22073
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Authorizer ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
22003
22074
  }
22004
22075
  }
22076
+ serviceIntegrationParameters(logicalId, physicalId, resourceType, sent) {
22077
+ if (sent == null) return void 0;
22078
+ const redacted = Object.keys(sent).filter((key) => {
22079
+ const value = sent[key];
22080
+ return typeof value === "string" && (dynamicReferenceTokens(value).length > 0 || value === "***");
22081
+ });
22082
+ 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));
22083
+ return sent;
22084
+ }
22005
22085
  clearableUpdate(next, previous, resetValue) {
22006
22086
  const resolved = next !== void 0 ? next : previous !== void 0 ? resetValue : void 0;
22007
22087
  return {
@@ -23797,7 +23877,7 @@ var StepFunctionsProvider = class {
23797
23877
  }
23798
23878
  generatedCreateName(_resourceType, logicalId, properties) {
23799
23879
  if (properties["StateMachineName"]) return void 0;
23800
- return generateResourceName(logicalId, { maxLength: 80 });
23880
+ return generatedNameFor("AWS::StepFunctions::StateMachine", logicalId);
23801
23881
  }
23802
23882
  async holderCreatedAt(_resourceType, physicalId) {
23803
23883
  const resp = await this.getClient().send(new DescribeStateMachineCommand({ stateMachineArn: physicalId }));
@@ -24300,7 +24380,7 @@ var ECSProvider = class {
24300
24380
  async createTaskDefinition(logicalId, resourceType, properties, log) {
24301
24381
  log.debug(`Creating ECS task definition ${logicalId}`);
24302
24382
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
24303
- const family = properties["Family"] || generateResourceName(logicalId, { maxLength: 255 });
24383
+ const family = properties["Family"] || generatedNameFor("AWS::ECS::TaskDefinition", logicalId);
24304
24384
  try {
24305
24385
  const orphanWindow = registerTaskDefinitionLatch.take(logicalId);
24306
24386
  if (orphanWindow !== void 0) await this.reportPossibleOrphanTaskDefinitions(logicalId, family, orphanWindow, log);
@@ -24377,7 +24457,7 @@ var ECSProvider = class {
24377
24457
  log.debug(`Creating ECS service ${logicalId}`);
24378
24458
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
24379
24459
  const client = this.getClient();
24380
- const serviceName = properties["ServiceName"] || generateResourceName(logicalId, { maxLength: 255 });
24460
+ const serviceName = properties["ServiceName"] || generatedNameFor("AWS::ECS::Service", logicalId);
24381
24461
  let survivorArn;
24382
24462
  try {
24383
24463
  const heldBefore = process.env["CDKD_FULL_WAIT"] === "true" ? await nameHeldBefore(() => this.serviceNameHeld(properties["Cluster"], serviceName), (error) => hasErrorName(error, ["ClusterNotFoundException"])) : "free";
@@ -25313,7 +25393,7 @@ var ECSProvider = class {
25313
25393
  }
25314
25394
  generatedCreateName(resourceType, logicalId, properties) {
25315
25395
  if (resourceType !== "AWS::ECS::Cluster" || properties["ClusterName"]) return void 0;
25316
- return generateResourceName(logicalId, { maxLength: 255 });
25396
+ return generatedNameFor("AWS::ECS::Cluster", logicalId);
25317
25397
  }
25318
25398
  async lookupNames(resourceType, names) {
25319
25399
  const found = /* @__PURE__ */ new Map();
@@ -25549,7 +25629,7 @@ const CLEARED_BY_TLS_DOWNGRADE = /* @__PURE__ */ new Set(["SslPolicy", "Certific
25549
25629
  const listenerLeftInPlaceWarning = (logicalId, names, caller) => {
25550
25630
  const one = names.length === 1;
25551
25631
  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.`;
25632
+ 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
25633
  };
25554
25634
  var ELBv2Provider = class {
25555
25635
  elbv2Client;
@@ -26875,7 +26955,7 @@ var RDSDBProxyProvider = class {
26875
26955
  }
26876
26956
  async create(logicalId, resourceType, properties) {
26877
26957
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, void 0, "Tags", DBPROXY_TAGS_WHAT, DBPROXY_TAG_OPTIONS);
26878
- const dbProxyName = properties["DBProxyName"] ?? generateResourceName(logicalId, { maxLength: 64 });
26958
+ const dbProxyName = properties["DBProxyName"] ?? generatedNameFor("AWS::RDS::DBProxy", logicalId);
26879
26959
  const engineFamily = properties["EngineFamily"];
26880
26960
  if (!engineFamily) throw new ProvisioningError(`EngineFamily is required for AWS::RDS::DBProxy ${logicalId}`, resourceType, logicalId);
26881
26961
  const auth = properties["Auth"];
@@ -27198,7 +27278,7 @@ var RDSDBProxyEndpointProvider = class {
27198
27278
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, void 0, "Tags", DBPROXY_TAGS_WHAT, DBPROXY_TAG_OPTIONS);
27199
27279
  const dbProxyName = properties["DBProxyName"];
27200
27280
  if (!dbProxyName) throw new ProvisioningError(`DBProxyName is required for AWS::RDS::DBProxyEndpoint ${logicalId}`, resourceType, logicalId);
27201
- const dbProxyEndpointName = properties["DBProxyEndpointName"] ?? generateResourceName(logicalId, { maxLength: 64 });
27281
+ const dbProxyEndpointName = properties["DBProxyEndpointName"] ?? generatedNameFor("AWS::RDS::DBProxyEndpoint", logicalId);
27202
27282
  const vpcSubnetIds = properties["VpcSubnetIds"];
27203
27283
  if (!vpcSubnetIds || vpcSubnetIds.length === 0) throw new ProvisioningError(`VpcSubnetIds (at least one) is required for AWS::RDS::DBProxyEndpoint ${logicalId}`, resourceType, logicalId);
27204
27284
  const client = this.getClient();
@@ -28090,10 +28170,7 @@ var DocDBProvider = class {
28090
28170
  async createDBCluster(logicalId, resourceType, properties) {
28091
28171
  this.logger.debug(`Creating DocDB DBCluster ${logicalId}`);
28092
28172
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
28093
- const dbClusterIdentifier = properties["DBClusterIdentifier"] || generateResourceName(logicalId, {
28094
- maxLength: 63,
28095
- lowercase: true
28096
- });
28173
+ const dbClusterIdentifier = properties["DBClusterIdentifier"] || generatedNameFor("AWS::DocDB::DBCluster", logicalId);
28097
28174
  let clusterCreated = false;
28098
28175
  let createdResourceId;
28099
28176
  try {
@@ -28239,10 +28316,7 @@ var DocDBProvider = class {
28239
28316
  async createDBInstance(logicalId, resourceType, properties) {
28240
28317
  this.logger.debug(`Creating DocDB DBInstance ${logicalId}`);
28241
28318
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
28242
- const dbInstanceIdentifier = properties["DBInstanceIdentifier"] || generateResourceName(logicalId, {
28243
- maxLength: 63,
28244
- lowercase: true
28245
- });
28319
+ const dbInstanceIdentifier = properties["DBInstanceIdentifier"] || generatedNameFor("AWS::DocDB::DBInstance", logicalId);
28246
28320
  let instanceCreated = false;
28247
28321
  let createdResourceId;
28248
28322
  try {
@@ -28558,10 +28632,7 @@ var DocDBSubnetGroupProvider = class {
28558
28632
  this.assertType(resourceType, logicalId);
28559
28633
  this.logger.debug(safeMsg`Creating DocDB DBSubnetGroup ${logicalId}`);
28560
28634
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
28561
- const dbSubnetGroupName = properties["DBSubnetGroupName"] || generateResourceName(logicalId, {
28562
- maxLength: 255,
28563
- lowercase: true
28564
- });
28635
+ const dbSubnetGroupName = properties["DBSubnetGroupName"] || generatedNameFor("AWS::DocDB::DBSubnetGroup", logicalId);
28565
28636
  try {
28566
28637
  await this.getCreateClient().send(new CreateDBSubnetGroupCommand$1({
28567
28638
  DBSubnetGroupName: dbSubnetGroupName,
@@ -28709,6 +28780,10 @@ function templateZoneVisibility(properties) {
28709
28780
  if (!Array.isArray(vpcs)) return void 0;
28710
28781
  return vpcs.some((v) => typeof v === "object" && v !== null && !Array.isArray(v) && !isIntrinsicOnly(v)) ? true : void 0;
28711
28782
  }
28783
+ 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.";
28784
+ function declaresNoVpcs(vpcs) {
28785
+ return vpcs == null || Array.isArray(vpcs) && vpcs.length === 0;
28786
+ }
28712
28787
  function sentence$1(text) {
28713
28788
  return text.endsWith(".") ? text : `${text}.`;
28714
28789
  }
@@ -28789,7 +28864,7 @@ var Route53Provider = class {
28789
28864
  }
28790
28865
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
28791
28866
  switch (resourceType) {
28792
- case "AWS::Route53::HostedZone": return this.updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, context?.maskSecrets);
28867
+ case "AWS::Route53::HostedZone": return this.updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, context?.maskSecrets, context);
28793
28868
  case "AWS::Route53::RecordSet": return this.updateRecordSet(logicalId, physicalId, resourceType, properties, previousProperties, context);
28794
28869
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
28795
28870
  }
@@ -28934,7 +29009,7 @@ var Route53Provider = class {
28934
29009
  } : void 0;
28935
29010
  }
28936
29011
  }
28937
- async updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, mask) {
29012
+ async updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, mask, context) {
28938
29013
  this.logger.debug(`Updating Route 53 hosted zone ${logicalId}: ${physicalId}`);
28939
29014
  try {
28940
29015
  const hostedZoneConfig = properties["HostedZoneConfig"];
@@ -28954,6 +29029,7 @@ var Route53Provider = class {
28954
29029
  }));
28955
29030
  const nameServers = (await this.getClient().send(new GetHostedZoneCommand({ Id: physicalId }))).DelegationSet?.NameServers ?? [];
28956
29031
  this.logger.debug(`Successfully updated hosted zone ${logicalId}`);
29032
+ 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
29033
  return {
28958
29034
  physicalId,
28959
29035
  wasReplaced: false,
@@ -29964,7 +30040,7 @@ var WAFv2WebACLProvider = class {
29964
30040
  async create(logicalId, resourceType, properties, context) {
29965
30041
  this.logger.debug(`Creating WAFv2 WebACL ${logicalId}`);
29966
30042
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
29967
- const name = properties["Name"] || generateResourceName(logicalId, { maxLength: 128 });
30043
+ const name = properties["Name"] || generatedNameFor("AWS::WAFv2::WebACL", logicalId);
29968
30044
  const scope = requireConfigString(properties["Scope"], "REGIONAL", "AWS::WAFv2::WebACL Scope", replayWarn(this.logger, context));
29969
30045
  this.warnOnSdkUnsupportedRuleKeys(logicalId, properties["Rules"]);
29970
30046
  try {
@@ -30503,7 +30579,7 @@ var CognitoUserPoolProvider = class {
30503
30579
  }
30504
30580
  async create(logicalId, resourceType, properties, context) {
30505
30581
  this.logger.debug(`Creating Cognito User Pool ${logicalId}`);
30506
- const poolName = properties["UserPoolName"] || generateResourceName(logicalId, { maxLength: 128 });
30582
+ const poolName = properties["UserPoolName"] || generatedNameFor("AWS::Cognito::UserPool", logicalId);
30507
30583
  let mfaConfiguration;
30508
30584
  try {
30509
30585
  mfaConfiguration = readDeclaredMfaConfiguration(properties["MfaConfiguration"], replayWarn(this.logger, context));
@@ -31266,10 +31342,7 @@ var ElastiCacheProvider = class {
31266
31342
  async createSubnetGroup(logicalId, resourceType, properties) {
31267
31343
  this.logger.debug(`Creating CacheSubnetGroup ${logicalId}`);
31268
31344
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
31269
- const cacheSubnetGroupName = properties["CacheSubnetGroupName"] || generateResourceName(logicalId, {
31270
- maxLength: 255,
31271
- lowercase: true
31272
- });
31345
+ const cacheSubnetGroupName = properties["CacheSubnetGroupName"] || generatedNameFor("AWS::ElastiCache::SubnetGroup", logicalId);
31273
31346
  try {
31274
31347
  await this.getCreateClient().send(new CreateCacheSubnetGroupCommand({
31275
31348
  CacheSubnetGroupName: cacheSubnetGroupName,
@@ -31333,10 +31406,7 @@ var ElastiCacheProvider = class {
31333
31406
  async createCacheCluster(logicalId, resourceType, properties) {
31334
31407
  this.logger.debug(`Creating CacheCluster ${logicalId}`);
31335
31408
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
31336
- const cacheClusterId = properties["ClusterName"] || generateResourceName(logicalId, {
31337
- maxLength: 40,
31338
- lowercase: true
31339
- });
31409
+ const cacheClusterId = properties["ClusterName"] || generatedNameFor("AWS::ElastiCache::CacheCluster", logicalId);
31340
31410
  let clusterCreated = false;
31341
31411
  try {
31342
31412
  await this.getCreateClient().send(new CreateCacheClusterCommand({
@@ -35497,7 +35567,7 @@ var GlueJobProvider = class {
35497
35567
  const log = glueOperationSinks(this.logger, context?.maskSecrets, secretNamePairs([properties["Name"]]));
35498
35568
  const { value: v } = log;
35499
35569
  log.debug(`Creating Glue Job ${logicalId}`);
35500
- const name = properties["Name"] ?? logicalId;
35570
+ const name = properties["Name"] ?? generatedNameFor("AWS::Glue::Job", logicalId);
35501
35571
  const role = properties["Role"];
35502
35572
  const command = properties["Command"];
35503
35573
  if (!role) throw new ProvisioningError(`Role is required for Glue Job ${logicalId}`, resourceType, logicalId);
@@ -35785,7 +35855,7 @@ var GlueCrawlerProvider = class {
35785
35855
  const log = glueOperationSinks(this.logger, context?.maskSecrets, secretNamePairs([properties["Name"]]));
35786
35856
  const { value: v } = log;
35787
35857
  log.debug(`Creating Glue Crawler ${logicalId}`);
35788
- const name = properties["Name"] ?? logicalId;
35858
+ const name = properties["Name"] ?? generatedNameFor("AWS::Glue::Crawler", logicalId);
35789
35859
  const role = properties["Role"];
35790
35860
  const targets = properties["Targets"];
35791
35861
  if (!role) throw new ProvisioningError(`Role is required for Glue Crawler ${logicalId}`, resourceType, logicalId);
@@ -36035,7 +36105,7 @@ var GlueConnectionProvider = class {
36035
36105
  log.debug(`Creating Glue Connection ${logicalId}`);
36036
36106
  const connectionInput = properties["ConnectionInput"];
36037
36107
  if (!connectionInput) throw new ProvisioningError(`ConnectionInput is required for Glue Connection ${logicalId}`, resourceType, logicalId);
36038
- const name = connectionInput["Name"] ?? logicalId;
36108
+ const name = connectionInput["Name"] ?? generatedNameFor("AWS::Glue::Connection", logicalId);
36039
36109
  const catalogId = properties["CatalogId"];
36040
36110
  try {
36041
36111
  await this.getCreateClient().send(new CreateConnectionCommand({
@@ -36240,7 +36310,7 @@ var GlueTriggerProvider = class {
36240
36310
  const log = glueOperationSinks(this.logger, context?.maskSecrets, secretNamePairs([properties["Name"]]));
36241
36311
  const { value: v } = log;
36242
36312
  log.debug(`Creating Glue Trigger ${logicalId}`);
36243
- const name = properties["Name"] ?? logicalId;
36313
+ const name = properties["Name"] ?? generatedNameFor("AWS::Glue::Trigger", logicalId);
36244
36314
  const type = properties["Type"];
36245
36315
  const actions = properties["Actions"];
36246
36316
  if (!type) throw new ProvisioningError(`Type is required for Glue Trigger ${logicalId}`, resourceType, logicalId);
@@ -36450,6 +36520,7 @@ var KMSProvider = class {
36450
36520
  "Origin",
36451
36521
  "BypassPolicyLockoutSafetyCheck"
36452
36522
  ])], ["AWS::KMS::Alias", /* @__PURE__ */ new Set(["AliasName", "TargetKeyId"])]]);
36523
+ removalDefaults = /* @__PURE__ */ new Map([["AWS::KMS::Key", /* @__PURE__ */ new Map([["RotationPeriodInDays", 365]])]]);
36453
36524
  getClient() {
36454
36525
  if (!this.client) this.client = new KMSClient({
36455
36526
  ...ambientClientDefaults(),
@@ -36474,7 +36545,7 @@ var KMSProvider = class {
36474
36545
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
36475
36546
  assertRegionMatch(context?.expectedRegion ? await this.getClient().config.region() : void 0, context?.expectedRegion, resourceType, logicalId, physicalId, "pre-update");
36476
36547
  switch (resourceType) {
36477
- case "AWS::KMS::Key": return this.updateKey(logicalId, physicalId, resourceType, properties, _previousProperties, context?.maskSecrets);
36548
+ case "AWS::KMS::Key": return this.updateKey(logicalId, physicalId, resourceType, properties, _previousProperties, context);
36478
36549
  case "AWS::KMS::Alias": return this.updateAlias(logicalId, physicalId, resourceType, properties, context?.maskSecrets);
36479
36550
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
36480
36551
  }
@@ -36493,7 +36564,7 @@ var KMSProvider = class {
36493
36564
  const keyPolicy = properties["KeyPolicy"];
36494
36565
  const keySpec = properties["KeySpec"];
36495
36566
  const keyUsage = properties["KeyUsage"];
36496
- const enableKeyRotation = properties["EnableKeyRotation"];
36567
+ const enableKeyRotation = templateBool(properties["EnableKeyRotation"]);
36497
36568
  const multiRegion = properties["MultiRegion"];
36498
36569
  const origin = properties["Origin"];
36499
36570
  const bypassPolicyLockoutSafetyCheck = properties["BypassPolicyLockoutSafetyCheck"];
@@ -36514,7 +36585,7 @@ var KMSProvider = class {
36514
36585
  const inputDigest = createHash("sha256").update(JSON.stringify({
36515
36586
  input,
36516
36587
  enableKeyRotation: enableKeyRotation === true,
36517
- enabled: properties["Enabled"] !== false
36588
+ enabled: templateBool(properties["Enabled"]) !== false
36518
36589
  })).digest("hex");
36519
36590
  let createdKeyId;
36520
36591
  let supersededPending = false;
@@ -36550,7 +36621,7 @@ var KMSProvider = class {
36550
36621
  if (replayWindow !== void 0) await this.reportPossibleOrphanKeys(logicalId, input, replayWindow);
36551
36622
  }
36552
36623
  createdKeyId = keyId;
36553
- if (enableKeyRotation) {
36624
+ if (enableKeyRotation === true) {
36554
36625
  const rotationPeriodInDays = properties["RotationPeriodInDays"];
36555
36626
  this.logger.debug(`Enabling key rotation for KMS Key ${logicalId}`);
36556
36627
  await this.getClient().send(new EnableKeyRotationCommand({
@@ -36558,7 +36629,7 @@ var KMSProvider = class {
36558
36629
  ...rotationPeriodInDays !== void 0 && { RotationPeriodInDays: rotationPeriodInDays }
36559
36630
  }));
36560
36631
  }
36561
- if (properties["Enabled"] === false) {
36632
+ if (templateBool(properties["Enabled"]) === false) {
36562
36633
  this.logger.debug(`Disabling KMS Key ${logicalId}`);
36563
36634
  await this.getClient().send(new DisableKeyCommand({ KeyId: keyId }));
36564
36635
  }
@@ -36698,9 +36769,13 @@ var KMSProvider = class {
36698
36769
  const deletion = shown.map((keyId) => aws`aws kms schedule-key-deletion --key-id ${keyId}${region} --pending-window-in-days 7`.render()).join(" ; ");
36699
36770
  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
36771
  }
36701
- async updateKey(logicalId, physicalId, resourceType, properties, previousProperties, mask) {
36772
+ async updateKey(logicalId, physicalId, resourceType, properties, previousProperties, context) {
36702
36773
  this.logger.debug(`Updating KMS Key ${logicalId}: ${physicalId}`);
36774
+ const mask = context?.maskSecrets;
36775
+ properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
36703
36776
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
36777
+ const newEnabled = templateBool(properties["Enabled"]);
36778
+ const enabledChange = newEnabled === templateBool(previousProperties["Enabled"]) ? void 0 : newEnabled === false ? "disable" : "enable";
36704
36779
  try {
36705
36780
  const newDescription = properties["Description"];
36706
36781
  if (newDescription !== previousProperties["Description"]) {
@@ -36710,41 +36785,49 @@ var KMSProvider = class {
36710
36785
  Description: newDescription ?? ""
36711
36786
  }));
36712
36787
  }
36713
- const newEnableKeyRotation = properties["EnableKeyRotation"];
36714
- if (newEnableKeyRotation !== previousProperties["EnableKeyRotation"]) {
36715
- if (newEnableKeyRotation) {
36716
- const rotationPeriodInDays = properties["RotationPeriodInDays"];
36788
+ if (enabledChange === "enable") {
36789
+ this.logger.debug(`Enabling KMS Key ${logicalId}`);
36790
+ await this.getClient().send(new EnableKeyCommand({ KeyId: physicalId }));
36791
+ }
36792
+ const newEnableKeyRotation = templateBool(properties["EnableKeyRotation"]);
36793
+ const oldEnableKeyRotation = templateBool(previousProperties["EnableKeyRotation"]);
36794
+ const rotationPeriodInDays = properties["RotationPeriodInDays"];
36795
+ if (newEnableKeyRotation === true) {
36796
+ if (newEnableKeyRotation !== oldEnableKeyRotation || rotationPeriodInDays !== void 0 && rotationPeriodInDays !== previousProperties["RotationPeriodInDays"]) {
36717
36797
  this.logger.debug(`Enabling key rotation for KMS Key ${logicalId}`);
36718
- await this.getClient().send(new EnableKeyRotationCommand({
36798
+ await this.sendRotation(() => this.getClient().send(new EnableKeyRotationCommand({
36719
36799
  KeyId: physicalId,
36720
36800
  ...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 }));
36801
+ })), enabledChange === "enable", resourceType, logicalId, physicalId);
36725
36802
  }
36803
+ } else if (newEnableKeyRotation !== oldEnableKeyRotation) {
36804
+ this.logger.debug(`Disabling key rotation for KMS Key ${logicalId}`);
36805
+ await this.sendRotation(() => this.getClient().send(new DisableKeyRotationCommand({ KeyId: physicalId })), enabledChange === "enable", resourceType, logicalId, physicalId);
36726
36806
  }
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
- }
36807
+ if (enabledChange === "disable") {
36808
+ this.logger.debug(`Disabling KMS Key ${logicalId}`);
36809
+ await this.getClient().send(new DisableKeyCommand({ KeyId: physicalId }));
36736
36810
  }
36737
36811
  await this.applyTagDiff(physicalId, resourceType, logicalId, previousProperties["Tags"], properties["Tags"]);
36738
36812
  const newKeyPolicy = properties["KeyPolicy"];
36739
36813
  const oldKeyPolicy = previousProperties["KeyPolicy"];
36740
36814
  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) {
36815
+ const oldPolicyStr = oldKeyPolicy ? typeof oldKeyPolicy === "string" ? oldKeyPolicy : JSON.stringify(oldKeyPolicy) : void 0;
36816
+ const policyRemoved = context?.removedProperties !== void 0 ? context.removedProperties.has("KeyPolicy") : oldKeyPolicy !== void 0 && newKeyPolicy === void 0;
36817
+ if (newPolicyStr !== oldPolicyStr && newPolicyStr) {
36742
36818
  this.logger.debug(`Updating key policy for KMS Key ${logicalId}`);
36743
36819
  await this.getClient().send(new PutKeyPolicyCommand({
36744
36820
  KeyId: physicalId,
36745
36821
  PolicyName: "default",
36746
36822
  Policy: newPolicyStr
36747
36823
  }));
36824
+ } else if (policyRemoved && newKeyPolicy === void 0) {
36825
+ this.logger.debug(safeMsg`Resetting key policy for KMS Key ${logicalId} to the default`);
36826
+ await this.getClient().send(new PutKeyPolicyCommand({
36827
+ KeyId: physicalId,
36828
+ PolicyName: "default",
36829
+ Policy: await this.defaultKeyPolicy(physicalId)
36830
+ }));
36748
36831
  }
36749
36832
  this.logger.debug(`Successfully updated KMS Key ${logicalId}`);
36750
36833
  return {
@@ -36752,10 +36835,35 @@ var KMSProvider = class {
36752
36835
  wasReplaced: false
36753
36836
  };
36754
36837
  } catch (error) {
36838
+ if (error instanceof CdkdError) throw error;
36755
36839
  const cause = error instanceof Error ? error : void 0;
36756
36840
  throw this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to update KMS Key ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
36757
36841
  }
36758
36842
  }
36843
+ async sendRotation(send, justEnabled, resourceType, logicalId, physicalId) {
36844
+ try {
36845
+ await send();
36846
+ } catch (error) {
36847
+ if (!(error instanceof DisabledException) || justEnabled) throw error;
36848
+ 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));
36849
+ }
36850
+ }
36851
+ async defaultKeyPolicy(keyId) {
36852
+ const resp = await this.getClient().send(new DescribeKeyCommand({ KeyId: keyId }));
36853
+ const match = /^arn:([^:]+):kms:[^:]*:(\d{12}):key\//.exec(resp.KeyMetadata?.Arn ?? "");
36854
+ if (match === null) throw new Error("DescribeKey returned no key ARN, so the default key policy cannot name the account");
36855
+ return JSON.stringify({
36856
+ Version: "2012-10-17",
36857
+ Id: "key-default-1",
36858
+ Statement: [{
36859
+ Sid: "Enable IAM User Permissions",
36860
+ Effect: "Allow",
36861
+ Principal: { AWS: `arn:${match[1]}:iam::${match[2]}:root` },
36862
+ Action: "kms:*",
36863
+ Resource: "*"
36864
+ }]
36865
+ });
36866
+ }
36759
36867
  async deleteKey(logicalId, physicalId, resourceType, properties, context) {
36760
36868
  this.logger.debug(`Scheduling deletion for KMS Key ${logicalId}: ${physicalId}`);
36761
36869
  const pendingWindowInDays = properties?.["PendingWindowInDays"] ?? 7;
@@ -36962,6 +37070,11 @@ var KMSProvider = class {
36962
37070
  return null;
36963
37071
  }
36964
37072
  };
37073
+ function templateBool(value) {
37074
+ if (value === void 0 || value === null) return void 0;
37075
+ if (typeof value === "string") return value.toLowerCase() === "true";
37076
+ return Boolean(value);
37077
+ }
36965
37078
 
36966
37079
  //#endregion
36967
37080
  //#region src/provisioning/providers/budgets-budget-provider.ts
@@ -37606,7 +37719,7 @@ var KinesisStreamProvider = class {
37606
37719
  const warn = (message) => this.logger.warn(mask(message));
37607
37720
  this.logger.debug(`Creating Kinesis stream ${logicalId}`);
37608
37721
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
37609
- const streamName = properties["Name"] || generateResourceName(logicalId, { maxLength: 128 });
37722
+ const streamName = properties["Name"] || generatedNameFor("AWS::Kinesis::Stream", logicalId);
37610
37723
  const desiredRead = readShardLevelMetrics(properties["DesiredShardLevelMetrics"], mask);
37611
37724
  if (desiredRead.kind === "unusable") {
37612
37725
  if (context?.replayingState === true) warn(`${desiredRead.reason}. Replaying a state record, so the shard-level metrics are left unset on ${streamName} rather than refusing the restore`);
@@ -38352,7 +38465,7 @@ var SchedulerScheduleProvider = class {
38352
38465
  return result;
38353
38466
  }
38354
38467
  async create(logicalId, resourceType, properties) {
38355
- const name = properties["Name"] ?? generateResourceName(logicalId, { maxLength: 64 });
38468
+ const name = properties["Name"] ?? generatedNameFor("AWS::Scheduler::Schedule", logicalId);
38356
38469
  const groupName = this.groupNameOf(properties);
38357
38470
  this.logger.debug(`Creating Schedule ${logicalId}: ${name}${groupName ? ` (group: ${groupName})` : ""}`);
38358
38471
  try {
@@ -38892,7 +39005,7 @@ var PipesPipeProvider = class {
38892
39005
  }
38893
39006
  async create(logicalId, resourceType, properties, context) {
38894
39007
  const mask = maskerOrIdentity(context?.maskSecrets);
38895
- const name = properties["Name"] ?? generateResourceName(logicalId, { maxLength: 64 });
39008
+ const name = properties["Name"] ?? generatedNameFor("AWS::Pipes::Pipe", logicalId);
38896
39009
  const tags = desiredTagMap(properties["Tags"], logicalId);
38897
39010
  this.logger.debug(mask(`Creating Pipe ${logicalId}: ${name}`));
38898
39011
  let createdIdentity;
@@ -41062,7 +41175,7 @@ const leftInPlaceWarning$1 = (logicalId, names, caller) => {
41062
41175
  const one = names.length === 1;
41063
41176
  const subject = one ? "property" : "properties";
41064
41177
  const verb = one ? "is" : "are";
41065
- return caller === "rollback" ? safeMsg`${logicalId} (AWS::EMR::Cluster): ${subject} ${names.join(", ")} ${verb} absent from the state being restored; ModifyCluster keeps a setting it is not sent, so the rollback leaves the value the failed deploy applied in place.` : safeMsg`${logicalId} (AWS::EMR::Cluster): ${subject} ${names.join(", ")} ${one ? "was" : "were"} removed from the template; ModifyCluster 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.`;
41178
+ return caller === "rollback" ? safeMsg`${logicalId} (AWS::EMR::Cluster): ${subject} ${names.join(", ")} ${verb} absent from the state being restored; ModifyCluster keeps a setting it is not sent, so the rollback leaves the value the failed deploy applied in place.` : safeMsg`${logicalId} (AWS::EMR::Cluster): ${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"}; ModifyCluster keeps a setting it is not sent. Declare the intended value explicitly to change it.`;
41066
41179
  };
41067
41180
  const toNumber$2 = (v) => {
41068
41181
  if (v === void 0) return void 0;
@@ -42194,7 +42307,7 @@ const leftInPlaceWarning = (logicalId, names, caller) => {
42194
42307
  const one = names.length === 1;
42195
42308
  const subject = one ? "property" : "properties";
42196
42309
  const verb = one ? "is" : "are";
42197
- return caller === "rollback" ? safeMsg`${logicalId} (AWS::EMR::InstanceFleetConfig): ${subject} ${names.join(", ")} ${verb} absent from the state being restored; ModifyInstanceFleet keeps a setting it is not sent, so the rollback leaves the value the failed deploy applied in place.` : safeMsg`${logicalId} (AWS::EMR::InstanceFleetConfig): ${subject} ${names.join(", ")} ${one ? "was" : "were"} removed from the template; ModifyInstanceFleet 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.`;
42310
+ return caller === "rollback" ? safeMsg`${logicalId} (AWS::EMR::InstanceFleetConfig): ${subject} ${names.join(", ")} ${verb} absent from the state being restored; ModifyInstanceFleet keeps a setting it is not sent, so the rollback leaves the value the failed deploy applied in place.` : safeMsg`${logicalId} (AWS::EMR::InstanceFleetConfig): ${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"}; ModifyInstanceFleet keeps a setting it is not sent. Declare the intended value explicitly to change it.`;
42198
42311
  };
42199
42312
  const addInstanceFleetLatch = new AmbiguousCreateLatch("emr:AddInstanceFleet");
42200
42313
  const fleetsCreatedByThisProcess = new RecentIdSet();
@@ -42579,7 +42692,7 @@ var FirehoseProvider = class {
42579
42692
  let createdStreamName;
42580
42693
  try {
42581
42694
  const input = {
42582
- DeliveryStreamName: deliveryStreamName || logicalId,
42695
+ DeliveryStreamName: deliveryStreamName || generatedNameFor("AWS::KinesisFirehose::DeliveryStream", logicalId),
42583
42696
  DeliveryStreamType: deliveryStreamType
42584
42697
  };
42585
42698
  if (properties["S3DestinationConfiguration"]) {
@@ -43475,7 +43588,7 @@ var CloudTrailProvider = class {
43475
43588
  let createdTrailArn;
43476
43589
  try {
43477
43590
  const result = await this.getCreateClient().send(new CreateTrailCommand({
43478
- Name: trailName ?? logicalId,
43591
+ Name: trailName ?? generatedNameFor("AWS::CloudTrail::Trail", logicalId),
43479
43592
  S3BucketName: s3BucketName,
43480
43593
  S3KeyPrefix: s3KeyPrefix,
43481
43594
  IsMultiRegionTrail: isMultiRegionTrail,
@@ -43820,8 +43933,8 @@ var CodeBuildProvider = class {
43820
43933
  artifactIdentifier: artifacts["ArtifactIdentifier"]
43821
43934
  };
43822
43935
  }
43823
- mapProperties(logicalId, properties) {
43824
- const name = properties["Name"] ?? logicalId;
43936
+ mapProperties(undeclaredName, properties) {
43937
+ const name = properties["Name"] ?? undeclaredName();
43825
43938
  const source = properties["Source"];
43826
43939
  const environment = properties["Environment"];
43827
43940
  const sanitizeOptionalString = (value) => {
@@ -43950,7 +44063,7 @@ var CodeBuildProvider = class {
43950
44063
  async create(logicalId, resourceType, properties) {
43951
44064
  this.logger.debug(`Creating CodeBuild Project ${logicalId}`);
43952
44065
  try {
43953
- const input = this.mapProperties(logicalId, properties);
44066
+ const input = this.mapProperties(() => generatedNameFor("AWS::CodeBuild::Project", logicalId), properties);
43954
44067
  const result = await this.getCreateClient().send(new CreateProjectCommand(input));
43955
44068
  const projectName = result.project.name;
43956
44069
  const projectArn = result.project.arn;
@@ -43968,7 +44081,7 @@ var CodeBuildProvider = class {
43968
44081
  this.logger.debug(`Updating CodeBuild Project ${logicalId}: ${physicalId}`);
43969
44082
  assertRegionMatch(context?.expectedRegion ? await this.getClient().config.region() : void 0, context?.expectedRegion, resourceType, logicalId, physicalId, "pre-update");
43970
44083
  try {
43971
- const input = this.mapProperties(logicalId, properties);
44084
+ const input = this.mapProperties(() => physicalId, properties);
43972
44085
  input.name = physicalId;
43973
44086
  if (properties["BuildBatchConfig"] == null && previousProperties["BuildBatchConfig"] != null) input.buildBatchConfig = {};
43974
44087
  await this.getClient().send(new UpdateProjectCommand(input));
@@ -44322,7 +44435,7 @@ var CodeCommitRepositoryProvider = class {
44322
44435
  }
44323
44436
  async create(logicalId, resourceType, properties) {
44324
44437
  this.logger.debug(`Creating CodeCommit Repository ${logicalId}`);
44325
- const repositoryName = properties["RepositoryName"] || generateResourceName(logicalId, { maxLength: 100 });
44438
+ const repositoryName = properties["RepositoryName"] || generatedNameFor("AWS::CodeCommit::Repository", logicalId);
44326
44439
  const lists = this.readDesiredLists(logicalId, resourceType, {
44327
44440
  Triggers: properties["Triggers"],
44328
44441
  Tags: properties["Tags"]
@@ -45264,10 +45377,7 @@ var S3DirectoryBucketProvider = class {
45264
45377
  const azName = properties["LocationName"]?.replace(/--x-s3$/, "") || "us-east-1a";
45265
45378
  const azId = await this.getAzId(azName);
45266
45379
  let bucketName = properties["BucketName"];
45267
- if (!bucketName) bucketName = `${generateResourceName(logicalId, {
45268
- maxLength: 64,
45269
- lowercase: true
45270
- })}--${azId}--x-s3`;
45380
+ if (!bucketName) bucketName = generatedNameFor("AWS::S3Express::DirectoryBucket", logicalId, { zoneId: azId });
45271
45381
  const tags = desiredTags;
45272
45382
  const includeTags = tags.length > 0;
45273
45383
  try {
@@ -46201,7 +46311,7 @@ var ECRProvider = class {
46201
46311
  async create(logicalId, resourceType, properties) {
46202
46312
  this.logger.debug(`Creating ECR Repository ${logicalId}`);
46203
46313
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
46204
- const repositoryName = properties["RepositoryName"] || generateResourceName(logicalId, { maxLength: 256 }).toLowerCase();
46314
+ const repositoryName = properties["RepositoryName"] || generatedNameFor("AWS::ECR::Repository", logicalId);
46205
46315
  let repositoryCreated = false;
46206
46316
  try {
46207
46317
  const tags = properties["Tags"] !== void 0 && properties["Tags"] !== null ? desiredTags : void 0;
@@ -47189,4 +47299,4 @@ var ACMCertificateProvider = class {
47189
47299
 
47190
47300
  //#endregion
47191
47301
  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
47302
+ //# sourceMappingURL=provider-classes-CXSiWJVn.js.map