@cdkd/cli 0.354.0 → 0.356.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.
- package/dist/{ambient-client-defaults-BDRSTcYT.js → ambient-client-defaults-DdMbK4P9.js} +3 -3
- package/dist/{ambient-client-defaults-BDRSTcYT.js.map → ambient-client-defaults-DdMbK4P9.js.map} +1 -1
- package/dist/{asg-provider-DhlT9esh.js → asg-provider-CNU0xa47.js} +6 -6
- package/dist/{asg-provider-DhlT9esh.js.map → asg-provider-CNU0xa47.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{custom-resource-runtime-Awo4Qqci.js → custom-resource-runtime-I0NaCnMw.js} +6 -6
- package/dist/{custom-resource-runtime-Awo4Qqci.js.map → custom-resource-runtime-I0NaCnMw.js.map} +1 -1
- package/dist/{db-associated-roles-vY4j5XbM.js → db-associated-roles-DksJGXc2.js} +2 -2
- package/dist/{db-associated-roles-vY4j5XbM.js.map → db-associated-roles-DksJGXc2.js.map} +1 -1
- package/dist/{delete-started-Dzdlx4Og.js → delete-started-CJaeCjUv.js} +4 -4
- package/dist/{delete-started-Dzdlx4Og.js.map → delete-started-CJaeCjUv.js.map} +1 -1
- package/dist/{deploy-engine-Th5M81Fb.js → deploy-engine-OG-CIQp9.js} +153 -25
- package/dist/deploy-engine-OG-CIQp9.js.map +1 -0
- package/dist/{diff-calculator-BHt-qLqK.js → diff-calculator-Cs9j467-.js} +168 -61
- package/dist/diff-calculator-Cs9j467-.js.map +1 -0
- package/dist/{ec2-termination-protection-BhT7P1Qr.js → ec2-termination-protection-DbyJ2q10.js} +8 -7
- package/dist/ec2-termination-protection-DbyJ2q10.js.map +1 -0
- package/dist/{ecr-uri-B-QP8AHe.js → ecr-uri-tlBeIkdd.js} +2 -2
- package/dist/{ecr-uri-B-QP8AHe.js.map → ecr-uri-tlBeIkdd.js.map} +1 -1
- package/dist/{expected-bucket-owner-TY_MPzst.js → expected-bucket-owner-JY3hiATN.js} +2 -2
- package/dist/{expected-bucket-owner-TY_MPzst.js.map → expected-bucket-owner-JY3hiATN.js.map} +1 -1
- package/dist/{iam-role-provider-KBcDwrRv.js → iam-role-provider-Dqv_R3ru.js} +8 -8
- package/dist/{iam-role-provider-KBcDwrRv.js.map → iam-role-provider-Dqv_R3ru.js.map} +1 -1
- package/dist/{image-plan-BEsB3Dmo.js → image-plan-DGVKU8RB.js} +8 -8
- package/dist/{image-plan-BEsB3Dmo.js.map → image-plan-DGVKU8RB.js.map} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-B2SyJOAf.js → logger-DIGYs-yu.js} +2 -2
- package/dist/{logger-B2SyJOAf.js.map → logger-DIGYs-yu.js.map} +1 -1
- package/dist/{neptune-provider-BR3kEieW.js → neptune-provider-BMraChKs.js} +7 -7
- package/dist/{neptune-provider-BR3kEieW.js.map → neptune-provider-BMraChKs.js.map} +1 -1
- package/dist/{program-QwXOnrpm.js → program-BikjBQ6T.js} +18 -35
- package/dist/program-BikjBQ6T.js.map +1 -0
- package/dist/{provider-classes-DMsbNzf6.js → provider-classes-CzitNbPu.js} +876 -165
- package/dist/provider-classes-CzitNbPu.js.map +1 -0
- package/dist/{rds-provider-D1eagWNh.js → rds-provider-MhOObj_3.js} +10 -10
- package/dist/{rds-provider-D1eagWNh.js.map → rds-provider-MhOObj_3.js.map} +1 -1
- package/dist/{read-replica-BJFu-OeG.js → read-replica-Cefn8iv7.js} +3 -3
- package/dist/{read-replica-BJFu-OeG.js.map → read-replica-Cefn8iv7.js.map} +1 -1
- package/dist/{replacement-rules-DhOfKveI.js → replacement-rules-CCuQt7l9.js} +59 -3
- package/dist/{replacement-rules-DhOfKveI.js.map → replacement-rules-CCuQt7l9.js.map} +1 -1
- package/dist/{resource-deadline-D_epAMej.js → resource-deadline-CzLso0NJ.js} +4 -4
- package/dist/{resource-deadline-D_epAMej.js.map → resource-deadline-CzLso0NJ.js.map} +1 -1
- package/dist/{restore-source-guard-B_-RdrjK.js → restore-source-guard-qc_YrJ4H.js} +4 -4
- package/dist/{restore-source-guard-B_-RdrjK.js.map → restore-source-guard-qc_YrJ4H.js.map} +1 -1
- package/dist/{run-cli-ozO7hy96.js → run-cli-DdhQMWgv.js} +2 -2
- package/dist/{run-cli-ozO7hy96.js.map → run-cli-DdhQMWgv.js.map} +1 -1
- package/dist/{version-snoNU0xA.js → version-Bm3FPycJ.js} +2 -2
- package/dist/{version-snoNU0xA.js.map → version-Bm3FPycJ.js.map} +1 -1
- package/package.json +2 -2
- package/dist/deploy-engine-Th5M81Fb.js.map +0 -1
- package/dist/diff-calculator-BHt-qLqK.js.map +0 -1
- package/dist/ec2-termination-protection-BhT7P1Qr.js.map +0 -1
- package/dist/program-QwXOnrpm.js.map +0 -1
- package/dist/provider-classes-DMsbNzf6.js.map +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-
|
|
2
|
-
import { A as configStringRefusal, B as generateResourceName, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, J as getCurrentStackName, M as replayWarn, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, U as recordedGeneratedNameKept, V as generateResourceNameWithFallback, Y as isBeforeStateRead, c as VERBOSE_POINTER, d as describeAwsStatusReason, f as isAwsAuthoredFailure, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, w as generatedNameFor } from "./logger-
|
|
1
|
+
import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-Dqv_R3ru.js";
|
|
2
|
+
import { A as configStringRefusal, B as generateResourceName, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, J as getCurrentStackName, M as replayWarn, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, U as recordedGeneratedNameKept, V as generateResourceNameWithFallback, Y as isBeforeStateRead, c as VERBOSE_POINTER, d as describeAwsStatusReason, f as isAwsAuthoredFailure, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, w as generatedNameFor } from "./logger-DIGYs-yu.js";
|
|
3
3
|
import { d as withApiGatewayPacing, l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-DOkPjjAW.js";
|
|
4
|
-
import { D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markRedactedCause, H as isMarkedNonRetryable, I as isExplicitDenyError, K as wrapMaskedAwsError, M as explicitDenyPolicyKind, O as relayedNameCollision, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, _ as ResourceUpdateNotSupportedError, at as ProvisioningError, et as CdkdError, i as credentialFingerprint, n as ambientCredentialConfig, r as clientDefaultsFor, t as ambientClientDefaults, z as isTransientServerError } from "./ambient-client-defaults-
|
|
5
|
-
import { $ as logGroupProtectionSite, $t as markCreatedBeforeFailure, A as ambiguousAttemptLead, At as compositeIdFormatMessage, B as isPlainImportValue, Bt as isSecretDerivedValue, Ct as renderDisableCommand, D as AmbiguousCreateLatch, Dt as isInterruptedWaitError, E as AMBIGUOUS_LATCH_TTL_MS, F as setBounded, G as remedyLogicalId, H as normalizeAwsTagsToCfn, Ht as maskerOrIdentity, I as withoutServerErrorRetries, It as segmentAfterAnchor, J as assertRegionMatch, K as resolveExplicitPhysicalId, Kt as clearCreatedBeforeFailure, L as VALUE_NOT_SHOWN, Lt as stateOrphanRecordRemedy, M as isInsideWindow, Mt as compositeIdSkipResult, N as replayFollowedAmbiguousAttempt, Nt as logicalIdShown, O as CREATION_DATE_SKEW_MARGIN_MS, Ot as startInterruptWatch, P as replayedSendWindow, Pt as packCompositeId, Q as deleteWithProtectionCompensation, Qt as markAuxiliaryFailure, R as importRemedyCommand, Rt as createMaskedLogSinks, S as readPrincipalLists, St as protectedReplacementAdvice, U as quotedRemedyLogicalId, Ut as withDerivedNameMasks, V as isQuotableImportValue, Vt as maskDeep, W as refusalTypeShown, X as markNotGone, Xt as isAuxiliaryFailure, _n as injectiveKeyPrefix, a as clearOnUpdateRemoval, at as deleteAfterProtectionFlipWithFinalSnapshot, b as holdsSecretDerivedEntry, bt as isAwsCliLiteral, c as removedTemplateKeys, ct as isTerminalDbWaitStatus, dt as isTerminalDeleteFailure, en as markSupersedesEarlierCreate, et as observeThenDisableProtection, ft as protectionFlipKey, g as retractCreatedResource, gn as injectiveKey, hn as withPasteableAwsProfile, ht as ElapsedBudgetRegistry, it as PROTECTION_FLIP_RETRY_WAIT_MS, j as createAttemptKey, jt as compositeIdSeparatorRefusal, k as RecentIdSet, kt as canonicalizeRoute53QueryName, l as withRemovalDefaults, m as reportCreatedResource, mt as ElapsedBudget, n as enclosingDeadlineRemainingMs, q as RESOURCE_NOT_FOUND, rt as userPoolProtectionSite, st as isProceedDbStatus, t as enclosingDeadlineExpired, tt as rdsFamilyProtectionSite, ut as ProtectionFlipRegistry, vt as UNNAMEABLE_ID_CLAUSE, w as recordedPrincipalsRepair, x as onlySecretDerived, xt as pasteableAwsCommand, y as SECRET_DERIVED_READ_LIVE, yt as WITHHELD_AWS_COMMAND, z as isPlainImportJson, zt as createMaskedRetryLogger } from "./resource-deadline-
|
|
6
|
-
import { A as displayStackName, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, c as deployReplaceCommand, d as pasteableCommand, j as isPasteableIdent, k as displaySafe, l as hasClauseBreak, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, u as isInertUnquoted, v as withheldTargetClause } from "./version-
|
|
7
|
-
import { gt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted } from "./delete-started-
|
|
8
|
-
import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-
|
|
9
|
-
import { $ as planVectorIndexUpdates,
|
|
10
|
-
import { _ as isUsableAttemptedName, c as planTagDiff, d as tagMapAsList, f as tagPlanWarning, g as stringifyIfAssigned, h as definedAttributes, i as refuseRestoreFromItself, l as readTagList, m as modifyDbInstanceWhenAvailable, o as DBPROXY_TAGS_WHAT, p as isModifyNotAvailableRefusal, s as DBPROXY_TAG_OPTIONS, u as refuseMalformedDesiredTags } from "./restore-source-guard-
|
|
11
|
-
import { A as withRetry, U as timePhase, _ as unchangedBehindSecretReference, a as reDisableInstanceApiTermination, d as markRefusedBeforeApplying, g as onlySecretReferencesDiffer, i as observeThenDisableInstanceApiTermination, l as getPriorAttempts, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedResourceTimeoutMs } from "./ec2-termination-protection-
|
|
4
|
+
import { D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markRedactedCause, H as isMarkedNonRetryable, I as isExplicitDenyError, K as wrapMaskedAwsError, M as explicitDenyPolicyKind, O as relayedNameCollision, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, _ as ResourceUpdateNotSupportedError, at as ProvisioningError, et as CdkdError, i as credentialFingerprint, n as ambientCredentialConfig, r as clientDefaultsFor, t as ambientClientDefaults, x as hasReplayMayCollide, z as isTransientServerError } from "./ambient-client-defaults-DdMbK4P9.js";
|
|
5
|
+
import { $ as logGroupProtectionSite, $t as markCreatedBeforeFailure, A as ambiguousAttemptLead, At as compositeIdFormatMessage, B as isPlainImportValue, Bt as isSecretDerivedValue, Ct as renderDisableCommand, D as AmbiguousCreateLatch, Dt as isInterruptedWaitError, E as AMBIGUOUS_LATCH_TTL_MS, F as setBounded, G as remedyLogicalId, H as normalizeAwsTagsToCfn, Ht as maskerOrIdentity, I as withoutServerErrorRetries, It as segmentAfterAnchor, J as assertRegionMatch, K as resolveExplicitPhysicalId, Kt as clearCreatedBeforeFailure, L as VALUE_NOT_SHOWN, Lt as stateOrphanRecordRemedy, M as isInsideWindow, Mt as compositeIdSkipResult, N as replayFollowedAmbiguousAttempt, Nt as logicalIdShown, O as CREATION_DATE_SKEW_MARGIN_MS, Ot as startInterruptWatch, P as replayedSendWindow, Pt as packCompositeId, Q as deleteWithProtectionCompensation, Qt as markAuxiliaryFailure, R as importRemedyCommand, Rt as createMaskedLogSinks, S as readPrincipalLists, St as protectedReplacementAdvice, U as quotedRemedyLogicalId, Ut as withDerivedNameMasks, V as isQuotableImportValue, Vt as maskDeep, W as refusalTypeShown, X as markNotGone, Xt as isAuxiliaryFailure, _n as injectiveKeyPrefix, a as clearOnUpdateRemoval, at as deleteAfterProtectionFlipWithFinalSnapshot, b as holdsSecretDerivedEntry, bt as isAwsCliLiteral, c as removedTemplateKeys, ct as isTerminalDbWaitStatus, dt as isTerminalDeleteFailure, en as markSupersedesEarlierCreate, et as observeThenDisableProtection, ft as protectionFlipKey, g as retractCreatedResource, gn as injectiveKey, hn as withPasteableAwsProfile, ht as ElapsedBudgetRegistry, it as PROTECTION_FLIP_RETRY_WAIT_MS, j as createAttemptKey, jt as compositeIdSeparatorRefusal, k as RecentIdSet, kt as canonicalizeRoute53QueryName, l as withRemovalDefaults, m as reportCreatedResource, mt as ElapsedBudget, n as enclosingDeadlineRemainingMs, q as RESOURCE_NOT_FOUND, rt as userPoolProtectionSite, st as isProceedDbStatus, t as enclosingDeadlineExpired, tt as rdsFamilyProtectionSite, ut as ProtectionFlipRegistry, vt as UNNAMEABLE_ID_CLAUSE, w as recordedPrincipalsRepair, x as onlySecretDerived, xt as pasteableAwsCommand, y as SECRET_DERIVED_READ_LIVE, yt as WITHHELD_AWS_COMMAND, z as isPlainImportJson, zt as createMaskedRetryLogger } from "./resource-deadline-CzLso0NJ.js";
|
|
6
|
+
import { A as displayStackName, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, c as deployReplaceCommand, d as pasteableCommand, j as isPasteableIdent, k as displaySafe, l as hasClauseBreak, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, u as isInertUnquoted, v as withheldTargetClause } from "./version-Bm3FPycJ.js";
|
|
7
|
+
import { gt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted } from "./delete-started-CJaeCjUv.js";
|
|
8
|
+
import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-BikjBQ6T.js";
|
|
9
|
+
import { $ as planVectorIndexUpdates, At as hasCdkAutoDeleteTag, B as declaredStreamTagsMember, Ba as waitForGoneAfterDelete, Cc as refuseMalformedNestedChildOutputs, Cl as listNestedTemplateRows, Ct as TABLE_INDEX_NOUN, Do as s3BucketDualStackDomainName, Dt as waitForIndexesSettled, Eo as s3BucketDomainName, Et as relayedIndexBusyDelete, Fr as redactedDeleteAddressFields, G as streamMemberRefusals, Ga as deleteSkipReason, Gt as isAccessDeniedError, H as reverseMapStreamPolicy, I as DynamoDBGlobalTableProvider, Ir as redactedDeleteAddressSkip, J as isTtlAlreadyDisabled, K as streamPolicyMatchesDeclared, Ka as withIndeterminateGuard, Kt as lookupEachName, L as STREAM_POLICY_KEY, Nc as refuseMalformedResourcesForDestroy, Nr as REDACTED_DELETE_ADDRESS_SKIP_REASON, Oa as getCurrentResourceSecrets, Oo as s3BucketRegionalDomainName, Os as passedParameterClassesOf, Ot as ECR_AUTO_DELETE_IMAGES_TAG, Pr as isRedactedRecordedValue, Q as sendTtlWaitingOutRateLimit, Qn as canonicalizeIpProtocolValue, R as STREAM_TAGS_KEY, Ra as waitForLambdaFunctionActive, Rc as accountArgs, Sl as isAbsoluteAssetPath, St as INDEX_SETTLE_POLL_INTERVAL_MS, To as s3BucketArn, Tt as maskedLogger, U as streamDeclaresPolicy, Ul as rewriteTemplateAssetReferences, Uo as outputReferenceProvenanceOf, V as planStreamMemberOps, W as streamDeclaresTags, Wt as chunks, X as planTimeToLive, Xc as withoutSdkUnwiredProperties, Xn as cfnIngressPortValue, Y as isTtlRateLimited, Ya as markWaitAbandoned, Yi as secretNamedAttributeNamesOf, Yn as withoutSiblingOwnedSgRules, Yo as getAccountInfo, Z as readTtlSpec, Zn as sgProtocolKey, _i as awaitInFlightSibling, _s as isWarmThroughputDecrease, _t as compensateRemovedDeletionProtection, _u as describeFileReadFailure, at as contributorInsightsRefusals, bt as resolveDynamoDbDeleteBudgetMs, bu as renderAssemblyPathEscape, cn as withNestedStackContext, ct as planIndexContributorInsightsOps, da as collectManagedPolicyArnsAttachedBySiblings, dt as reverseMapTableContributorInsights, en as getNestedRevertRun, et as readbackVectorIndexes, fa as collectPrincipalsAttachingPolicy, ft as stripIndexContributorInsights, gr as reserveStackCreateToken, gs as coerceWarmThroughput$1, gt as beginDeleteWait, ha as withoutSiblingOwned, hs as WARM_THROUGHPUT_MEMBERS, ht as DYNAMODB_DELETE_POLL_COST_MS, it as CONTRIBUTOR_INSIGHTS_KEY, jl as decodeListingKey, jt as isTruthyCfnBoolean, ko as s3BucketWebsiteUrl, kt as S3_AUTO_DELETE_OBJECTS_TAG, lt as readContributorInsightsSpec, ma as withoutSiblingAttachedArns, mr as earliestDefined, mt as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, no as APPSYNC_APIKEY_ARN_RESOURCE_PATH, nt as vectorIndexesSettled, ot as indexDeclaresContributorInsights, pt as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, q as streamTagsMatchDeclared, qc as findSdkUnwiredProperties, qn as siblingOwnedSgRuleIdentities, qr as getCurrentProducerRegions, qt as withApiLimit, rn as revertNestedChildFromJournal, ro as maskedSecretSegment, rt as vectorIndexesShapeDetail, sn as getCurrentNestedStackContext, st as planContributorInsightsOp, t as DeployEngine, to as isSettledInstanceState, tt as vectorIndexesForCreate, ua as collectGroupsAddedBySiblings, ut as reverseMapIndexContributorInsights, vr as acquireIdempotencyToken, vs as toCfnInteger, vt as deleteBudgetKey, vu as displayAssemblyPath, wl as renderNestedTemplateTreeDefect, wt as deleteTableWithIndexBusyRetry, xi as replacedDeleteFailureVerdict, xl as findNestedTemplateTreeDefect, xt as DELETE_INDEX_WAIT_PROCEED_NOTE, xu as resolveAssemblyPath, yi as getStackRecords, yl as stringifyValue, ys as toFiniteNumber, yt as resolveDynamoDbDeleteBudgetClock, z as declaredStreamPolicyMember, zc as withheldAccountClause, zo as parseWebACLArn } from "./deploy-engine-OG-CIQp9.js";
|
|
10
|
+
import { _ as isUsableAttemptedName, c as planTagDiff, d as tagMapAsList, f as tagPlanWarning, g as stringifyIfAssigned, h as definedAttributes, i as refuseRestoreFromItself, l as readTagList, m as modifyDbInstanceWhenAvailable, o as DBPROXY_TAGS_WHAT, p as isModifyNotAvailableRefusal, s as DBPROXY_TAG_OPTIONS, u as refuseMalformedDesiredTags } from "./restore-source-guard-qc_YrJ4H.js";
|
|
11
|
+
import { A as withRetry, U as timePhase, _ as unchangedBehindSecretReference, a as reDisableInstanceApiTermination, d as markRefusedBeforeApplying, g as onlySecretReferencesDiffer, i as observeThenDisableInstanceApiTermination, l as getPriorAttempts, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedResourceTimeoutMs } from "./ec2-termination-protection-DbyJ2q10.js";
|
|
12
12
|
import { n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
|
|
13
13
|
import { f as ambientRegion } from "./aws-client-defaults-DAebi99J.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
14
|
+
import { n as planSubscriptionAttributes } from "./diff-calculator-Cs9j467-.js";
|
|
15
|
+
import { $ as snapshotPassProvenance, At as withoutPhysicalNameCopies, C as passedNoEchoParametersOf, I as markSameGenerationBag, Nt as dynamicReferenceTokens, W as redactForState, Z as recordReferenceProvenanceEntry, a as emrClusterInstancesReplaced, cn as recordAttributeIdCopy, i as ecsServiceLaunchTypeSetOrChanged, it as hasMaskableValues, l as sameLambdaFunctionAddress, mn as carriesSecretMask, n as blockDeviceMappingsDifferOnlyInDeleteOnTermination, o as canonicalLambdaFunctionName, on as recoverMaskedOutput, s as lambdaFunctionNameForMask, sn as physicalNameCopiesOf } from "./replacement-rules-CCuQt7l9.js";
|
|
16
|
+
import { RDSProvider } from "./rds-provider-MhOObj_3.js";
|
|
17
|
+
import { NeptuneProvider } from "./neptune-provider-BMraChKs.js";
|
|
18
|
+
import { ASGProvider } from "./asg-provider-CNU0xa47.js";
|
|
18
19
|
import { createHash, randomUUID } from "node:crypto";
|
|
19
20
|
import { CreateBucketCommand, CreateBucketMetadataConfigurationCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetadataConfigurationCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAbacCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketMetadataConfigurationCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListBucketsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAbacCommand, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, UpdateBucketMetadataAnnotationTableConfigurationCommand, UpdateBucketMetadataInventoryTableConfigurationCommand, UpdateBucketMetadataJournalTableConfigurationCommand } from "@aws-sdk/client-s3";
|
|
20
21
|
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, UpdateGroupCommand, UpdateLoginProfileCommand, UpdateUserCommand } from "@aws-sdk/client-iam";
|
|
@@ -22,7 +23,7 @@ import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQ
|
|
|
22
23
|
import { CreateTopicCommand, DeleteTopicCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, InvalidParameterException, ListSubscriptionsByTopicCommand, ListTagsForResourceCommand, ListTopicsCommand, NotFoundException, SNSClient, SetSubscriptionAttributesCommand, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand } from "@aws-sdk/client-sns";
|
|
23
24
|
import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCodeSigningConfigCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionEventInvokeConfigCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCodeSigningConfigCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionConfigurationCommand, GetFunctionEventInvokeConfigCommand, GetFunctionRecursionConfigCommand, GetFunctionScalingConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, GetRuntimeManagementConfigCommand, LambdaClient, ListEventSourceMappingsCommand, ListLayerVersionsCommand, ListTagsCommand, PublishLayerVersionCommand, PublishVersionCommand, PutFunctionCodeSigningConfigCommand, PutFunctionConcurrencyCommand, PutFunctionEventInvokeConfigCommand, PutFunctionRecursionConfigCommand, PutFunctionScalingConfigCommand, PutRuntimeManagementConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionActiveV2, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
|
|
24
25
|
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
25
|
-
import { AllocateAddressCommand, AssociateAddressCommand, AssociateIamInstanceProfileCommand, AssociateNatGatewayAddressCommand, AssociateRouteTableCommand, AssociateSubnetCidrBlockCommand, AttachInternetGatewayCommand, AttachVolumeCommand, AttachVpnGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAddressesCommand, DescribeAvailabilityZonesCommand, DescribeIamInstanceProfileAssociationsCommand, DescribeInstanceAttributeCommand, DescribeInstanceCreditSpecificationsCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupRulesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DescribeVpnGatewaysCommand, DetachInternetGatewayCommand, DetachVolumeCommand, DetachVpnGatewayCommand, DisassociateAddressCommand, DisassociateIamInstanceProfileCommand, DisassociateNatGatewayAddressCommand, DisassociateRouteTableCommand, DisassociateSubnetCidrBlockCommand, EC2Client, GetIpamPoolAllocationsCommand, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifyInstancePlacementCommand, ModifyPrivateDnsNameOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ModifyVpcTenancyCommand, MonitorInstancesCommand, ReleaseAddressCommand, ReplaceIamInstanceProfileAssociationCommand, ReplaceNetworkAclAssociationCommand, ReplaceNetworkAclEntryCommand, ReplaceRouteCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, StartInstancesCommand, StopInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
|
|
26
|
+
import { AllocateAddressCommand, AssociateAddressCommand, AssociateIamInstanceProfileCommand, AssociateNatGatewayAddressCommand, AssociateRouteTableCommand, AssociateSubnetCidrBlockCommand, AttachInternetGatewayCommand, AttachVolumeCommand, AttachVpnGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAddressesCommand, DescribeAvailabilityZonesCommand, DescribeIamInstanceProfileAssociationsCommand, DescribeInstanceAttributeCommand, DescribeInstanceCreditSpecificationsCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupRulesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DescribeVpnGatewaysCommand, DetachInternetGatewayCommand, DetachVolumeCommand, DetachVpnGatewayCommand, DisassociateAddressCommand, DisassociateIamInstanceProfileCommand, DisassociateNatGatewayAddressCommand, DisassociateRouteTableCommand, DisassociateSubnetCidrBlockCommand, EC2Client, GetIpamPoolAllocationsCommand, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifyInstancePlacementCommand, ModifyPrivateDnsNameOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ModifyVpcTenancyCommand, MonitorInstancesCommand, ReleaseAddressCommand, ReplaceIamInstanceProfileAssociationCommand, ReplaceNetworkAclAssociationCommand, ReplaceNetworkAclEntryCommand, ReplaceRouteCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, StartInstancesCommand, StopInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, UpdateSecurityGroupRuleDescriptionsEgressCommand, UpdateSecurityGroupRuleDescriptionsIngressCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
|
|
26
27
|
import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DisableKinesisStreamingDestinationCommand, DynamoDBClient, EnableKinesisStreamingDestinationCommand, GetResourcePolicyCommand, ListTagsOfResourceCommand, PolicyNotFoundException, PutResourcePolicyCommand, ResourceNotFoundException as ResourceNotFoundException$1, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateContributorInsightsCommand, UpdateKinesisStreamingDestinationCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
|
|
27
28
|
import { APIGatewayClient, CreateAuthorizerCommand, CreateDeploymentCommand, CreateResourceCommand, CreateRestApiCommand, CreateStageCommand, DeleteAuthorizerCommand, DeleteDeploymentCommand, DeleteIntegrationCommand, DeleteIntegrationResponseCommand, DeleteMethodCommand, DeleteMethodResponseCommand, DeleteResourceCommand, DeleteRestApiCommand, DeleteStageCommand, GetAccountCommand, GetAuthorizerCommand, GetAuthorizersCommand, GetDeploymentCommand, GetDeploymentsCommand, GetMethodCommand, GetResourceCommand, GetRestApiCommand, GetRestApisCommand, GetStageCommand, ImportRestApiCommand, NotFoundException as NotFoundException$1, PutIntegrationCommand, PutIntegrationResponseCommand, PutMethodCommand, PutMethodResponseCommand, PutRestApiCommand, TagResourceCommand as TagResourceCommand$3, UntagResourceCommand as UntagResourceCommand$3, UpdateAccountCommand, UpdateAuthorizerCommand, UpdateDeploymentCommand, UpdateMethodCommand, UpdateRestApiCommand, UpdateStageCommand } from "@aws-sdk/client-api-gateway";
|
|
28
29
|
import { CreateEventBusCommand, DeleteEventBusCommand, DeleteRuleCommand, DescribeEventBusCommand, DescribeRuleCommand, EventBridgeClient, ListRulesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$1, ListTargetsByRuleCommand, PutPermissionCommand, PutRuleCommand, PutTargetsCommand, RemoveTargetsCommand, ResourceNotFoundException as ResourceNotFoundException$2, TagResourceCommand as TagResourceCommand$4, UntagResourceCommand as UntagResourceCommand$4, UpdateEventBusCommand } from "@aws-sdk/client-eventbridge";
|
|
@@ -2047,7 +2048,7 @@ async function readPrincipalSides(opts) {
|
|
|
2047
2048
|
}
|
|
2048
2049
|
const DEPLOY_SKIP_CAVEAT$2 = "NOTE this arm is ALSO reached from cdkd deploy. Since issue 1762 the DELETE of a resource removed from the template behaves like destroy — the record is KEPT and the next deploy re-attempts it — but a REPLACEMENT / rollback delete FAILS the resource instead (https://github.com/go-to-k/cdkd/issues/1762), leaving the old one untracked; there, remove the memberships by hand.";
|
|
2049
2050
|
const USER_NAME_MAX_LENGTH = 64;
|
|
2050
|
-
const GROUP_NAME_MAX_LENGTH = 128;
|
|
2051
|
+
const GROUP_NAME_MAX_LENGTH$1 = 128;
|
|
2051
2052
|
function iamPathOf(value) {
|
|
2052
2053
|
return value || "/";
|
|
2053
2054
|
}
|
|
@@ -8513,45 +8514,11 @@ var SNSTopicProvider = class {
|
|
|
8513
8514
|
|
|
8514
8515
|
// src/provisioning/providers/sns-subscription-provider.ts
|
|
8515
8516
|
const SNS_SUBSCRIPTION_DELETE_THREW_REASON = "the Unsubscribe call did not complete, so the old subscription is unproven";
|
|
8516
|
-
const MUTABLE_ATTRIBUTES = [
|
|
8517
|
-
"RawMessageDelivery",
|
|
8518
|
-
"FilterPolicy",
|
|
8519
|
-
"FilterPolicyScope",
|
|
8520
|
-
"RedrivePolicy",
|
|
8521
|
-
"DeliveryPolicy",
|
|
8522
|
-
"ReplayPolicy",
|
|
8523
|
-
"SubscriptionRoleArn"
|
|
8524
|
-
];
|
|
8525
|
-
const RESET_VALUES = {
|
|
8526
|
-
RawMessageDelivery: "false",
|
|
8527
|
-
FilterPolicy: "",
|
|
8528
|
-
FilterPolicyScope: "MessageAttributes",
|
|
8529
|
-
RedrivePolicy: ""
|
|
8530
|
-
};
|
|
8531
8517
|
const CREATE_ONLY_FIELDS = [
|
|
8532
8518
|
"TopicArn",
|
|
8533
8519
|
"Protocol",
|
|
8534
8520
|
"Endpoint"
|
|
8535
8521
|
];
|
|
8536
|
-
function toAttributeValue(key, value) {
|
|
8537
|
-
if (value === void 0) return void 0;
|
|
8538
|
-
if (key === "FilterPolicy" || key === "RedrivePolicy" || key === "DeliveryPolicy" || key === "ReplayPolicy") return typeof value === "string" ? value : JSON.stringify(value);
|
|
8539
|
-
return stringifyValue(value);
|
|
8540
|
-
}
|
|
8541
|
-
function sameAttributeValue(name, desired, current) {
|
|
8542
|
-
if (current === void 0) return desired === RESET_VALUES[name];
|
|
8543
|
-
if (desired === current) return true;
|
|
8544
|
-
try {
|
|
8545
|
-
return JSON.stringify(JSON.parse(desired)) === JSON.stringify(JSON.parse(current));
|
|
8546
|
-
} catch {
|
|
8547
|
-
return false;
|
|
8548
|
-
}
|
|
8549
|
-
}
|
|
8550
|
-
function filterPolicyCleared(plan, current) {
|
|
8551
|
-
const planned = plan.find(([name]) => name === "FilterPolicy");
|
|
8552
|
-
if (planned !== void 0) return planned[1] === "";
|
|
8553
|
-
return current["FilterPolicy"] === void 0 || current["FilterPolicy"] === "";
|
|
8554
|
-
}
|
|
8555
8522
|
var SNSSubscriptionProvider = class {
|
|
8556
8523
|
snsClient;
|
|
8557
8524
|
logger = getLogger().child("SNSSubscriptionProvider");
|
|
@@ -8649,23 +8616,8 @@ var SNSSubscriptionProvider = class {
|
|
|
8649
8616
|
const desired = properties[field];
|
|
8650
8617
|
if (desired !== void 0 && stringifyValue(desired) !== current[field]) return void 0;
|
|
8651
8618
|
}
|
|
8652
|
-
const
|
|
8653
|
-
|
|
8654
|
-
const desired = toAttributeValue(name, properties[name]);
|
|
8655
|
-
const now = current[name];
|
|
8656
|
-
if (desired !== void 0) {
|
|
8657
|
-
if (!sameAttributeValue(name, desired, now)) plan.push([name, desired]);
|
|
8658
|
-
continue;
|
|
8659
|
-
}
|
|
8660
|
-
if (now === void 0 || now === "") continue;
|
|
8661
|
-
if (name === "FilterPolicyScope" && filterPolicyCleared(plan, current)) continue;
|
|
8662
|
-
const reset = RESET_VALUES[name];
|
|
8663
|
-
if (reset === void 0) return void 0;
|
|
8664
|
-
if (now !== reset) plan.push([name, reset]);
|
|
8665
|
-
}
|
|
8666
|
-
const policy = plan.find(([name]) => name === "FilterPolicy");
|
|
8667
|
-
if (policy !== void 0 && policy[1] !== "" && plan.some(([name]) => name === "FilterPolicyScope")) return;
|
|
8668
|
-
return plan;
|
|
8619
|
+
const planned = planSubscriptionAttributes(current, properties);
|
|
8620
|
+
return planned.kind === "replace" ? void 0 : planned.calls;
|
|
8669
8621
|
}
|
|
8670
8622
|
wrapMaskedAwsCallError(mask, error, prefix, resourceType, logicalId, physicalId) {
|
|
8671
8623
|
const build = (text) => new ProvisioningError(`${prefix}: ${text}`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
|
|
@@ -13196,7 +13148,7 @@ function buildAttributes$3(resp) {
|
|
|
13196
13148
|
}
|
|
13197
13149
|
|
|
13198
13150
|
// src/provisioning/providers/lambda-network-connector-provider.ts
|
|
13199
|
-
const POLL_INTERVAL_MS$
|
|
13151
|
+
const POLL_INTERVAL_MS$1 = 1e3;
|
|
13200
13152
|
const MAX_POLL_ATTEMPTS = 1200;
|
|
13201
13153
|
var LambdaNetworkConnectorProvider = class {
|
|
13202
13154
|
client;
|
|
@@ -13220,7 +13172,7 @@ var LambdaNetworkConnectorProvider = class {
|
|
|
13220
13172
|
["LatestVersion", "AWS-managed read-only attribute"]
|
|
13221
13173
|
])]]);
|
|
13222
13174
|
getMinResourceTimeoutMs() {
|
|
13223
|
-
return MAX_POLL_ATTEMPTS * POLL_INTERVAL_MS$
|
|
13175
|
+
return MAX_POLL_ATTEMPTS * POLL_INTERVAL_MS$1;
|
|
13224
13176
|
}
|
|
13225
13177
|
async create(logicalId, resourceType, properties, context) {
|
|
13226
13178
|
this.logger.debug(safeMsg`Creating Lambda network connector ${logicalId}`);
|
|
@@ -13438,9 +13390,9 @@ var LambdaNetworkConnectorProvider = class {
|
|
|
13438
13390
|
message: resp.LastUpdateStatusReason
|
|
13439
13391
|
}, (message, options) => new Error(message, options));
|
|
13440
13392
|
if (resp.State === "ACTIVE" && resp.LastUpdateStatus !== "InProgress") return resp;
|
|
13441
|
-
await sleep$4(POLL_INTERVAL_MS$
|
|
13393
|
+
await sleep$4(POLL_INTERVAL_MS$1);
|
|
13442
13394
|
}
|
|
13443
|
-
throw new Error(`Lambda network connector ${logicalIdShown(logicalId)} did not finish ${operation} within ${MAX_POLL_ATTEMPTS * POLL_INTERVAL_MS$
|
|
13395
|
+
throw new Error(`Lambda network connector ${logicalIdShown(logicalId)} did not finish ${operation} within ${MAX_POLL_ATTEMPTS * POLL_INTERVAL_MS$1 / 1e3}s.`);
|
|
13444
13396
|
}
|
|
13445
13397
|
async waitForGone(arn, logicalId) {
|
|
13446
13398
|
for (let attempt = 1; attempt <= MAX_POLL_ATTEMPTS; attempt++) {
|
|
@@ -13455,9 +13407,9 @@ var LambdaNetworkConnectorProvider = class {
|
|
|
13455
13407
|
code: resp.StateReasonCode,
|
|
13456
13408
|
message: resp.StateReason
|
|
13457
13409
|
}, (message, options) => new Error(message, options));
|
|
13458
|
-
await sleep$4(POLL_INTERVAL_MS$
|
|
13410
|
+
await sleep$4(POLL_INTERVAL_MS$1);
|
|
13459
13411
|
}
|
|
13460
|
-
throw new Error(`Lambda network connector ${logicalIdShown(logicalId)} was not fully deleted within ${MAX_POLL_ATTEMPTS * POLL_INTERVAL_MS$
|
|
13412
|
+
throw new Error(`Lambda network connector ${logicalIdShown(logicalId)} was not fully deleted within ${MAX_POLL_ATTEMPTS * POLL_INTERVAL_MS$1 / 1e3}s.`);
|
|
13461
13413
|
}
|
|
13462
13414
|
wrapStatusReasonError(prefix, reason, build) {
|
|
13463
13415
|
const text = describeAwsStatusReason(reason, reason.code || "no reason given");
|
|
@@ -21474,6 +21426,23 @@ const routeMethods = {
|
|
|
21474
21426
|
deleteSubnetRouteTableAssociation
|
|
21475
21427
|
};
|
|
21476
21428
|
|
|
21429
|
+
// src/provisioning/providers/ec2/sg-rule-description.ts
|
|
21430
|
+
const SG_RULE_PERMISSION_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidPermission.NotFound"]);
|
|
21431
|
+
async function updateSgRuleDescription(client, groupId, direction, permission) {
|
|
21432
|
+
const input = {
|
|
21433
|
+
GroupId: groupId,
|
|
21434
|
+
IpPermissions: [permission]
|
|
21435
|
+
};
|
|
21436
|
+
try {
|
|
21437
|
+
if (direction === "egress") await client.send(new UpdateSecurityGroupRuleDescriptionsEgressCommand(input));
|
|
21438
|
+
else await client.send(new UpdateSecurityGroupRuleDescriptionsIngressCommand(input));
|
|
21439
|
+
return "updated";
|
|
21440
|
+
} catch (error) {
|
|
21441
|
+
if (isNamedError(error, SG_RULE_PERMISSION_NOT_FOUND_NAMES)) return "not-found";
|
|
21442
|
+
throw error;
|
|
21443
|
+
}
|
|
21444
|
+
}
|
|
21445
|
+
|
|
21477
21446
|
// src/provisioning/providers/ec2/security-group.ts
|
|
21478
21447
|
async function createSecurityGroup(logicalId, resourceType, properties, context) {
|
|
21479
21448
|
this.logger.debug(`Creating SecurityGroup ${logicalId}`);
|
|
@@ -21715,8 +21684,7 @@ async function applySecurityGroupRuleDiff(groupId, previousRules, nextRules, dir
|
|
|
21715
21684
|
peer: peerKey ?? null,
|
|
21716
21685
|
peerName: peerKey ? null : peerName ?? null,
|
|
21717
21686
|
peerOwner: peerOwner ?? null,
|
|
21718
|
-
pl: prefixKey ?? null
|
|
21719
|
-
d: rule["Description"] ?? null
|
|
21687
|
+
pl: prefixKey ?? null
|
|
21720
21688
|
});
|
|
21721
21689
|
};
|
|
21722
21690
|
const prevByKey = /* @__PURE__ */ new Map();
|
|
@@ -21726,7 +21694,12 @@ async function applySecurityGroupRuleDiff(groupId, previousRules, nextRules, dir
|
|
|
21726
21694
|
const toRevoke = [];
|
|
21727
21695
|
for (const [key, rule] of prevByKey) if (!nextByKey.has(key)) toRevoke.push(rule);
|
|
21728
21696
|
const toAuthorize = [];
|
|
21729
|
-
|
|
21697
|
+
const toDescribe = [];
|
|
21698
|
+
for (const [key, rule] of nextByKey) {
|
|
21699
|
+
const previous = prevByKey.get(key);
|
|
21700
|
+
if (previous === void 0) toAuthorize.push(rule);
|
|
21701
|
+
else if ((previous["Description"] ?? null) !== (rule["Description"] ?? null)) toDescribe.push(rule);
|
|
21702
|
+
}
|
|
21730
21703
|
for (const rule of toRevoke) {
|
|
21731
21704
|
if (direction === "ingress" && logicalId !== void 0) {
|
|
21732
21705
|
const holder = stackIngressRuleHolder(getStackRecords()?.survivors(), logicalId, groupId, rule);
|
|
@@ -21748,6 +21721,17 @@ async function applySecurityGroupRuleDiff(groupId, previousRules, nextRules, dir
|
|
|
21748
21721
|
if (!this.isNotFoundError(error)) throw error;
|
|
21749
21722
|
}
|
|
21750
21723
|
}
|
|
21724
|
+
for (const rule of toDescribe) {
|
|
21725
|
+
if (isRedactedRecordedValue(rule["Description"])) continue;
|
|
21726
|
+
if (direction === "ingress" && logicalId !== void 0) {
|
|
21727
|
+
const holder = stackIngressRuleHolder(getStackRecords()?.survivors(), logicalId, groupId, rule);
|
|
21728
|
+
if (holder !== void 0) {
|
|
21729
|
+
this.logger.info(safeMsg`SecurityGroup ${logicalId}: an ingress rule whose description changed is also held by ${holder} of this stack, so its description was left as it is`);
|
|
21730
|
+
continue;
|
|
21731
|
+
}
|
|
21732
|
+
}
|
|
21733
|
+
if (await updateSgRuleDescription(this.ec2Client, groupId, direction, this.buildIpPermission(rule, direction, direction === "ingress")) === "not-found") toAuthorize.push(rule);
|
|
21734
|
+
}
|
|
21751
21735
|
for (const rule of toAuthorize) try {
|
|
21752
21736
|
if (direction === "egress") await this.ec2Client.send(new AuthorizeSecurityGroupEgressCommand({
|
|
21753
21737
|
GroupId: groupId,
|
|
@@ -22037,6 +22021,26 @@ async function updateSecurityGroupIngress(logicalId, physicalId, resourceType, p
|
|
|
22037
22021
|
...recordedAttributes && { attributes: { ...recordedAttributes } }
|
|
22038
22022
|
};
|
|
22039
22023
|
}
|
|
22024
|
+
const identity = comparableIngressIdentity(properties["GroupId"], properties);
|
|
22025
|
+
if (identity !== void 0 && identity === comparableIngressIdentity(previousProperties["GroupId"], previousProperties) && !isRedactedRecordedValue(properties["Description"])) {
|
|
22026
|
+
const { ipProtocol, narrowed } = narrowIngressIpProtocol(properties, (message) => this.logger.warn(message));
|
|
22027
|
+
let outcome;
|
|
22028
|
+
try {
|
|
22029
|
+
outcome = await updateSgRuleDescription(this.ec2Client, properties["GroupId"], "ingress", {
|
|
22030
|
+
...this.buildIpPermission(properties),
|
|
22031
|
+
IpProtocol: ipProtocol
|
|
22032
|
+
});
|
|
22033
|
+
} catch (error) {
|
|
22034
|
+
const cause = error instanceof Error ? error : void 0;
|
|
22035
|
+
throw this.wrapCaughtError(maskerOrIdentity(maskSecrets), error, (text) => new ProvisioningError(`Failed to update the description of SecurityGroupIngress ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
22036
|
+
}
|
|
22037
|
+
if (outcome === "updated") return {
|
|
22038
|
+
physicalId,
|
|
22039
|
+
wasReplaced: false,
|
|
22040
|
+
...recordedAttributes && { attributes: { ...recordedAttributes } },
|
|
22041
|
+
...narrowed !== properties && { effectiveProperties: narrowed }
|
|
22042
|
+
};
|
|
22043
|
+
}
|
|
22040
22044
|
try {
|
|
22041
22045
|
if (keptFor !== void 0) this.logger.info(safeMsg`SecurityGroupIngress ${logicalId}: its previous rule is also held by ${keptFor} of this stack, so the update left it in place`);
|
|
22042
22046
|
const revoked = keptFor !== void 0 ? void 0 : await this.deleteSecurityGroupIngress(logicalId, physicalId, resourceType, previousProperties, recordedAttributes || maskSecrets ? {
|
|
@@ -29703,7 +29707,7 @@ async function update$28(logicalId, physicalId, resourceType, properties, previo
|
|
|
29703
29707
|
const currentConfig = getConfigResponse.DistributionConfig;
|
|
29704
29708
|
const newDistributionConfig = properties["DistributionConfig"] ?? {};
|
|
29705
29709
|
const previousDistributionConfig = previousProperties["DistributionConfig"] ?? {};
|
|
29706
|
-
const sdkConfig = this.mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId);
|
|
29710
|
+
const sdkConfig = this.mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId, context?.replayingState === true, context?.restoredObservedProperties);
|
|
29707
29711
|
await this.cloudFrontClient.send(new UpdateDistributionCommand({
|
|
29708
29712
|
Id: physicalId,
|
|
29709
29713
|
IfMatch: etag,
|
|
@@ -29960,7 +29964,7 @@ async function importImpl$28(input) {
|
|
|
29960
29964
|
}
|
|
29961
29965
|
|
|
29962
29966
|
// src/provisioning/providers/cloudfront-distribution/update-config.ts
|
|
29963
|
-
function mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId) {
|
|
29967
|
+
function mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId, replayingState, restoredObserved) {
|
|
29964
29968
|
const templateSdk = this.convertToSdkFormat(newDistributionConfig);
|
|
29965
29969
|
const previousSdk = this.convertToSdkFormat(previousDistributionConfig);
|
|
29966
29970
|
const merged = { ...currentConfig };
|
|
@@ -29974,9 +29978,68 @@ function mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistrib
|
|
|
29974
29978
|
}
|
|
29975
29979
|
Object.assign(merged, templateSdk);
|
|
29976
29980
|
merged["CallerReference"] = currentConfig["CallerReference"];
|
|
29981
|
+
fillOriginSslProtocols(merged, currentConfig, previousSdk, replayingState === true ? snapshotOriginSslProtocols(restoredObserved) : () => void 0, (originId) => this.logger.warn(replayingState ? safeMsg`CloudFront Distribution ${logicalId}: the rollback restores a template without OriginSSLProtocols on origin '${String(originId)}', so the value the failed deploy applied stays; revert it by declaring OriginSSLProtocols.` : safeMsg`CloudFront Distribution ${logicalId}: OriginSSLProtocols was removed from origin '${String(originId)}' in the template; keeping the live value rather than CloudFormation's SSLv3, TLSv1 default. Set it explicitly in the template to change it.`));
|
|
29977
29982
|
this.completeRequiredUpdateFields(merged);
|
|
29978
29983
|
return merged;
|
|
29979
29984
|
}
|
|
29985
|
+
const CREATE_DEFAULT_ORIGIN_SSL_PROTOCOLS = {
|
|
29986
|
+
Quantity: 3,
|
|
29987
|
+
Items: [
|
|
29988
|
+
"TLSv1",
|
|
29989
|
+
"TLSv1.1",
|
|
29990
|
+
"TLSv1.2"
|
|
29991
|
+
]
|
|
29992
|
+
};
|
|
29993
|
+
const ORIGIN_SSL_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
29994
|
+
"SSLv3",
|
|
29995
|
+
"TLSv1",
|
|
29996
|
+
"TLSv1.1",
|
|
29997
|
+
"TLSv1.2"
|
|
29998
|
+
]);
|
|
29999
|
+
function snapshotOriginSslProtocols(observed) {
|
|
30000
|
+
const config = observed?.["DistributionConfig"];
|
|
30001
|
+
const origins = config && typeof config === "object" ? config["Origins"] : void 0;
|
|
30002
|
+
if (!Array.isArray(origins)) return () => void 0;
|
|
30003
|
+
return (originId) => {
|
|
30004
|
+
const matches = origins.filter((o) => o && typeof o === "object" && o["Id"] === originId);
|
|
30005
|
+
if (matches.length !== 1) return void 0;
|
|
30006
|
+
const custom = matches[0]["CustomOriginConfig"];
|
|
30007
|
+
if (!custom || typeof custom !== "object") return void 0;
|
|
30008
|
+
const items = custom["OriginSSLProtocols"];
|
|
30009
|
+
if (!Array.isArray(items) || items.length === 0 || new Set(items).size !== items.length || !items.every((p) => typeof p === "string" && ORIGIN_SSL_PROTOCOLS.has(p))) return;
|
|
30010
|
+
return {
|
|
30011
|
+
Quantity: items.length,
|
|
30012
|
+
Items: [...items]
|
|
30013
|
+
};
|
|
30014
|
+
};
|
|
30015
|
+
}
|
|
30016
|
+
function fillOriginSslProtocols(config, currentConfig, previousConfig, restored, onRemovedKept) {
|
|
30017
|
+
const origins = config["Origins"];
|
|
30018
|
+
if (!origins || !Array.isArray(origins["Items"])) return;
|
|
30019
|
+
const liveOrigins = currentConfig["Origins"]?.["Items"];
|
|
30020
|
+
const liveProtocols = (id) => {
|
|
30021
|
+
if (!Array.isArray(liveOrigins)) return void 0;
|
|
30022
|
+
return (liveOrigins.find((o) => o?.["Id"] === id)?.["CustomOriginConfig"])?.["OriginSslProtocols"];
|
|
30023
|
+
};
|
|
30024
|
+
const previousItems = previousConfig["Origins"]?.["Items"];
|
|
30025
|
+
const previouslyDeclared = (id) => Array.isArray(previousItems) && previousItems.some((o) => o?.["Id"] === id && (o?.["CustomOriginConfig"])?.["OriginSslProtocols"] !== void 0);
|
|
30026
|
+
origins["Items"] = origins["Items"].map((origin) => {
|
|
30027
|
+
const custom = origin?.["CustomOriginConfig"];
|
|
30028
|
+
if (!custom || typeof custom !== "object") return origin;
|
|
30029
|
+
if (custom["OriginSslProtocols"] !== void 0) return origin;
|
|
30030
|
+
const live = liveProtocols(origin["Id"]);
|
|
30031
|
+
const declared = previouslyDeclared(origin["Id"]);
|
|
30032
|
+
const snapshot = declared || live === void 0 ? restored(origin["Id"]) : void 0;
|
|
30033
|
+
if (snapshot === void 0 && live !== void 0 && declared) onRemovedKept(origin["Id"]);
|
|
30034
|
+
return {
|
|
30035
|
+
...origin,
|
|
30036
|
+
CustomOriginConfig: {
|
|
30037
|
+
...custom,
|
|
30038
|
+
OriginSslProtocols: structuredClone(snapshot ?? live ?? CREATE_DEFAULT_ORIGIN_SSL_PROTOCOLS)
|
|
30039
|
+
}
|
|
30040
|
+
};
|
|
30041
|
+
});
|
|
30042
|
+
}
|
|
29980
30043
|
function completeRequiredUpdateFields(config) {
|
|
29981
30044
|
const origins = config["Origins"];
|
|
29982
30045
|
if (origins && Array.isArray(origins["Items"])) origins["Items"] = origins["Items"].map((origin) => {
|
|
@@ -29997,6 +30060,7 @@ function completeRequiredUpdateFields(config) {
|
|
|
29997
30060
|
const fillBehavior = (behavior) => {
|
|
29998
30061
|
const b = { ...behavior };
|
|
29999
30062
|
if (b["SmoothStreaming"] === void 0) b["SmoothStreaming"] = false;
|
|
30063
|
+
if (b["Compress"] === void 0) b["Compress"] = false;
|
|
30000
30064
|
if (b["FieldLevelEncryptionId"] === void 0) b["FieldLevelEncryptionId"] = "";
|
|
30001
30065
|
if (b["LambdaFunctionAssociations"] === void 0) b["LambdaFunctionAssociations"] = {
|
|
30002
30066
|
Quantity: 0,
|
|
@@ -30355,8 +30419,8 @@ var CloudFrontDistributionProvider = class {
|
|
|
30355
30419
|
waitForDistributionStable(distributionId, expectedEnabled) {
|
|
30356
30420
|
return waitForDistributionStable.call(this, distributionId, expectedEnabled);
|
|
30357
30421
|
}
|
|
30358
|
-
mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId) {
|
|
30359
|
-
return mergeUpdateConfig.call(this, currentConfig, newDistributionConfig, previousDistributionConfig, logicalId);
|
|
30422
|
+
mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId, replayingState, restoredObserved) {
|
|
30423
|
+
return mergeUpdateConfig.call(this, currentConfig, newDistributionConfig, previousDistributionConfig, logicalId, replayingState, restoredObserved);
|
|
30360
30424
|
}
|
|
30361
30425
|
completeRequiredUpdateFields(config) {
|
|
30362
30426
|
return completeRequiredUpdateFields.call(this, config);
|
|
@@ -35433,8 +35497,52 @@ var ELBv2Provider = class {
|
|
|
35433
35497
|
};
|
|
35434
35498
|
|
|
35435
35499
|
// src/provisioning/providers/rds-dbproxy/shared.ts
|
|
35436
|
-
const POLL_INTERVAL_MS
|
|
35437
|
-
const POLL_TIMEOUT_MS
|
|
35500
|
+
const POLL_INTERVAL_MS = 5e3;
|
|
35501
|
+
const POLL_TIMEOUT_MS = 18e5;
|
|
35502
|
+
const DEADLINE_MARGIN_MS$1 = 3e4;
|
|
35503
|
+
async function pauseBeforeNextPoll(deadline, watch) {
|
|
35504
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
35505
|
+
const left = Math.min(deadline - Date.now(), enclosingDeadlineRemainingMs() - DEADLINE_MARGIN_MS$1);
|
|
35506
|
+
if (left <= 0) return false;
|
|
35507
|
+
let remaining = Math.min(POLL_INTERVAL_MS, left);
|
|
35508
|
+
while (remaining > 0) {
|
|
35509
|
+
const step = Math.min(1e3, remaining);
|
|
35510
|
+
await new Promise((resolve) => setTimeout(resolve, step));
|
|
35511
|
+
remaining -= step;
|
|
35512
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
35513
|
+
}
|
|
35514
|
+
return true;
|
|
35515
|
+
}
|
|
35516
|
+
async function waitForDBProxyDeleteGone(opts) {
|
|
35517
|
+
const what = opts.mask(opts.what);
|
|
35518
|
+
let sawDeleting = false;
|
|
35519
|
+
let gone = false;
|
|
35520
|
+
let lastStatus;
|
|
35521
|
+
const wrapRecordKeptError = (text) => markWaitAbandoned(new ProvisioningError(opts.mask(`${opts.what} ${text}. The state record is kept: check it, then re-run once it is gone or settled.`), opts.resourceType, opts.logicalId, opts.physicalId));
|
|
35522
|
+
await waitForGoneAfterDelete({
|
|
35523
|
+
what,
|
|
35524
|
+
resourceType: opts.resourceType,
|
|
35525
|
+
describe: async () => {
|
|
35526
|
+
const status = await opts.readStatus();
|
|
35527
|
+
if (status === void 0) gone = true;
|
|
35528
|
+
else if (status !== "unknown") lastStatus = status;
|
|
35529
|
+
return status;
|
|
35530
|
+
},
|
|
35531
|
+
consequence: "Until AWS finishes the delete, a create of the same name can be refused, and the subnets and security groups it uses stay in use.",
|
|
35532
|
+
failedStatus: (status) => {
|
|
35533
|
+
if (status === "deleting") {
|
|
35534
|
+
sawDeleting = true;
|
|
35535
|
+
return;
|
|
35536
|
+
}
|
|
35537
|
+
if (!sawDeleting || status === "unknown") return void 0;
|
|
35538
|
+
return wrapRecordKeptError(`left the deleting state for ${status} after its delete was accepted, so AWS is not removing it`);
|
|
35539
|
+
},
|
|
35540
|
+
logger: createMaskedLogSinks(opts.logger, opts.mask),
|
|
35541
|
+
pollIntervalMs: POLL_INTERVAL_MS,
|
|
35542
|
+
maxWaitMs: Math.max(0, Math.min(POLL_TIMEOUT_MS, enclosingDeadlineRemainingMs() - DEADLINE_MARGIN_MS$1))
|
|
35543
|
+
});
|
|
35544
|
+
if (!gone && !sawDeleting && lastStatus !== void 0) throw wrapRecordKeptError(`still read ${lastStatus}, never deleting, when cdkd stopped waiting after its delete was accepted, so AWS may not be removing it`);
|
|
35545
|
+
}
|
|
35438
35546
|
const RETAINED_ON_REMOVAL = [
|
|
35439
35547
|
"Auth",
|
|
35440
35548
|
"DefaultAuthScheme",
|
|
@@ -35499,10 +35607,12 @@ async function create$24(logicalId, resourceType, properties, context) {
|
|
|
35499
35607
|
let endpoint;
|
|
35500
35608
|
let dbProxyArn;
|
|
35501
35609
|
let vpcId;
|
|
35502
|
-
const deadline = Date.now() + POLL_TIMEOUT_MS
|
|
35610
|
+
const deadline = Date.now() + POLL_TIMEOUT_MS;
|
|
35503
35611
|
let status;
|
|
35612
|
+
const watch = startInterruptWatch(mask(`DBProxy ${dbProxyName} wait for available`));
|
|
35504
35613
|
try {
|
|
35505
35614
|
while (Date.now() < deadline) {
|
|
35615
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
35506
35616
|
try {
|
|
35507
35617
|
const proxy = (await client.send(new DescribeDBProxiesCommand({ DBProxyName: dbProxyName }))).DBProxies?.[0];
|
|
35508
35618
|
status = proxy?.Status;
|
|
@@ -35517,12 +35627,14 @@ async function create$24(logicalId, resourceType, properties, context) {
|
|
|
35517
35627
|
if (error instanceof DBProxyNotFoundFault) {} else if (error instanceof ProvisioningError) throw error;
|
|
35518
35628
|
else throw this.wrapCaughtError(error, "CREATE (poll)", resourceType, logicalId, dbProxyName, mask);
|
|
35519
35629
|
}
|
|
35520
|
-
|
|
35630
|
+
if (!await pauseBeforeNextPoll(deadline, watch)) break;
|
|
35521
35631
|
}
|
|
35522
35632
|
if (!endpoint || !dbProxyArn) throw new ProvisioningError(mask(`Timed out waiting for DBProxy ${dbProxyName} to become available (last status: ${status ?? "unknown"})`), resourceType, logicalId, dbProxyName);
|
|
35523
35633
|
} catch (error) {
|
|
35524
35634
|
markCreatedBeforeFailure(error, logicalId, resourceType, dbProxyName);
|
|
35525
35635
|
throw error;
|
|
35636
|
+
} finally {
|
|
35637
|
+
watch.dispose();
|
|
35526
35638
|
}
|
|
35527
35639
|
return {
|
|
35528
35640
|
physicalId: dbProxyName,
|
|
@@ -35592,20 +35704,26 @@ async function update$24(logicalId, physicalId, resourceType, properties, previo
|
|
|
35592
35704
|
}
|
|
35593
35705
|
async function waitForAvailableAfterModify(physicalId, resourceType, logicalId, mask) {
|
|
35594
35706
|
const client = this.getClient();
|
|
35595
|
-
const deadline = Date.now() + POLL_TIMEOUT_MS
|
|
35707
|
+
const deadline = Date.now() + POLL_TIMEOUT_MS;
|
|
35596
35708
|
let status;
|
|
35597
|
-
|
|
35598
|
-
|
|
35599
|
-
|
|
35600
|
-
if (
|
|
35601
|
-
|
|
35602
|
-
|
|
35603
|
-
|
|
35604
|
-
|
|
35709
|
+
const watch = startInterruptWatch(mask(`DBProxy ${physicalId} wait after modify`));
|
|
35710
|
+
try {
|
|
35711
|
+
while (Date.now() < deadline) {
|
|
35712
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
35713
|
+
try {
|
|
35714
|
+
const proxy = (await client.send(new DescribeDBProxiesCommand({ DBProxyName: physicalId }))).DBProxies?.[0];
|
|
35715
|
+
if (!proxy) throw new ProvisioningError(mask(`DBProxy ${physicalId} was not found while waiting for it after modify`), resourceType, logicalId, physicalId);
|
|
35716
|
+
status = proxy.Status;
|
|
35717
|
+
} catch (error) {
|
|
35718
|
+
if (error instanceof ProvisioningError) throw error;
|
|
35719
|
+
throw this.wrapCaughtError(error, "UPDATE (poll)", resourceType, logicalId, physicalId, mask);
|
|
35720
|
+
}
|
|
35721
|
+
if (status === "available") return;
|
|
35722
|
+
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(mask(`DBProxy ${physicalId} entered terminal failure state after modify: ${status}`), resourceType, logicalId, physicalId);
|
|
35723
|
+
if (!await pauseBeforeNextPoll(deadline, watch)) break;
|
|
35605
35724
|
}
|
|
35606
|
-
|
|
35607
|
-
|
|
35608
|
-
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS$1));
|
|
35725
|
+
} finally {
|
|
35726
|
+
watch.dispose();
|
|
35609
35727
|
}
|
|
35610
35728
|
throw new ProvisioningError(mask(`Timed out waiting for DBProxy ${physicalId} to become available after modify (last status: ${status ?? "unknown"})`), resourceType, logicalId, physicalId);
|
|
35611
35729
|
}
|
|
@@ -35665,32 +35783,34 @@ async function applyTagDiff$9(physicalId, oldTags, newTags, resourceType, logica
|
|
|
35665
35783
|
async function deleteImpl$24(logicalId, physicalId, resourceType, _properties, context) {
|
|
35666
35784
|
const client = this.getClient();
|
|
35667
35785
|
const mask = maskerOrIdentity(context?.maskSecrets);
|
|
35668
|
-
this.logger.debug(`Deleting DBProxy ${physicalId}`);
|
|
35786
|
+
this.logger.debug(mask(`Deleting DBProxy ${physicalId}`));
|
|
35669
35787
|
try {
|
|
35670
35788
|
await client.send(new DeleteDBProxyCommand({ DBProxyName: physicalId }));
|
|
35671
35789
|
} catch (error) {
|
|
35672
35790
|
if (error instanceof DBProxyNotFoundFault) {
|
|
35673
35791
|
const clientRegion = await client.config.region();
|
|
35674
35792
|
assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
35675
|
-
this.logger.debug(`DBProxy ${physicalId} already gone, treating as success`);
|
|
35793
|
+
this.logger.debug(mask(`DBProxy ${physicalId} already gone, treating as success`));
|
|
35676
35794
|
return;
|
|
35677
35795
|
}
|
|
35678
35796
|
throw this.wrapDeleteError(error, "DELETE", resourceType, logicalId, physicalId, mask);
|
|
35679
35797
|
}
|
|
35680
|
-
|
|
35681
|
-
|
|
35682
|
-
|
|
35683
|
-
|
|
35684
|
-
|
|
35685
|
-
|
|
35686
|
-
|
|
35687
|
-
return;
|
|
35798
|
+
await waitForDBProxyDeleteGone({
|
|
35799
|
+
what: `DBProxy ${physicalId}`,
|
|
35800
|
+
resourceType,
|
|
35801
|
+
logicalId,
|
|
35802
|
+
physicalId,
|
|
35803
|
+
readStatus: async () => {
|
|
35804
|
+
try {
|
|
35805
|
+
return (await client.send(new DescribeDBProxiesCommand({ DBProxyName: physicalId }))).DBProxies?.[0]?.Status ?? "unknown";
|
|
35806
|
+
} catch (error) {
|
|
35807
|
+
if (error instanceof DBProxyNotFoundFault) return void 0;
|
|
35808
|
+
throw error;
|
|
35688
35809
|
}
|
|
35689
|
-
|
|
35690
|
-
|
|
35691
|
-
|
|
35692
|
-
}
|
|
35693
|
-
throw new ProvisioningError(`Timed out waiting for DBProxy ${physicalId} to fully delete`, resourceType, logicalId, physicalId);
|
|
35810
|
+
},
|
|
35811
|
+
logger: this.logger,
|
|
35812
|
+
mask
|
|
35813
|
+
});
|
|
35694
35814
|
}
|
|
35695
35815
|
|
|
35696
35816
|
// src/provisioning/providers/rds-dbproxy/read-state.ts
|
|
@@ -35875,8 +35995,6 @@ var RDSDBProxyProvider = class {
|
|
|
35875
35995
|
};
|
|
35876
35996
|
|
|
35877
35997
|
// src/provisioning/providers/rds-dbproxy-endpoint-provider.ts
|
|
35878
|
-
const POLL_INTERVAL_MS = 5e3;
|
|
35879
|
-
const POLL_TIMEOUT_MS = 18e5;
|
|
35880
35998
|
var RDSDBProxyEndpointProvider = class {
|
|
35881
35999
|
rdsClient;
|
|
35882
36000
|
createClient;
|
|
@@ -35939,8 +36057,10 @@ var RDSDBProxyEndpointProvider = class {
|
|
|
35939
36057
|
let vpcId;
|
|
35940
36058
|
const deadline = Date.now() + POLL_TIMEOUT_MS;
|
|
35941
36059
|
let status;
|
|
36060
|
+
const watch = startInterruptWatch(mask(`DBProxyEndpoint ${dbProxyEndpointName} wait for available`));
|
|
35942
36061
|
try {
|
|
35943
36062
|
while (Date.now() < deadline) {
|
|
36063
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
35944
36064
|
try {
|
|
35945
36065
|
const ep = (await client.send(new DescribeDBProxyEndpointsCommand({ DBProxyEndpointName: dbProxyEndpointName }))).DBProxyEndpoints?.[0];
|
|
35946
36066
|
status = ep?.Status;
|
|
@@ -35952,17 +36072,19 @@ var RDSDBProxyEndpointProvider = class {
|
|
|
35952
36072
|
vpcId = ep?.VpcId;
|
|
35953
36073
|
break;
|
|
35954
36074
|
}
|
|
35955
|
-
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(`DBProxyEndpoint ${dbProxyEndpointName} entered terminal failure state: ${status}
|
|
36075
|
+
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(mask(`DBProxyEndpoint ${dbProxyEndpointName} entered terminal failure state: ${status}`), resourceType, logicalId, dbProxyEndpointName);
|
|
35956
36076
|
} catch (error) {
|
|
35957
36077
|
if (error instanceof DBProxyEndpointNotFoundFault || error instanceof DBProxyNotFoundFault) {} else if (error instanceof ProvisioningError) throw error;
|
|
35958
36078
|
else throw this.wrapCaughtError(error, "CREATE (poll)", resourceType, logicalId, dbProxyEndpointName, mask);
|
|
35959
36079
|
}
|
|
35960
|
-
|
|
36080
|
+
if (!await pauseBeforeNextPoll(deadline, watch)) break;
|
|
35961
36081
|
}
|
|
35962
|
-
if (!endpoint || !arn) throw new ProvisioningError(`Timed out waiting for DBProxyEndpoint ${dbProxyEndpointName} to become available (last status: ${status ?? "unknown"})
|
|
36082
|
+
if (!endpoint || !arn) throw new ProvisioningError(mask(`Timed out waiting for DBProxyEndpoint ${dbProxyEndpointName} to become available (last status: ${status ?? "unknown"})`), resourceType, logicalId, dbProxyEndpointName);
|
|
35963
36083
|
} catch (error) {
|
|
35964
36084
|
markCreatedBeforeFailure(error, logicalId, resourceType, dbProxyEndpointName);
|
|
35965
36085
|
throw error;
|
|
36086
|
+
} finally {
|
|
36087
|
+
watch.dispose();
|
|
35966
36088
|
}
|
|
35967
36089
|
return {
|
|
35968
36090
|
physicalId: dbProxyEndpointName,
|
|
@@ -36004,6 +36126,7 @@ var RDSDBProxyEndpointProvider = class {
|
|
|
36004
36126
|
} catch (error) {
|
|
36005
36127
|
throw this.wrapCaughtError(error, "UPDATE", resourceType, logicalId, physicalId, mask);
|
|
36006
36128
|
}
|
|
36129
|
+
await this.waitForAvailableAfterModify(physicalId, resourceType, logicalId, mask);
|
|
36007
36130
|
}
|
|
36008
36131
|
this.invalidateAttributeCache(physicalId);
|
|
36009
36132
|
await this.applyTagDiff(physicalId, previousProperties["Tags"], properties["Tags"], resourceType, logicalId, mask);
|
|
@@ -36012,35 +36135,62 @@ var RDSDBProxyEndpointProvider = class {
|
|
|
36012
36135
|
wasReplaced: false
|
|
36013
36136
|
};
|
|
36014
36137
|
}
|
|
36138
|
+
async waitForAvailableAfterModify(physicalId, resourceType, logicalId, mask) {
|
|
36139
|
+
const client = this.getClient();
|
|
36140
|
+
const deadline = Date.now() + POLL_TIMEOUT_MS;
|
|
36141
|
+
let status;
|
|
36142
|
+
const watch = startInterruptWatch(mask(`DBProxyEndpoint ${physicalId} wait after modify`));
|
|
36143
|
+
try {
|
|
36144
|
+
while (Date.now() < deadline) {
|
|
36145
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
36146
|
+
try {
|
|
36147
|
+
const ep = (await client.send(new DescribeDBProxyEndpointsCommand({ DBProxyEndpointName: physicalId }))).DBProxyEndpoints?.[0];
|
|
36148
|
+
if (!ep) throw new ProvisioningError(mask(`DBProxyEndpoint ${physicalId} was not found while waiting for it after modify`), resourceType, logicalId, physicalId);
|
|
36149
|
+
status = ep.Status;
|
|
36150
|
+
} catch (error) {
|
|
36151
|
+
if (error instanceof ProvisioningError) throw error;
|
|
36152
|
+
throw this.wrapCaughtError(error, "UPDATE (poll)", resourceType, logicalId, physicalId, mask);
|
|
36153
|
+
}
|
|
36154
|
+
if (status === "available") return;
|
|
36155
|
+
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(mask(`DBProxyEndpoint ${physicalId} entered terminal failure state after modify: ${status}`), resourceType, logicalId, physicalId);
|
|
36156
|
+
if (!await pauseBeforeNextPoll(deadline, watch)) break;
|
|
36157
|
+
}
|
|
36158
|
+
} finally {
|
|
36159
|
+
watch.dispose();
|
|
36160
|
+
}
|
|
36161
|
+
throw new ProvisioningError(mask(`Timed out waiting for DBProxyEndpoint ${physicalId} to become available after modify (last status: ${status ?? "unknown"})`), resourceType, logicalId, physicalId);
|
|
36162
|
+
}
|
|
36015
36163
|
async delete(logicalId, physicalId, resourceType, _properties, context) {
|
|
36016
36164
|
const client = this.getClient();
|
|
36017
36165
|
const mask = maskerOrIdentity(context?.maskSecrets);
|
|
36018
|
-
this.logger.debug(`Deleting DBProxyEndpoint ${physicalId}`);
|
|
36166
|
+
this.logger.debug(mask(`Deleting DBProxyEndpoint ${physicalId}`));
|
|
36019
36167
|
try {
|
|
36020
36168
|
await client.send(new DeleteDBProxyEndpointCommand({ DBProxyEndpointName: physicalId }));
|
|
36021
36169
|
} catch (error) {
|
|
36022
36170
|
if (error instanceof DBProxyEndpointNotFoundFault || error instanceof DBProxyNotFoundFault) {
|
|
36023
36171
|
const clientRegion = await client.config.region();
|
|
36024
36172
|
assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
36025
|
-
this.logger.debug(`DBProxyEndpoint ${physicalId} or parent already gone, treating as success`);
|
|
36173
|
+
this.logger.debug(mask(`DBProxyEndpoint ${physicalId} or parent already gone, treating as success`));
|
|
36026
36174
|
return;
|
|
36027
36175
|
}
|
|
36028
36176
|
throw this.wrapDeleteError(error, "DELETE", resourceType, logicalId, physicalId, mask);
|
|
36029
36177
|
}
|
|
36030
|
-
|
|
36031
|
-
|
|
36032
|
-
|
|
36033
|
-
|
|
36034
|
-
|
|
36035
|
-
|
|
36036
|
-
|
|
36037
|
-
return;
|
|
36178
|
+
await waitForDBProxyDeleteGone({
|
|
36179
|
+
what: `DBProxyEndpoint ${physicalId}`,
|
|
36180
|
+
resourceType,
|
|
36181
|
+
logicalId,
|
|
36182
|
+
physicalId,
|
|
36183
|
+
readStatus: async () => {
|
|
36184
|
+
try {
|
|
36185
|
+
return (await client.send(new DescribeDBProxyEndpointsCommand({ DBProxyEndpointName: physicalId }))).DBProxyEndpoints?.[0]?.Status ?? "unknown";
|
|
36186
|
+
} catch (error) {
|
|
36187
|
+
if (error instanceof DBProxyEndpointNotFoundFault || error instanceof DBProxyNotFoundFault) return;
|
|
36188
|
+
throw error;
|
|
36038
36189
|
}
|
|
36039
|
-
|
|
36040
|
-
|
|
36041
|
-
|
|
36042
|
-
}
|
|
36043
|
-
throw new ProvisioningError(`Timed out waiting for DBProxyEndpoint ${physicalId} to fully delete`, resourceType, logicalId, physicalId);
|
|
36190
|
+
},
|
|
36191
|
+
logger: this.logger,
|
|
36192
|
+
mask
|
|
36193
|
+
});
|
|
36044
36194
|
}
|
|
36045
36195
|
async getAttribute(physicalId, _resourceType, attributeName) {
|
|
36046
36196
|
const cacheKey = injectiveKey(physicalId, attributeName);
|
|
@@ -38745,7 +38895,8 @@ function getClient$8() {
|
|
|
38745
38895
|
async function create$21(logicalId, resourceType, properties, context) {
|
|
38746
38896
|
switch (resourceType) {
|
|
38747
38897
|
case "AWS::Route53::HostedZone": return this.createHostedZone(logicalId, resourceType, properties, context?.maskSecrets, context);
|
|
38748
|
-
case "AWS::Route53::RecordSet": return this.createRecordSet(logicalId, resourceType, properties, context?.maskSecrets);
|
|
38898
|
+
case "AWS::Route53::RecordSet": return this.createRecordSet(logicalId, resourceType, properties, context?.maskSecrets, context?.replayingState === true);
|
|
38899
|
+
case "AWS::Route53::RecordSetGroup": return this.createRecordSetGroup(logicalId, resourceType, properties, context?.maskSecrets, context?.replayingState === true);
|
|
38749
38900
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId);
|
|
38750
38901
|
}
|
|
38751
38902
|
}
|
|
@@ -38753,6 +38904,7 @@ async function update$21(logicalId, physicalId, resourceType, properties, previo
|
|
|
38753
38904
|
switch (resourceType) {
|
|
38754
38905
|
case "AWS::Route53::HostedZone": return this.updateHostedZone(logicalId, physicalId, resourceType, properties, previousProperties, context?.maskSecrets, context);
|
|
38755
38906
|
case "AWS::Route53::RecordSet": return this.updateRecordSet(logicalId, physicalId, resourceType, properties, previousProperties, context);
|
|
38907
|
+
case "AWS::Route53::RecordSetGroup": return this.updateRecordSetGroup(logicalId, physicalId, resourceType, properties, previousProperties, context);
|
|
38756
38908
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
|
|
38757
38909
|
}
|
|
38758
38910
|
}
|
|
@@ -38760,6 +38912,7 @@ async function deleteImpl$21(logicalId, physicalId, resourceType, properties, co
|
|
|
38760
38912
|
switch (resourceType) {
|
|
38761
38913
|
case "AWS::Route53::HostedZone": return this.deleteHostedZone(logicalId, physicalId, resourceType, context);
|
|
38762
38914
|
case "AWS::Route53::RecordSet": return this.deleteRecordSet(logicalId, physicalId, resourceType, properties, context);
|
|
38915
|
+
case "AWS::Route53::RecordSetGroup": return this.deleteRecordSetGroup(logicalId, physicalId, resourceType, properties, context);
|
|
38763
38916
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
|
|
38764
38917
|
}
|
|
38765
38918
|
}
|
|
@@ -38873,6 +39026,31 @@ function recordIdentityChanged(previous, desired) {
|
|
|
38873
39026
|
function zoneNameShown(name) {
|
|
38874
39027
|
return isPlainImportValue(name.replace(/\\[0-7]{3}/g, "x")) ? `"${name}"` : VALUE_NOT_SHOWN;
|
|
38875
39028
|
}
|
|
39029
|
+
function bareHostedZoneId(id) {
|
|
39030
|
+
return id.replace(/^\/hostedzone\//, "");
|
|
39031
|
+
}
|
|
39032
|
+
function zoneReferenceChanged(previous, desired) {
|
|
39033
|
+
return JSON.stringify([previous["HostedZoneId"] ?? null, previous["HostedZoneName"] ?? null]) !== JSON.stringify([desired["HostedZoneId"] ?? null, desired["HostedZoneName"] ?? null]);
|
|
39034
|
+
}
|
|
39035
|
+
async function recordedZoneForSwitch(provider, recordedZone, logicalId, resourceType, physicalId, noun) {
|
|
39036
|
+
const zoneSwitchRefusalError = (why, cause) => new ProvisioningError(`${noun} ${logicalId}: the template changes its hosted zone reference, and cdkd cannot confirm the new reference names the zone the record was recorded in (${why}). Keep the zone key the record already uses.`, resourceType, logicalId, physicalId, cause);
|
|
39037
|
+
if (isRedactedRecordedValue(recordedZone["HostedZoneId"]) || isRedactedRecordedValue(recordedZone["HostedZoneName"])) throw zoneSwitchRefusalError("the recorded zone is redacted");
|
|
39038
|
+
try {
|
|
39039
|
+
return await provider.resolveHostedZoneId(recordedZone, logicalId, resourceType, physicalId, { requireUnambiguousZoneName: true });
|
|
39040
|
+
} catch (error) {
|
|
39041
|
+
throw zoneSwitchRefusalError("the recorded zone could not be resolved", error instanceof Error ? error : void 0);
|
|
39042
|
+
}
|
|
39043
|
+
}
|
|
39044
|
+
function refuseCfnUnresolvableZoneName(provider, value, noun, logicalId, resourceType, physicalId, stateBorne) {
|
|
39045
|
+
if (typeof value !== "string" || value === "") return;
|
|
39046
|
+
if (value.endsWith(".") && value === value.toLowerCase()) return;
|
|
39047
|
+
const message = `${noun} ${logicalId}: HostedZoneName ${zoneNameShown(value)} is not the zone's exact name; CloudFormation resolves only the zone's lower-case name with its trailing dot, and fails this one`;
|
|
39048
|
+
if (stateBorne) {
|
|
39049
|
+
provider.logger.warn(safeMsg`${message}. Resolving it anyway for this state replay.`);
|
|
39050
|
+
return;
|
|
39051
|
+
}
|
|
39052
|
+
throw new ProvisioningError(message, resourceType, logicalId, physicalId);
|
|
39053
|
+
}
|
|
38876
39054
|
|
|
38877
39055
|
// src/provisioning/providers/route53/hosted-zone.ts
|
|
38878
39056
|
async function createHostedZone(logicalId, resourceType, properties, mask, context) {
|
|
@@ -39176,9 +39354,10 @@ async function waitForAcceleratedRecoveryMutable(zoneId, logicalId, resourceType
|
|
|
39176
39354
|
}
|
|
39177
39355
|
|
|
39178
39356
|
// src/provisioning/providers/route53/record-set.ts
|
|
39179
|
-
async function createRecordSet(logicalId, resourceType, properties, mask) {
|
|
39357
|
+
async function createRecordSet(logicalId, resourceType, properties, mask, replayingState = false) {
|
|
39180
39358
|
this.logger.debug(`Creating Route 53 record set ${logicalId}`);
|
|
39181
|
-
|
|
39359
|
+
refuseCfnUnresolvableZoneName(this, properties["HostedZoneName"], "Record set", logicalId, resourceType, void 0, replayingState);
|
|
39360
|
+
const hostedZoneId = await this.resolveHostedZoneId(properties, logicalId, resourceType, void 0, { requireUnambiguousZoneName: true });
|
|
39182
39361
|
const recordName = properties["Name"];
|
|
39183
39362
|
const recordType = properties["Type"];
|
|
39184
39363
|
const compositeId = recordSetCompositeId(hostedZoneId, recordName, recordType);
|
|
@@ -39210,7 +39389,15 @@ async function createRecordSet(logicalId, resourceType, properties, mask) {
|
|
|
39210
39389
|
}
|
|
39211
39390
|
async function updateRecordSet(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
39212
39391
|
this.logger.debug(`Updating Route 53 record set ${logicalId}: ${physicalId}`);
|
|
39213
|
-
const
|
|
39392
|
+
const stateBorne = context?.replayingState === true || context?.desiredFromAwsReadback === true;
|
|
39393
|
+
refuseCfnUnresolvableZoneName(this, properties["HostedZoneName"], "Record set", logicalId, resourceType, physicalId, stateBorne);
|
|
39394
|
+
const recordedComposite = parseRecordSetCompositeId(physicalId);
|
|
39395
|
+
const hostedZoneId = stateBorne && recordedComposite && !zoneReferenceChanged(previousProperties, properties) && this.compositeAgreesWithTemplate(recordedComposite, previousProperties) ? recordedComposite.hostedZoneId : await this.resolveHostedZoneId(properties, logicalId, resourceType, physicalId, { requireUnambiguousZoneName: true });
|
|
39396
|
+
if (zoneReferenceChanged(previousProperties, properties)) {
|
|
39397
|
+
const parsed = parseRecordSetCompositeId(physicalId);
|
|
39398
|
+
const recordedZone = parsed && this.compositeAgreesWithTemplate(parsed, previousProperties) ? parsed.hostedZoneId : await recordedZoneForSwitch(this, previousProperties, logicalId, resourceType, physicalId, "Record set");
|
|
39399
|
+
if (bareHostedZoneId(recordedZone) !== bareHostedZoneId(hostedZoneId)) throw new ProvisioningError(`Record set ${logicalId}: the template's hosted zone (${hostedZoneId}) is not the one the record is in (${recordedZone}). Moving a record to another zone replaces it: name the new zone with the key the record already uses (HostedZoneId or HostedZoneName) so cdkd plans the replacement.`, resourceType, logicalId, physicalId);
|
|
39400
|
+
}
|
|
39214
39401
|
const recordName = properties["Name"];
|
|
39215
39402
|
const recordType = properties["Type"];
|
|
39216
39403
|
const compositeId = recordSetCompositeId(hostedZoneId, recordName, recordType);
|
|
@@ -39401,6 +39588,504 @@ function buildResourceRecordSet(properties) {
|
|
|
39401
39588
|
return recordSet;
|
|
39402
39589
|
}
|
|
39403
39590
|
|
|
39591
|
+
// src/provisioning/providers/route53/record-set-group-shape.ts
|
|
39592
|
+
const RECORD_SET_GROUP_TYPE = "AWS::Route53::RecordSetGroup";
|
|
39593
|
+
const RECORD_IDENTITY_FIELDS = [
|
|
39594
|
+
"Name",
|
|
39595
|
+
"Type",
|
|
39596
|
+
"SetIdentifier"
|
|
39597
|
+
];
|
|
39598
|
+
const RECORD_VALUE_FIELDS = [
|
|
39599
|
+
"TTL",
|
|
39600
|
+
"ResourceRecords",
|
|
39601
|
+
"AliasTarget",
|
|
39602
|
+
"Weight",
|
|
39603
|
+
"Region",
|
|
39604
|
+
"Failover",
|
|
39605
|
+
"MultiValueAnswer",
|
|
39606
|
+
"HealthCheckId",
|
|
39607
|
+
"GeoLocation",
|
|
39608
|
+
"GeoProximityLocation",
|
|
39609
|
+
"CidrRoutingConfig"
|
|
39610
|
+
];
|
|
39611
|
+
function recordSetGroupCompositeId(hostedZoneId, groupName) {
|
|
39612
|
+
return `${hostedZoneId}|${groupName}`;
|
|
39613
|
+
}
|
|
39614
|
+
const GROUP_NAME_MAX_LENGTH = 255;
|
|
39615
|
+
function generatedGroupName(logicalId) {
|
|
39616
|
+
return generateResourceName(logicalId, { maxLength: 255 });
|
|
39617
|
+
}
|
|
39618
|
+
function namesThisGroup(name, logicalId) {
|
|
39619
|
+
return name === logicalId || name.split("-").includes(logicalId);
|
|
39620
|
+
}
|
|
39621
|
+
function parseRecordSetGroupCompositeId(physicalId, logicalId) {
|
|
39622
|
+
const parts = physicalId.split("|");
|
|
39623
|
+
if (parts.length !== 2) return void 0;
|
|
39624
|
+
const [hostedZoneId, groupName] = parts;
|
|
39625
|
+
if (!hostedZoneId || !groupName || !namesThisGroup(groupName, logicalId)) return void 0;
|
|
39626
|
+
return {
|
|
39627
|
+
hostedZoneId,
|
|
39628
|
+
groupName
|
|
39629
|
+
};
|
|
39630
|
+
}
|
|
39631
|
+
function existingGroupName(physicalId, logicalId) {
|
|
39632
|
+
const parsed = parseRecordSetGroupCompositeId(physicalId, logicalId);
|
|
39633
|
+
if (parsed) return parsed.groupName;
|
|
39634
|
+
if (!physicalId.includes("|")) return physicalId;
|
|
39635
|
+
const parts = physicalId.split("|");
|
|
39636
|
+
return parts.length === 2 && parts[1] ? parts[1] : logicalId;
|
|
39637
|
+
}
|
|
39638
|
+
function groupRecordSets(properties) {
|
|
39639
|
+
const raw = properties?.["RecordSets"];
|
|
39640
|
+
if (raw === void 0 || raw === null) return { records: [] };
|
|
39641
|
+
if (!Array.isArray(raw)) return { refusal: "RecordSets is not a list" };
|
|
39642
|
+
const records = [];
|
|
39643
|
+
for (const [index, entry] of raw.entries()) {
|
|
39644
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return { refusal: `RecordSets[${index}] is not an object` };
|
|
39645
|
+
records.push(entry);
|
|
39646
|
+
}
|
|
39647
|
+
return { records };
|
|
39648
|
+
}
|
|
39649
|
+
function recordSetKey(record) {
|
|
39650
|
+
const comparable = (value) => typeof value === "string" && value !== "" && !value.includes("{{resolve:") && !isRedactedRecordedValue(value);
|
|
39651
|
+
const name = record["Name"];
|
|
39652
|
+
const type = record["Type"];
|
|
39653
|
+
const setIdentifier = record["SetIdentifier"];
|
|
39654
|
+
if (!comparable(name) || !comparable(type)) return void 0;
|
|
39655
|
+
if (setIdentifier !== void 0 && !comparable(setIdentifier)) return void 0;
|
|
39656
|
+
return JSON.stringify([
|
|
39657
|
+
normalizeRecordName(name),
|
|
39658
|
+
type,
|
|
39659
|
+
setIdentifier ?? ""
|
|
39660
|
+
]);
|
|
39661
|
+
}
|
|
39662
|
+
function groupZoneProperties(properties, records) {
|
|
39663
|
+
const zone = {};
|
|
39664
|
+
for (const key of ["HostedZoneId", "HostedZoneName"]) {
|
|
39665
|
+
let value = properties[key];
|
|
39666
|
+
for (const [index, record] of records.entries()) {
|
|
39667
|
+
const recordValue = record[key];
|
|
39668
|
+
if (recordValue === void 0) continue;
|
|
39669
|
+
if (value === void 0) {
|
|
39670
|
+
value = recordValue;
|
|
39671
|
+
continue;
|
|
39672
|
+
}
|
|
39673
|
+
if (JSON.stringify(recordValue) !== JSON.stringify(value)) return { refusal: `RecordSets[${index}].${key} differs from the ${key} the rest of the group uses; every record of a RecordSetGroup must be in one hosted zone` };
|
|
39674
|
+
}
|
|
39675
|
+
if (value !== void 0) zone[key] = value;
|
|
39676
|
+
}
|
|
39677
|
+
return { zone };
|
|
39678
|
+
}
|
|
39679
|
+
function recordBag(record) {
|
|
39680
|
+
const { HostedZoneId: _zoneId, HostedZoneName: _zoneName, ...rest } = record;
|
|
39681
|
+
return rest;
|
|
39682
|
+
}
|
|
39683
|
+
function groupRefusalError(message, logicalId, physicalId) {
|
|
39684
|
+
return new ProvisioningError(message, RECORD_SET_GROUP_TYPE, logicalId, physicalId);
|
|
39685
|
+
}
|
|
39686
|
+
function sameRecordSet(a, b) {
|
|
39687
|
+
const canonical = (value) => {
|
|
39688
|
+
if (Array.isArray(value)) return value.map(canonical);
|
|
39689
|
+
if (value === null || typeof value !== "object") return value;
|
|
39690
|
+
return Object.fromEntries(Object.keys(value).sort().map((k) => [k, canonical(value[k])]));
|
|
39691
|
+
};
|
|
39692
|
+
const spell = (r) => JSON.stringify(canonical({
|
|
39693
|
+
...r,
|
|
39694
|
+
Name: normalizeRecordName(r.Name ?? ""),
|
|
39695
|
+
...r.AliasTarget && { AliasTarget: {
|
|
39696
|
+
...r.AliasTarget,
|
|
39697
|
+
DNSName: normalizeRecordName(r.AliasTarget.DNSName ?? "")
|
|
39698
|
+
} }
|
|
39699
|
+
}));
|
|
39700
|
+
return spell(a) === spell(b);
|
|
39701
|
+
}
|
|
39702
|
+
const updateBatchClients = /* @__PURE__ */ new WeakMap();
|
|
39703
|
+
function updateBatchClient(provider) {
|
|
39704
|
+
let client = updateBatchClients.get(provider);
|
|
39705
|
+
if (!client) {
|
|
39706
|
+
client = withoutServerErrorRetries(new Route53Client({
|
|
39707
|
+
...ambientClientDefaults(),
|
|
39708
|
+
...provider.providerRegion ? { region: provider.providerRegion } : {}
|
|
39709
|
+
}));
|
|
39710
|
+
updateBatchClients.set(provider, client);
|
|
39711
|
+
}
|
|
39712
|
+
return client;
|
|
39713
|
+
}
|
|
39714
|
+
function isUnambiguousClientRefusal(error) {
|
|
39715
|
+
if (!(error instanceof Error)) return false;
|
|
39716
|
+
if (error.$fault !== "client") return false;
|
|
39717
|
+
return !hasReplayMayCollide(error);
|
|
39718
|
+
}
|
|
39719
|
+
function isRecordNotFoundRefusal(error) {
|
|
39720
|
+
return error instanceof Error && error.name === "InvalidChangeBatch" && /but it was not found/i.test(error.message);
|
|
39721
|
+
}
|
|
39722
|
+
|
|
39723
|
+
// src/provisioning/providers/route53/record-set-group.ts
|
|
39724
|
+
function listedRecords(properties) {
|
|
39725
|
+
const parsed = groupRecordSets(properties);
|
|
39726
|
+
return "refusal" in parsed ? [] : parsed.records;
|
|
39727
|
+
}
|
|
39728
|
+
function refuseCfnGroupZoneShape(provider, properties, records, logicalId, resourceType, physicalId, stateBorne) {
|
|
39729
|
+
const refuse = (message) => {
|
|
39730
|
+
if (stateBorne) provider.logger.warn(safeMsg`${message}. Proceeding for this state replay.`);
|
|
39731
|
+
else throw groupRefusalError(message, logicalId, physicalId);
|
|
39732
|
+
};
|
|
39733
|
+
const index = records.findIndex((record) => record["HostedZoneName"] !== void 0 || record["HostedZoneId"] !== void 0);
|
|
39734
|
+
if (index >= 0) refuse(`Record set group ${logicalId}: RecordSets[${index}] declares a hosted zone, which CloudFormation refuses as an unsupported property of a group's record; name the zone on the group`);
|
|
39735
|
+
const zoneKeys = ["HostedZoneId", "HostedZoneName"].filter((k) => properties[k] !== void 0);
|
|
39736
|
+
if (zoneKeys.length !== 1) refuse(`Record set group ${logicalId}: exactly one of HostedZoneId and HostedZoneName must be specified (the group names ${zoneKeys.length === 0 ? "neither" : "both"})`);
|
|
39737
|
+
const listed = properties["RecordSets"];
|
|
39738
|
+
if (listed === void 0 || listed === null || Array.isArray(listed) && listed.length === 0) refuse(`Record set group ${logicalId}: RecordSets cannot be empty`);
|
|
39739
|
+
refuseCfnUnresolvableZoneName(provider, properties["HostedZoneName"], "Record set group", logicalId, resourceType, physicalId, stateBorne);
|
|
39740
|
+
}
|
|
39741
|
+
function desiredGroup(properties, logicalId, physicalId) {
|
|
39742
|
+
const parsed = groupRecordSets(properties);
|
|
39743
|
+
if ("refusal" in parsed) throw groupRefusalError(`Record set group ${logicalId}: ${parsed.refusal}`, logicalId, physicalId);
|
|
39744
|
+
for (const [index, record] of parsed.records.entries()) if (recordSetKey(record) === void 0) throw groupRefusalError(`Record set group ${logicalId}: RecordSets[${index}] needs a plain string Name and Type (and SetIdentifier, when set) to be written`, logicalId, physicalId);
|
|
39745
|
+
const zone = groupZoneProperties(properties, parsed.records);
|
|
39746
|
+
if ("refusal" in zone) throw groupRefusalError(`Record set group ${logicalId}: ${zone.refusal}`, logicalId, physicalId);
|
|
39747
|
+
return {
|
|
39748
|
+
records: parsed.records,
|
|
39749
|
+
zone: zone.zone
|
|
39750
|
+
};
|
|
39751
|
+
}
|
|
39752
|
+
const groupSubject = {
|
|
39753
|
+
noun: "record set group",
|
|
39754
|
+
remedy: "set HostedZoneId explicitly"
|
|
39755
|
+
};
|
|
39756
|
+
async function createRecordSetGroup(logicalId, resourceType, properties, mask, replayingState = false) {
|
|
39757
|
+
this.logger.debug(safeMsg`Creating Route 53 record set group ${logicalId}`);
|
|
39758
|
+
refuseCfnGroupZoneShape(this, properties, listedRecords(properties), logicalId, resourceType, void 0, replayingState);
|
|
39759
|
+
const { records, zone } = desiredGroup(properties, logicalId, void 0);
|
|
39760
|
+
const hostedZoneId = await this.resolveHostedZoneId(zone, logicalId, resourceType, void 0, {
|
|
39761
|
+
requireUnambiguousZoneName: true,
|
|
39762
|
+
subject: groupSubject
|
|
39763
|
+
});
|
|
39764
|
+
const compositeId = recordSetGroupCompositeId(hostedZoneId, generatedGroupName(logicalId));
|
|
39765
|
+
if (records.length === 0) {
|
|
39766
|
+
this.logger.debug(safeMsg`Record set group ${logicalId} declares no records; nothing to create`);
|
|
39767
|
+
return {
|
|
39768
|
+
physicalId: compositeId,
|
|
39769
|
+
attributes: {}
|
|
39770
|
+
};
|
|
39771
|
+
}
|
|
39772
|
+
try {
|
|
39773
|
+
const comment = properties["Comment"];
|
|
39774
|
+
await this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
39775
|
+
HostedZoneId: hostedZoneId,
|
|
39776
|
+
ChangeBatch: {
|
|
39777
|
+
...typeof comment === "string" && comment ? { Comment: comment } : {},
|
|
39778
|
+
Changes: records.map((record) => ({
|
|
39779
|
+
Action: "CREATE",
|
|
39780
|
+
ResourceRecordSet: this.buildResourceRecordSet(recordBag(record))
|
|
39781
|
+
}))
|
|
39782
|
+
}
|
|
39783
|
+
}));
|
|
39784
|
+
this.logger.debug(safeMsg`Successfully created record set group ${logicalId}: ${compositeId}`);
|
|
39785
|
+
return {
|
|
39786
|
+
physicalId: compositeId,
|
|
39787
|
+
attributes: {}
|
|
39788
|
+
};
|
|
39789
|
+
} catch (error) {
|
|
39790
|
+
if (error instanceof ProvisioningError) throw error;
|
|
39791
|
+
const cause = error instanceof Error ? error : void 0;
|
|
39792
|
+
const cnameConflict = isCnameConflictRefusal(error);
|
|
39793
|
+
const wrapped = this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to create record set group ${logicalId}${cnameConflict ? CNAME_CONFLICT_COLLISION_NOTE : ""}: ${text}`, resourceType, logicalId, void 0, cause));
|
|
39794
|
+
throw cnameConflict ? markNameCollision(wrapped) : wrapped;
|
|
39795
|
+
}
|
|
39796
|
+
}
|
|
39797
|
+
async function existingGroupZone(physicalId, zone, logicalId, resourceType) {
|
|
39798
|
+
const parsed = parseRecordSetGroupCompositeId(physicalId, logicalId);
|
|
39799
|
+
if (parsed) return parsed.hostedZoneId;
|
|
39800
|
+
return this.resolveHostedZoneId(zone, logicalId, resourceType, physicalId, {
|
|
39801
|
+
requireUnambiguousZoneName: true,
|
|
39802
|
+
subject: groupSubject
|
|
39803
|
+
});
|
|
39804
|
+
}
|
|
39805
|
+
async function updateRecordSetGroup(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
39806
|
+
const progress = {
|
|
39807
|
+
sent: false,
|
|
39808
|
+
clientRefused: false
|
|
39809
|
+
};
|
|
39810
|
+
try {
|
|
39811
|
+
return await applyRecordSetGroupUpdate.call(this, logicalId, physicalId, resourceType, properties, previousProperties, context, progress);
|
|
39812
|
+
} catch (error) {
|
|
39813
|
+
const wroteNothing = !progress.sent || progress.clientRefused;
|
|
39814
|
+
if (error instanceof Error && wroteNothing && getPriorAttempts(logicalId)?.possiblyLanded() !== true) throw markRefusedBeforeApplying(error);
|
|
39815
|
+
throw error;
|
|
39816
|
+
}
|
|
39817
|
+
}
|
|
39818
|
+
async function applyRecordSetGroupUpdate(logicalId, physicalId, resourceType, properties, previousProperties, context, progress) {
|
|
39819
|
+
this.logger.debug(safeMsg`Updating Route 53 record set group ${logicalId}: ${physicalId}`);
|
|
39820
|
+
refuseCfnGroupZoneShape(this, properties, listedRecords(properties), logicalId, resourceType, physicalId, context?.replayingState === true || context?.desiredFromAwsReadback === true);
|
|
39821
|
+
const { records, zone } = desiredGroup(properties, logicalId, physicalId);
|
|
39822
|
+
const previous = groupRecordSets(previousProperties);
|
|
39823
|
+
if ("refusal" in previous) throw groupRefusalError(`Record set group ${logicalId}: the recorded ${previous.refusal}, so cdkd cannot tell which records to remove`, logicalId, physicalId);
|
|
39824
|
+
const previousByKey = /* @__PURE__ */ new Map();
|
|
39825
|
+
for (const [index, record] of previous.records.entries()) {
|
|
39826
|
+
const key = recordSetKey(record);
|
|
39827
|
+
if (key === void 0) throw groupRefusalError(`Record set group ${logicalId}: recorded RecordSets[${index}] has no readable Name / Type / SetIdentifier, so cdkd cannot tell which live record it is`, logicalId, physicalId);
|
|
39828
|
+
previousByKey.set(key, record);
|
|
39829
|
+
}
|
|
39830
|
+
const hostedZoneId = await existingGroupZone.call(this, physicalId, zone, logicalId, resourceType);
|
|
39831
|
+
const compositeId = recordSetGroupCompositeId(hostedZoneId, existingGroupName(physicalId, logicalId));
|
|
39832
|
+
const desiredZoneId = zone["HostedZoneId"];
|
|
39833
|
+
let desiredZone = typeof desiredZoneId === "string" ? desiredZoneId : void 0;
|
|
39834
|
+
const previousZone = groupZoneProperties(previousProperties, "refusal" in previous ? [] : previous.records);
|
|
39835
|
+
if (desiredZone === void 0 && typeof zone["HostedZoneName"] === "string" && !("refusal" in previousZone) && zoneReferenceChanged(previousZone.zone, zone)) desiredZone = await this.resolveHostedZoneId(zone, logicalId, resourceType, physicalId, {
|
|
39836
|
+
requireUnambiguousZoneName: true,
|
|
39837
|
+
subject: groupSubject
|
|
39838
|
+
});
|
|
39839
|
+
let recordedZone = hostedZoneId;
|
|
39840
|
+
if (!parseRecordSetGroupCompositeId(physicalId, logicalId) && !("refusal" in previousZone) && zoneReferenceChanged(previousZone.zone, zone)) recordedZone = await recordedZoneForSwitch(this, previousZone.zone, logicalId, resourceType, physicalId, "Record set group");
|
|
39841
|
+
if (desiredZone !== void 0 && bareHostedZoneId(desiredZone) !== bareHostedZoneId(recordedZone)) throw groupRefusalError(`Record set group ${logicalId}: the template's hosted zone differs from the one its records are in (${recordedZone}). Moving a group to another zone replaces it: name the new zone with the key the group already uses (HostedZoneId or HostedZoneName) so cdkd plans the replacement`, logicalId, physicalId);
|
|
39842
|
+
try {
|
|
39843
|
+
const desiredKeys = /* @__PURE__ */ new Set();
|
|
39844
|
+
const changes = [];
|
|
39845
|
+
for (const record of records) {
|
|
39846
|
+
const key = recordSetKey(record);
|
|
39847
|
+
desiredKeys.add(key);
|
|
39848
|
+
const desired = this.buildResourceRecordSet(recordBag(record));
|
|
39849
|
+
const recorded = previousByKey.get(key);
|
|
39850
|
+
if (recorded === void 0) {
|
|
39851
|
+
const live = await ownEarlierWriteMayHold(logicalId, key, desired, this) ? await this.findLiveRecordSet(hostedZoneId, recordBag(record)) : void 0;
|
|
39852
|
+
if (live && sameRecordSet(live, desired)) {
|
|
39853
|
+
this.logger.debug(safeMsg`Record set group ${logicalId}: an added record is already live with the desired values; not creating it again`);
|
|
39854
|
+
continue;
|
|
39855
|
+
}
|
|
39856
|
+
changes.push({
|
|
39857
|
+
Action: "CREATE",
|
|
39858
|
+
ResourceRecordSet: desired
|
|
39859
|
+
});
|
|
39860
|
+
continue;
|
|
39861
|
+
}
|
|
39862
|
+
const before = this.buildResourceRecordSet(recordBag(recorded));
|
|
39863
|
+
if (JSON.stringify(before) !== JSON.stringify(desired)) changes.push({
|
|
39864
|
+
Action: "UPSERT",
|
|
39865
|
+
ResourceRecordSet: desired
|
|
39866
|
+
});
|
|
39867
|
+
}
|
|
39868
|
+
for (const [key, recorded] of previousByKey) {
|
|
39869
|
+
if (desiredKeys.has(key)) continue;
|
|
39870
|
+
const live = await this.findLiveRecordSet(hostedZoneId, recordBag(recorded));
|
|
39871
|
+
if (live) changes.push({
|
|
39872
|
+
Action: "DELETE",
|
|
39873
|
+
ResourceRecordSet: live
|
|
39874
|
+
});
|
|
39875
|
+
else this.logger.warn(safeMsg`Record set group ${logicalId}: a record removed from the template was not found in ${hostedZoneId}; nothing was deleted for it`);
|
|
39876
|
+
}
|
|
39877
|
+
if (changes.length > 0) {
|
|
39878
|
+
const comment = properties["Comment"];
|
|
39879
|
+
progress.sent = true;
|
|
39880
|
+
await updateBatchClient(this).send(new ChangeResourceRecordSetsCommand({
|
|
39881
|
+
HostedZoneId: hostedZoneId,
|
|
39882
|
+
ChangeBatch: {
|
|
39883
|
+
...typeof comment === "string" && comment ? { Comment: comment } : {},
|
|
39884
|
+
Changes: [...changes.filter((c) => c.Action === "DELETE"), ...changes.filter((c) => c.Action !== "DELETE")]
|
|
39885
|
+
}
|
|
39886
|
+
}));
|
|
39887
|
+
}
|
|
39888
|
+
this.logger.debug(safeMsg`Successfully updated record set group ${logicalId}`);
|
|
39889
|
+
return {
|
|
39890
|
+
physicalId: compositeId,
|
|
39891
|
+
wasReplaced: false,
|
|
39892
|
+
attributes: {}
|
|
39893
|
+
};
|
|
39894
|
+
} catch (error) {
|
|
39895
|
+
if (error instanceof ProvisioningError) throw error;
|
|
39896
|
+
if (progress.sent) {
|
|
39897
|
+
if (isUnambiguousClientRefusal(error)) progress.clientRefused = true;
|
|
39898
|
+
else getPriorAttempts(logicalId)?.notePossiblyLanded();
|
|
39899
|
+
}
|
|
39900
|
+
const cause = error instanceof Error ? error : void 0;
|
|
39901
|
+
throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to update record set group ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
39902
|
+
}
|
|
39903
|
+
}
|
|
39904
|
+
async function ownEarlierWriteMayHold(logicalId, key, desired, provider) {
|
|
39905
|
+
const lookup = getPriorAttempts(logicalId);
|
|
39906
|
+
if (!lookup) return false;
|
|
39907
|
+
if (lookup.possiblyLanded()) return true;
|
|
39908
|
+
let bags;
|
|
39909
|
+
try {
|
|
39910
|
+
bags = await lookup.attempts();
|
|
39911
|
+
} catch {
|
|
39912
|
+
return false;
|
|
39913
|
+
}
|
|
39914
|
+
return bags.some((bag) => {
|
|
39915
|
+
const parsed = groupRecordSets(bag);
|
|
39916
|
+
if ("refusal" in parsed) return false;
|
|
39917
|
+
return parsed.records.some((r) => recordSetKey(r) === key && sameRecordSet(provider.buildResourceRecordSet(recordBag(r)), desired));
|
|
39918
|
+
});
|
|
39919
|
+
}
|
|
39920
|
+
async function deleteRecordSetGroup(logicalId, physicalId, resourceType, properties, context) {
|
|
39921
|
+
this.logger.debug(safeMsg`Deleting Route 53 record set group ${logicalId}: ${physicalId}`);
|
|
39922
|
+
if (!properties) throw groupRefusalError(`Properties required to delete record set group ${logicalId}`, logicalId, physicalId);
|
|
39923
|
+
const parsed = groupRecordSets(properties);
|
|
39924
|
+
if ("refusal" in parsed) throw groupRefusalError(`Record set group ${logicalId}: the recorded ${parsed.refusal}, so cdkd cannot tell which records to delete`, logicalId, physicalId);
|
|
39925
|
+
const records = parsed.records;
|
|
39926
|
+
for (const [index, record] of records.entries()) {
|
|
39927
|
+
if (recordSetKey(record) !== void 0) continue;
|
|
39928
|
+
const redactedSkip = redactedDeleteAddressSkip(this.logger, logicalId, "Route 53 record set group", redactedDeleteAddressFields(Object.fromEntries(RECORD_IDENTITY_FIELDS.map((f) => [f, record[f]]))));
|
|
39929
|
+
if (redactedSkip) return redactedSkip;
|
|
39930
|
+
throw groupRefusalError(`Record set group ${logicalId}: recorded RecordSets[${index}] has no readable Name / Type / SetIdentifier, so cdkd cannot tell which live record to delete`, logicalId, physicalId);
|
|
39931
|
+
}
|
|
39932
|
+
const zoneProps = groupZoneProperties(properties, records);
|
|
39933
|
+
if ("refusal" in zoneProps) throw groupRefusalError(`Record set group ${logicalId}: ${zoneProps.refusal}`, logicalId, physicalId);
|
|
39934
|
+
const alreadyGone = async () => {
|
|
39935
|
+
const clientRegion = await this.getClient().config.region();
|
|
39936
|
+
assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
39937
|
+
};
|
|
39938
|
+
let hostedZoneId;
|
|
39939
|
+
const composite = parseRecordSetGroupCompositeId(physicalId, logicalId);
|
|
39940
|
+
if (composite) hostedZoneId = composite.hostedZoneId;
|
|
39941
|
+
else {
|
|
39942
|
+
const redactedZoneSkip = redactedDeleteAddressSkip(this.logger, logicalId, "Route 53 record set group", redactedDeleteAddressFields({
|
|
39943
|
+
HostedZoneId: zoneProps.zone["HostedZoneId"],
|
|
39944
|
+
HostedZoneName: zoneProps.zone["HostedZoneName"]
|
|
39945
|
+
}));
|
|
39946
|
+
if (redactedZoneSkip) return redactedZoneSkip;
|
|
39947
|
+
try {
|
|
39948
|
+
hostedZoneId = await existingGroupZone.call(this, physicalId, zoneProps.zone, logicalId, resourceType);
|
|
39949
|
+
} catch (error) {
|
|
39950
|
+
if (error instanceof HostedZoneNameNotFoundError) {
|
|
39951
|
+
await alreadyGone();
|
|
39952
|
+
this.logger.warn(safeMsg`Hosted zone "${String(zoneProps.zone["HostedZoneName"])}" for record set group ${logicalId} (${physicalId}) no longer exists; treating its records as already deleted and dropping the group from state.`);
|
|
39953
|
+
return;
|
|
39954
|
+
}
|
|
39955
|
+
throw error;
|
|
39956
|
+
}
|
|
39957
|
+
}
|
|
39958
|
+
if (records.length === 0) return;
|
|
39959
|
+
try {
|
|
39960
|
+
const deletes = [];
|
|
39961
|
+
for (const record of records) {
|
|
39962
|
+
const bag = recordBag(record);
|
|
39963
|
+
const live = await this.findLiveRecordSet(hostedZoneId, bag);
|
|
39964
|
+
if (!live) {
|
|
39965
|
+
const redactedSkip = redactedDeleteAddressSkip(this.logger, logicalId, "Route 53 record set group", redactedDeleteAddressFields(Object.fromEntries(RECORD_VALUE_FIELDS.map((f) => [f, record[f]]))));
|
|
39966
|
+
if (redactedSkip) return redactedSkip;
|
|
39967
|
+
}
|
|
39968
|
+
deletes.push({
|
|
39969
|
+
record,
|
|
39970
|
+
set: live ?? this.buildResourceRecordSet(bag)
|
|
39971
|
+
});
|
|
39972
|
+
}
|
|
39973
|
+
const send = (sets) => this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
39974
|
+
HostedZoneId: hostedZoneId,
|
|
39975
|
+
ChangeBatch: { Changes: sets.map((set) => ({
|
|
39976
|
+
Action: "DELETE",
|
|
39977
|
+
ResourceRecordSet: set
|
|
39978
|
+
})) }
|
|
39979
|
+
}));
|
|
39980
|
+
const sendSettled = async (sets) => {
|
|
39981
|
+
try {
|
|
39982
|
+
await send(sets);
|
|
39983
|
+
} catch (error) {
|
|
39984
|
+
if (!isZoneDisabledForMutationError(error)) throw error;
|
|
39985
|
+
this.logger.info(safeMsg`Hosted zone ${hostedZoneId} is mid AcceleratedRecovery transition (marked disabled for mutation); waiting for it to settle before retrying delete of record set group ${logicalId}`);
|
|
39986
|
+
await this.waitForAcceleratedRecoveryMutable(hostedZoneId, logicalId, resourceType);
|
|
39987
|
+
await send(sets);
|
|
39988
|
+
}
|
|
39989
|
+
};
|
|
39990
|
+
try {
|
|
39991
|
+
await sendSettled(deletes.map((d) => d.set));
|
|
39992
|
+
} catch (error) {
|
|
39993
|
+
if (!isRecordNotFoundRefusal(error)) throw error;
|
|
39994
|
+
this.logger.debug(safeMsg`Record set group ${logicalId}: the batch delete named a record that is gone; deleting record by record`);
|
|
39995
|
+
for (const { set } of deletes) try {
|
|
39996
|
+
await sendSettled([set]);
|
|
39997
|
+
} catch (perRecordError) {
|
|
39998
|
+
if (!isRecordNotFoundRefusal(perRecordError)) throw perRecordError;
|
|
39999
|
+
await alreadyGone();
|
|
40000
|
+
}
|
|
40001
|
+
}
|
|
40002
|
+
this.logger.debug(safeMsg`Successfully deleted record set group ${logicalId}`);
|
|
40003
|
+
} catch (error) {
|
|
40004
|
+
if (error instanceof Error && error.name === "NoSuchHostedZone") {
|
|
40005
|
+
await alreadyGone();
|
|
40006
|
+
this.logger.debug(safeMsg`Hosted zone for record set group ${physicalId} does not exist, skipping deletion`);
|
|
40007
|
+
return;
|
|
40008
|
+
}
|
|
40009
|
+
if (error instanceof ProvisioningError) throw error;
|
|
40010
|
+
const cause = error instanceof Error ? error : void 0;
|
|
40011
|
+
throw this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete record set group ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
40012
|
+
}
|
|
40013
|
+
}
|
|
40014
|
+
async function readRecordSetGroup(physicalId, logicalId, properties) {
|
|
40015
|
+
const parsed = groupRecordSets(properties);
|
|
40016
|
+
if ("refusal" in parsed) return void 0;
|
|
40017
|
+
const zoneProps = groupZoneProperties(properties ?? {}, parsed.records);
|
|
40018
|
+
if ("refusal" in zoneProps) return void 0;
|
|
40019
|
+
let hostedZoneId;
|
|
40020
|
+
try {
|
|
40021
|
+
hostedZoneId = await existingGroupZone.call(this, physicalId, zoneProps.zone, logicalId, RECORD_SET_GROUP_TYPE);
|
|
40022
|
+
} catch {
|
|
40023
|
+
return;
|
|
40024
|
+
}
|
|
40025
|
+
const observed = [];
|
|
40026
|
+
for (const record of parsed.records) {
|
|
40027
|
+
const name = record["Name"];
|
|
40028
|
+
const type = record["Type"];
|
|
40029
|
+
if (typeof name !== "string" || typeof type !== "string") return void 0;
|
|
40030
|
+
const live = await this.readRecordSetAt({
|
|
40031
|
+
hostedZoneId,
|
|
40032
|
+
name,
|
|
40033
|
+
type
|
|
40034
|
+
}, recordBag(record));
|
|
40035
|
+
if (live === void 0 || live === RESOURCE_NOT_FOUND) return live;
|
|
40036
|
+
const { HostedZoneId: _zoneId, ...rest } = live;
|
|
40037
|
+
observed.push({
|
|
40038
|
+
...rest,
|
|
40039
|
+
...record["HostedZoneId"] !== void 0 ? { HostedZoneId: record["HostedZoneId"] } : {},
|
|
40040
|
+
...record["HostedZoneName"] !== void 0 ? { HostedZoneName: record["HostedZoneName"] } : {}
|
|
40041
|
+
});
|
|
40042
|
+
}
|
|
40043
|
+
return { RecordSets: observed };
|
|
40044
|
+
}
|
|
40045
|
+
async function importRecordSetGroup(input) {
|
|
40046
|
+
const known = input.knownPhysicalId;
|
|
40047
|
+
if (!known) return null;
|
|
40048
|
+
const adoptVerbatim = (reason) => {
|
|
40049
|
+
this.logger.warn(safeMsg`Record set group ${input.logicalId}: could not verify physical id '${known}' (${reason}). Adopting it as-is.`);
|
|
40050
|
+
return {
|
|
40051
|
+
physicalId: known,
|
|
40052
|
+
attributes: {}
|
|
40053
|
+
};
|
|
40054
|
+
};
|
|
40055
|
+
const knownComposite = parseRecordSetGroupCompositeId(known, input.logicalId);
|
|
40056
|
+
const decline = (reason) => {
|
|
40057
|
+
this.logger.warn(safeMsg`Record set group ${input.logicalId}: could not verify physical id '${known}' (${reason}). Not importing it.`);
|
|
40058
|
+
return null;
|
|
40059
|
+
};
|
|
40060
|
+
const unverified = (reason) => knownComposite ? decline(reason) : adoptVerbatim(reason);
|
|
40061
|
+
const parsed = groupRecordSets(input.properties);
|
|
40062
|
+
if ("refusal" in parsed) return unverified(parsed.refusal);
|
|
40063
|
+
const zoneProps = groupZoneProperties(input.properties, parsed.records);
|
|
40064
|
+
if ("refusal" in zoneProps) return unverified(zoneProps.refusal);
|
|
40065
|
+
let hostedZoneId;
|
|
40066
|
+
if (knownComposite) hostedZoneId = knownComposite.hostedZoneId;
|
|
40067
|
+
else try {
|
|
40068
|
+
hostedZoneId = await this.resolveHostedZoneId(zoneProps.zone, input.logicalId, input.resourceType, known, {
|
|
40069
|
+
requireUnambiguousZoneName: true,
|
|
40070
|
+
subject: groupSubject
|
|
40071
|
+
});
|
|
40072
|
+
} catch {
|
|
40073
|
+
return adoptVerbatim("the template does not unambiguously resolve to a hosted zone");
|
|
40074
|
+
}
|
|
40075
|
+
let observed;
|
|
40076
|
+
try {
|
|
40077
|
+
observed = await readRecordSetGroup.call(this, recordSetGroupCompositeId(hostedZoneId, existingGroupName(known, input.logicalId)), input.logicalId, input.properties);
|
|
40078
|
+
} catch (err) {
|
|
40079
|
+
const head = `Record set group ${input.logicalId}: verification of '${known}' failed: `;
|
|
40080
|
+
return unverified(`verification failed: ${this.warnFailureText(head, err, void 0).replace(/\.$/, "")}`);
|
|
40081
|
+
}
|
|
40082
|
+
if (!observed || observed === RESOURCE_NOT_FOUND) return unverified("not every record was found under the resolved hosted zone");
|
|
40083
|
+
return {
|
|
40084
|
+
physicalId: recordSetGroupCompositeId(hostedZoneId, existingGroupName(known, input.logicalId)),
|
|
40085
|
+
attributes: {}
|
|
40086
|
+
};
|
|
40087
|
+
}
|
|
40088
|
+
|
|
39404
40089
|
// src/provisioning/providers/route53/zone-config.ts
|
|
39405
40090
|
async function applyHostedZoneTags(zoneId, properties, logicalId, previousProperties, mask) {
|
|
39406
40091
|
const desiredRaw = properties["HostedZoneTags"];
|
|
@@ -39633,6 +40318,7 @@ async function readCurrentState$18(physicalId, _logicalId, resourceType, propert
|
|
|
39633
40318
|
switch (resourceType) {
|
|
39634
40319
|
case "AWS::Route53::HostedZone": return this.readHostedZone(physicalId, properties);
|
|
39635
40320
|
case "AWS::Route53::RecordSet": return this.readRecordSet(physicalId, properties);
|
|
40321
|
+
case "AWS::Route53::RecordSetGroup": return this.readRecordSetGroup(physicalId, _logicalId, properties);
|
|
39636
40322
|
default: return;
|
|
39637
40323
|
}
|
|
39638
40324
|
}
|
|
@@ -39787,6 +40473,7 @@ async function importImpl$20(input) {
|
|
|
39787
40473
|
switch (input.resourceType) {
|
|
39788
40474
|
case "AWS::Route53::HostedZone": return this.importHostedZone(input);
|
|
39789
40475
|
case "AWS::Route53::RecordSet": return this.importRecordSet(input);
|
|
40476
|
+
case "AWS::Route53::RecordSetGroup": return this.importRecordSetGroup(input);
|
|
39790
40477
|
default: return null;
|
|
39791
40478
|
}
|
|
39792
40479
|
}
|
|
@@ -39903,33 +40590,42 @@ var Route53Provider = class {
|
|
|
39903
40590
|
warnFailureText(head, error, mask) {
|
|
39904
40591
|
return warnFailureText.call(this, head, error, mask);
|
|
39905
40592
|
}
|
|
39906
|
-
handledProperties = /* @__PURE__ */ new Map([
|
|
39907
|
-
"
|
|
39908
|
-
|
|
39909
|
-
|
|
39910
|
-
|
|
39911
|
-
|
|
39912
|
-
|
|
39913
|
-
|
|
39914
|
-
|
|
39915
|
-
|
|
39916
|
-
"
|
|
39917
|
-
|
|
39918
|
-
|
|
39919
|
-
|
|
39920
|
-
|
|
39921
|
-
|
|
39922
|
-
|
|
39923
|
-
|
|
39924
|
-
|
|
39925
|
-
|
|
39926
|
-
|
|
39927
|
-
|
|
39928
|
-
|
|
39929
|
-
|
|
39930
|
-
|
|
39931
|
-
|
|
39932
|
-
|
|
40593
|
+
handledProperties = /* @__PURE__ */ new Map([
|
|
40594
|
+
["AWS::Route53::HostedZone", /* @__PURE__ */ new Set([
|
|
40595
|
+
"Name",
|
|
40596
|
+
"HostedZoneConfig",
|
|
40597
|
+
"HostedZoneTags",
|
|
40598
|
+
"VPCs",
|
|
40599
|
+
"QueryLoggingConfig",
|
|
40600
|
+
"HostedZoneFeatures",
|
|
40601
|
+
"DelegationSetId"
|
|
40602
|
+
])],
|
|
40603
|
+
["AWS::Route53::RecordSet", /* @__PURE__ */ new Set([
|
|
40604
|
+
"HostedZoneId",
|
|
40605
|
+
"HostedZoneName",
|
|
40606
|
+
"Name",
|
|
40607
|
+
"Type",
|
|
40608
|
+
"TTL",
|
|
40609
|
+
"ResourceRecords",
|
|
40610
|
+
"AliasTarget",
|
|
40611
|
+
"SetIdentifier",
|
|
40612
|
+
"Weight",
|
|
40613
|
+
"Region",
|
|
40614
|
+
"Failover",
|
|
40615
|
+
"MultiValueAnswer",
|
|
40616
|
+
"HealthCheckId",
|
|
40617
|
+
"Comment",
|
|
40618
|
+
"GeoLocation",
|
|
40619
|
+
"GeoProximityLocation",
|
|
40620
|
+
"CidrRoutingConfig"
|
|
40621
|
+
])],
|
|
40622
|
+
["AWS::Route53::RecordSetGroup", /* @__PURE__ */ new Set([
|
|
40623
|
+
"HostedZoneId",
|
|
40624
|
+
"HostedZoneName",
|
|
40625
|
+
"Comment",
|
|
40626
|
+
"RecordSets"
|
|
40627
|
+
])]
|
|
40628
|
+
]);
|
|
39933
40629
|
getClient() {
|
|
39934
40630
|
return getClient$8.call(this);
|
|
39935
40631
|
}
|
|
@@ -39966,8 +40662,8 @@ var Route53Provider = class {
|
|
|
39966
40662
|
getHostedZoneAttribute(physicalId, attributeName) {
|
|
39967
40663
|
return getHostedZoneAttribute.call(this, physicalId, attributeName);
|
|
39968
40664
|
}
|
|
39969
|
-
createRecordSet(logicalId, resourceType, properties, mask) {
|
|
39970
|
-
return createRecordSet.call(this, logicalId, resourceType, properties, mask);
|
|
40665
|
+
createRecordSet(logicalId, resourceType, properties, mask, replayingState) {
|
|
40666
|
+
return createRecordSet.call(this, logicalId, resourceType, properties, mask, replayingState);
|
|
39971
40667
|
}
|
|
39972
40668
|
updateRecordSet(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
39973
40669
|
return updateRecordSet.call(this, logicalId, physicalId, resourceType, properties, previousProperties, context);
|
|
@@ -39978,6 +40674,21 @@ var Route53Provider = class {
|
|
|
39978
40674
|
deleteRecordSet(logicalId, physicalId, resourceType, properties, context) {
|
|
39979
40675
|
return deleteRecordSet.call(this, logicalId, physicalId, resourceType, properties, context);
|
|
39980
40676
|
}
|
|
40677
|
+
createRecordSetGroup(logicalId, resourceType, properties, mask, replayingState) {
|
|
40678
|
+
return createRecordSetGroup.call(this, logicalId, resourceType, properties, mask, replayingState);
|
|
40679
|
+
}
|
|
40680
|
+
updateRecordSetGroup(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
40681
|
+
return updateRecordSetGroup.call(this, logicalId, physicalId, resourceType, properties, previousProperties, context);
|
|
40682
|
+
}
|
|
40683
|
+
deleteRecordSetGroup(logicalId, physicalId, resourceType, properties, context) {
|
|
40684
|
+
return deleteRecordSetGroup.call(this, logicalId, physicalId, resourceType, properties, context);
|
|
40685
|
+
}
|
|
40686
|
+
readRecordSetGroup(physicalId, logicalId, properties) {
|
|
40687
|
+
return readRecordSetGroup.call(this, physicalId, logicalId, properties);
|
|
40688
|
+
}
|
|
40689
|
+
importRecordSetGroup(input) {
|
|
40690
|
+
return importRecordSetGroup.call(this, input);
|
|
40691
|
+
}
|
|
39981
40692
|
waitForAcceleratedRecoveryFeatureSettled(zoneId, logicalId, resourceType, enabled, freshZone) {
|
|
39982
40693
|
return waitForAcceleratedRecoveryFeatureSettled.call(this, zoneId, logicalId, resourceType, enabled, freshZone);
|
|
39983
40694
|
}
|
|
@@ -63594,4 +64305,4 @@ var ACMCertificateProvider = class {
|
|
|
63594
64305
|
};
|
|
63595
64306
|
|
|
63596
64307
|
export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, AppConfigEnvironmentProvider, 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 };
|
|
63597
|
-
//# sourceMappingURL=provider-classes-
|
|
64308
|
+
//# sourceMappingURL=provider-classes-CzitNbPu.js.map
|