@cdkd/cli 0.366.2 → 0.366.3
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-BP4BAeN1.js → ambient-client-defaults-D4Iv5q9T.js} +7 -4
- package/dist/{ambient-client-defaults-BP4BAeN1.js.map → ambient-client-defaults-D4Iv5q9T.js.map} +1 -1
- package/dist/{asg-provider-Hhj0P6mp.js → asg-provider-C6ZZEfBX.js} +6 -6
- package/dist/{asg-provider-Hhj0P6mp.js.map → asg-provider-C6ZZEfBX.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{custom-resource-runtime-2FunsavP.js → custom-resource-runtime-BcjqJN8N.js} +6 -6
- package/dist/{custom-resource-runtime-2FunsavP.js.map → custom-resource-runtime-BcjqJN8N.js.map} +1 -1
- package/dist/{db-associated-roles-r-PenQj1.js → db-associated-roles-DllYmRoV.js} +2 -2
- package/dist/{db-associated-roles-r-PenQj1.js.map → db-associated-roles-DllYmRoV.js.map} +1 -1
- package/dist/{delete-started-CmhbQ1Pl.js → delete-started-B1_1Gx-5.js} +6 -6
- package/dist/{delete-started-CmhbQ1Pl.js.map → delete-started-B1_1Gx-5.js.map} +1 -1
- package/dist/{deploy-engine-Zi4lQPww.js → deploy-engine-Dtsub41u.js} +978 -413
- package/dist/deploy-engine-Dtsub41u.js.map +1 -0
- package/dist/{ec2-termination-protection-DbUAhJ8k.js → ec2-termination-protection-NjsX1wkX.js} +6 -6
- package/dist/{ec2-termination-protection-DbUAhJ8k.js.map → ec2-termination-protection-NjsX1wkX.js.map} +1 -1
- package/dist/{ecr-uri-D2I7XuY2.js → ecr-uri-oZsRnk-M.js} +2 -2
- package/dist/{ecr-uri-D2I7XuY2.js.map → ecr-uri-oZsRnk-M.js.map} +1 -1
- package/dist/{expected-bucket-owner-Bbo88Hgr.js → expected-bucket-owner-DyUXGJMw.js} +2 -2
- package/dist/{expected-bucket-owner-Bbo88Hgr.js.map → expected-bucket-owner-DyUXGJMw.js.map} +1 -1
- package/dist/{iam-role-provider-DvWL9ZdR.js → iam-role-provider-D_1oapA-.js} +77 -18
- package/dist/{iam-role-provider-DvWL9ZdR.js.map → iam-role-provider-D_1oapA-.js.map} +1 -1
- package/dist/{image-plan-BwTTXuNI.js → image-plan-BEvmQV_l.js} +9 -9
- package/dist/{image-plan-BwTTXuNI.js.map → image-plan-BEvmQV_l.js.map} +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-BO4LBqgc.js → logger-Dr5FQ5uQ.js} +2 -2
- package/dist/{logger-BO4LBqgc.js.map → logger-Dr5FQ5uQ.js.map} +1 -1
- package/dist/{neptune-provider-IM5gyPEm.js → neptune-provider-C0m4IHD7.js} +7 -7
- package/dist/{neptune-provider-IM5gyPEm.js.map → neptune-provider-C0m4IHD7.js.map} +1 -1
- package/dist/{program-DakFqlnv.js → program-DwAbyuS-.js} +1158 -1124
- package/dist/program-DwAbyuS-.js.map +1 -0
- package/dist/{provider-classes-Cf4oFWZo.js → provider-classes-Dc0pZOL3.js} +605 -484
- package/dist/provider-classes-Dc0pZOL3.js.map +1 -0
- package/dist/{rds-provider-BO3cRR3g.js → rds-provider-BH_C1IUh.js} +10 -10
- package/dist/{rds-provider-BO3cRR3g.js.map → rds-provider-BH_C1IUh.js.map} +1 -1
- package/dist/{read-replica-BxXAoL6p.js → read-replica-D8tp4_Dg.js} +3 -3
- package/dist/{read-replica-BxXAoL6p.js.map → read-replica-D8tp4_Dg.js.map} +1 -1
- package/dist/{replacement-rules-CeVpmoXW.js → replacement-rules-Cn95yn6B.js} +3 -3
- package/dist/{replacement-rules-CeVpmoXW.js.map → replacement-rules-Cn95yn6B.js.map} +1 -1
- package/dist/{resource-deadline-C6pfimDZ.js → resource-deadline-Bbcb2bjo.js} +4 -4
- package/dist/{resource-deadline-C6pfimDZ.js.map → resource-deadline-Bbcb2bjo.js.map} +1 -1
- package/dist/{restore-source-guard-OMAaTC2f.js → restore-source-guard-DA9TSeTJ.js} +4 -4
- package/dist/{restore-source-guard-OMAaTC2f.js.map → restore-source-guard-DA9TSeTJ.js.map} +1 -1
- package/dist/{run-cli-ZM-2X79-.js → run-cli-BU8F9JJg.js} +2 -2
- package/dist/{run-cli-ZM-2X79-.js.map → run-cli-BU8F9JJg.js.map} +1 -1
- package/dist/{settle-own-write-members-Nyh6snFh.js → settle-own-write-members-D-eXBnXf.js} +12 -15
- package/dist/{settle-own-write-members-Nyh6snFh.js.map → settle-own-write-members-D-eXBnXf.js.map} +1 -1
- package/dist/{version-8glqD9vK.js → version-DS_Jdkik.js} +2 -2
- package/dist/{version-8glqD9vK.js.map → version-DS_Jdkik.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-Zi4lQPww.js.map +0 -1
- package/dist/program-DakFqlnv.js.map +0 -1
- package/dist/provider-classes-Cf4oFWZo.js.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { _ as
|
|
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 { _ as verifyOwnIdentityBeforeUpdate, a as stackOwnHolders, b as IamCreateClientCache, c as clearOwnWriteRemovals, d as takeOwnWriteRemovals, f as InlinePolicyPrincipalMismatchError, g as verifyInlinePolicyPrincipals, h as compareMembershipWrites, i as isStackOwnHolder, l as recordOwnWriteRemoval, m as assertInlinePolicyAttachTargets, n as collectInlinePolicyNamesManagedBySiblings, o as planInlinePolicyNames, p as MANAGED_POLICY_OWNER, r as heldText, s as sameInlinePolicyName, t as IAMRoleProvider, u as restoreOwnWriteRemovals, v as iamEntityLeftByThisCreate, y as isEntityAlreadyExists } from "./iam-role-provider-D_1oapA-.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-Dr5FQ5uQ.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, I as isExplicitDenyError, K as wrapMaskedAwsError, M as explicitDenyPolicyKind, O as relayedNameCollision, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, 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-
|
|
5
|
-
import { $ as deleteAfterProtectionFlipWithFinalSnapshot, A as assertRegionMatch, B as refusalTypeShown, Bt as segmentAfterAnchor, C as isInsideWindow, D as withoutServerErrorRetries, Dt as holdsSecretDerivedEntry, E as setBounded, Et as diffPrincipalNames, F as isPlainImportJson, Ft as compositeIdSeparatorRefusal, Gt as maskDeep, H as resolveExplicitPhysicalId, Ht as createMaskedLogSinks, I as isPlainImportValue, It as compositeIdSkipResult, J as observeThenDisableProtection, K as deleteWithProtectionCompensation, Kt as maskerOrIdentity, L as isQuotableImportValue, Lt as logicalIdShown, M as holderRefusalRun, N as VALUE_NOT_SHOWN, Nt as canonicalizeRoute53QueryName, O as DriftReadRefusedError, Ot as onlySecretDerived, P as importRemedyCommand, Pt as compositeIdFormatMessage, Q as PROTECTION_FLIP_RETRY_WAIT_MS, R as normalizeAwsTagsToCfn, Rt as packCompositeId, S as createAttemptKey, Sn as injectiveKeyPrefix, St as startInterruptWatch, T as replayedSendWindow, Tt as SECRET_DERIVED_READ_LIVE, Ut as createMaskedRetryLogger, V as remedyLogicalId, Vt as stateOrphanRecordRemedy, W as markNotGone, Wt as isSecretDerivedValue, Xt as clearCreatedBeforeFailure, Y as rdsFamilyProtectionSite, Z as userPoolProtectionSite, _ as AMBIGUOUS_LATCH_TTL_MS, _t as renderDisableCommand, a as clearOnUpdateRemoval, at as isTerminalDeleteFailure, b as RecentIdSet, bn as withPasteableAwsProfile, c as removedTemplateKeys, ct as ElapsedBudget, en as isAuxiliaryFailure, ft as UNNAMEABLE_ID_CLAUSE, g as retractCreatedResource, gt as protectedReplacementAdvice, ht as pasteableAwsCommand, in as markSupersedesEarlierCreate, it as ProtectionFlipRegistry, j as holderRefusalMask, jt as recordedPrincipalsRepair, k as RESOURCE_NOT_FOUND, kt as readPrincipalLists, l as withRemovalDefaults, lt as ElapsedBudgetRegistry, m as reportCreatedResource, mt as isAwsCliLiteral, n as enclosingDeadlineRemainingMs, nn as markAuxiliaryFailure, nt as isTerminalDbWaitStatus, ot as protectionFlipKey, pt as WITHHELD_AWS_COMMAND, q as logGroupProtectionSite, qt as withDerivedNameMasks, rn as markCreatedBeforeFailure, t as enclosingDeadlineExpired, tt as isProceedDbStatus, v as AmbiguousCreateLatch, w as replayFollowedAmbiguousAttempt, x as ambiguousAttemptLead, xn as injectiveKey, xt as isInterruptedWaitError, y as CREATION_DATE_SKEW_MARGIN_MS, z as quotedRemedyLogicalId } from "./resource-deadline-
|
|
6
|
-
import { A as displayStackName, L as truncateCodePoints, 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 { Ct as RecordedIdentityMismatchError, Mt as identityTimestamp, Ot as recordedIdentityId, Rt as isoTimestampAttribute, St as RecordedIdentityError, bt as lookupEachName, gt as deniedIdentityReadRefusal, kt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted, vt as chunks, wt as assertRecordedIdentity, xt as withApiLimit, yt as isAccessDeniedError } from "./delete-started-
|
|
8
|
-
import { $ as effectiveInventoryItem, A as
|
|
9
|
-
import { $ as
|
|
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 { W as timePhase, _ as onlySecretReferencesDiffer, a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, f as markRefusedBeforeApplying, i as observeThenDisableInstanceApiTermination, j as withRetry, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedPerTypeResourceTimeoutMs, u as getPriorAttempts, v as unchangedBehindSecretReference } from "./ec2-termination-protection-
|
|
12
|
-
import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-
|
|
4
|
+
import { D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markRedactedCause, I as isExplicitDenyError, K as wrapMaskedAwsError, M as explicitDenyPolicyKind, O as relayedNameCollision, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, 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-D4Iv5q9T.js";
|
|
5
|
+
import { $ as deleteAfterProtectionFlipWithFinalSnapshot, A as assertRegionMatch, B as refusalTypeShown, Bt as segmentAfterAnchor, C as isInsideWindow, D as withoutServerErrorRetries, Dt as holdsSecretDerivedEntry, E as setBounded, Et as diffPrincipalNames, F as isPlainImportJson, Ft as compositeIdSeparatorRefusal, Gt as maskDeep, H as resolveExplicitPhysicalId, Ht as createMaskedLogSinks, I as isPlainImportValue, It as compositeIdSkipResult, J as observeThenDisableProtection, K as deleteWithProtectionCompensation, Kt as maskerOrIdentity, L as isQuotableImportValue, Lt as logicalIdShown, M as holderRefusalRun, N as VALUE_NOT_SHOWN, Nt as canonicalizeRoute53QueryName, O as DriftReadRefusedError, Ot as onlySecretDerived, P as importRemedyCommand, Pt as compositeIdFormatMessage, Q as PROTECTION_FLIP_RETRY_WAIT_MS, R as normalizeAwsTagsToCfn, Rt as packCompositeId, S as createAttemptKey, Sn as injectiveKeyPrefix, St as startInterruptWatch, T as replayedSendWindow, Tt as SECRET_DERIVED_READ_LIVE, Ut as createMaskedRetryLogger, V as remedyLogicalId, Vt as stateOrphanRecordRemedy, W as markNotGone, Wt as isSecretDerivedValue, Xt as clearCreatedBeforeFailure, Y as rdsFamilyProtectionSite, Z as userPoolProtectionSite, _ as AMBIGUOUS_LATCH_TTL_MS, _t as renderDisableCommand, a as clearOnUpdateRemoval, at as isTerminalDeleteFailure, b as RecentIdSet, bn as withPasteableAwsProfile, c as removedTemplateKeys, ct as ElapsedBudget, en as isAuxiliaryFailure, ft as UNNAMEABLE_ID_CLAUSE, g as retractCreatedResource, gt as protectedReplacementAdvice, ht as pasteableAwsCommand, in as markSupersedesEarlierCreate, it as ProtectionFlipRegistry, j as holderRefusalMask, jt as recordedPrincipalsRepair, k as RESOURCE_NOT_FOUND, kt as readPrincipalLists, l as withRemovalDefaults, lt as ElapsedBudgetRegistry, m as reportCreatedResource, mt as isAwsCliLiteral, n as enclosingDeadlineRemainingMs, nn as markAuxiliaryFailure, nt as isTerminalDbWaitStatus, ot as protectionFlipKey, pt as WITHHELD_AWS_COMMAND, q as logGroupProtectionSite, qt as withDerivedNameMasks, rn as markCreatedBeforeFailure, t as enclosingDeadlineExpired, tt as isProceedDbStatus, v as AmbiguousCreateLatch, w as replayFollowedAmbiguousAttempt, x as ambiguousAttemptLead, xn as injectiveKey, xt as isInterruptedWaitError, y as CREATION_DATE_SKEW_MARGIN_MS, z as quotedRemedyLogicalId } from "./resource-deadline-Bbcb2bjo.js";
|
|
6
|
+
import { A as displayStackName, L as truncateCodePoints, 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-DS_Jdkik.js";
|
|
7
|
+
import { Ct as RecordedIdentityMismatchError, Mt as identityTimestamp, Ot as recordedIdentityId, Rt as isoTimestampAttribute, St as RecordedIdentityError, _t as isPermissionDenial, bt as lookupEachName, gt as deniedIdentityReadRefusal, kt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted, vt as chunks, wt as assertRecordedIdentity, xt as withApiLimit, yt as isAccessDeniedError } from "./delete-started-B1_1Gx-5.js";
|
|
8
|
+
import { $ as effectiveInventoryItem, A as withRecordedCidrSpelling, B as LIFECYCLE_DEFAULT_STATUS, C as securityGroupReadbackDelays, D as stackIngressRuleHolder, E as singleSecurityGroupRuleId, F as clearLifecycleWritesOf, G as canonicalizeItemList, H as LIFECYCLE_RULE_PATH, I as lifecycleSettleTarget, J as lifecycleUsesFilterForm, K as effectiveLifecycleConfiguration, L as recordLifecycleWrite, M as sgRemovalRuleKey, N as sgRuleListMember, O as survivingRecordOfRuleId, P as LIFECYCLE_BASELINE_REREAD_DELAYS_MS, Q as effectiveIntelligentTieringItem, R as settleLifecycleRead, S as reconcileSgRules, T as sgRuleKey, U as LIFECYCLE_TAG_FILTERS_PATH, V as LIFECYCLE_FILTER_PATH, W as canonicalizeBlock, X as EVENTBRIDGE_CONFIG_PATH, Y as parseCfnTimestamp, Z as effectiveAnalyticsItem, _ as ingressRuleIdentity, a as refuseRevertRevokingSiblingRules, at as declaresBucketObjectLock, b as isResendableSocketFailure, c as siblingIdOwnedSgRules, ct as isPlainObject$6, d as authorizeDefinitelyNotApplied, dt as shownLifecycleRuleId, et as effectiveNotificationConfiguration, f as canonicalizeSgInlineRuleProtocols, g as flattenIpPermissions, h as descriptionKey, i as resolveSecretDerivedPrincipals, it as configItemId, j as markCopiesAgreed, k as tagListsMatch, l as SG_READBACK_RETRY_DELAY_MS, lt as manualBucketDeletionClause, m as comparableIngressIdentity, n as holdsUnprovenSecretPrincipalToken, nt as caughtErrorName, o as sgRuleDiffKey, ot as declaresNestedObjectLock, p as canonicalizeSgRuleProtocol, q as lifecycleRuleScope, r as isResolvableSecretPrincipalList, rt as coerceCfnNumber, s as readSgIngressById, st as describeValue$1, t as runDestroyForStack, tt as eventBridgeEnabledOf, u as SG_RULE_PAGE_SIZE, ut as mergeLegacySingular, v as isConnectTimeout, w as securityGroupRuleMatchesCfnIngress, x as narrowIngressIpProtocol, y as isDefaultEgressRule, z as takeLifecycleWrite } from "./program-DwAbyuS-.js";
|
|
9
|
+
import { $ as gsiUnsendableChangeRefusal, $s as s3BucketWebsiteUrl, $t as stripIndexContributorInsights, Ao as efsPolicyMatchesDeclared, At as recordTagWrite, B as declaredStreamTagsMember, Bn as getNestedRevertRun, Bt as readbackVectorIndexes, Cs as markWaitAbandoned, Ct as sseSpecificationToSend, Do as SNS_DEFAULT_POLICY_ID, Dt as clearTagWrites, Du as withoutSdkUnwiredProperties, Ea as replacedDeleteFailureVerdict, Ed as rewriteTemplateAssetReferences, Eo as OWN_WRITE_REREAD_DELAYS_MS, Et as TAGS_BASELINE_REREAD_DELAYS_MS, Fi as redactedDeleteAddressSkip, Fo as settleDeclaredMember, Ft as isTtlRateLimited, Fu as normalizeRecordName, G as streamDeclaresTags, Gc as APPSYNC_APIKEY_ARN_RESOURCE_PATH, Go as WaitConditionSignalStore, Gt as completeTableContributorInsightsBaseline, Hc as isWarmThroughputDecrease, Hr as SG_RULE_ID_PATTERN, Ht as vectorIndexesSettled, I as DynamoDBGlobalTableProvider, Io as warnUnsettledMember, It as planTimeToLive, Iu as planSubscriptionAttributes, J as streamTagsMatchDeclared, Jn as withNestedStackContext, Jr as canonicalizeIpv4Cidr, Jt as planContributorInsightsOp, K as streamMemberRefusals, Ko as classifyHandleUrl, Kr as sgProtocolKey, Kt as contributorInsightsRefusals, L as STREAM_POLICY_KEY, Lo as verbatimEchoDriftKeys, Lt as readTtlSpec, Lu as wireAttributeValue, Mi as REDACTED_DELETE_ADDRESS_SKIP_REASON, Mn as licensedNameHolder, Mo as memberReadFailure, Nc as LEGACY_HANDLE_ID_PREFIX, Ni as isRedactedRecordedValue, No as policyDocumentMatchesDeclared, Nt as takeTagWrite, Oo as declaredMemberDocument, Pc as isLegacyHandleId, Pi as redactedDeleteAddressFields, Po as reReadUntilSettled, Pt as isTtlAlreadyDisabled, Q as desiredIndexEntriesByName, Qs as s3BucketRegionalDomainName, Qt as reverseMapTableContributorInsights, R as STREAM_TAGS_KEY, Ro as attemptedPolicyDocument, Rt as sendTtlWaitingOutRateLimit, St as sseSpecificationRefusal, Tt as tableNameReleaseWait, U as reverseMapStreamPolicy, Uc as toCfnInteger, Un as revertNestedChildFromJournal, Ur as cfnIngressPortValue, Ut as vectorIndexesShapeDetail, V as planStreamMemberOps, Vr as withoutSiblingOwnedSgRules, Vt as vectorIndexesForCreate, W as streamDeclaresPolicy, Wc as toFiniteNumber, Wr as recordedSgRuleId, Wt as CONTRIBUTOR_INSIGHTS_KEY, X as declaresIndexList, Xa as secretNamedAttributeNamesOf, Xs as s3BucketDomainName, Xt as readContributorInsightsSpec, Y as canonicalizeStaleIndexDescription, Ys as s3BucketArn, Yt as planIndexContributorInsightsOps, Z as deletionProtectionRefusal, Zs as s3BucketDualStackDomainName, Zt as reverseMapIndexContributorInsights, _n as isTruthyCfnBoolean, _o as withoutSiblingOwned, _t as isTableName, ad as isAbsoluteAssetPath, al as passedParameterClassesOf, an as resolveDynamoDbDeleteBudgetClock, at as declaresWarmThroughput, bc as getAccountInfo, bo as getStackRecords, bs as withIndeterminateGuard, bt as pointInTimeRecoveryRefusal, cn as INDEX_SETTLE_POLL_INTERVAL_MS, ct as readbackWarmThroughput, dn as maskedLogger, dt as warmThroughputAlreadyMatches, ef as describeFileReadFailure, en as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, et as localSecondaryIndexesKey, eu as refuseMalformedNestedChildOutputs, fn as relayedIndexBusyDelete, fo as collectGroupsAddedBySiblings, fs as waitForLambdaFunctionActive, ft as KINESIS_DESTINATION_SETTLE_POLL_MS, gi as reserveStackCreateToken, gn as hasCdkAutoDeleteTag, go as withoutSiblingAttachedArns, gt as isPlainCapacityBlock, gu as withheldAccountClause, hn as S3_AUTO_DELETE_OBJECTS_TAG, ho as isStoredExpression, ht as hasUsableDeclaredCapacity, hu as accountArgs, id as findNestedTemplateTreeDefect, if as resolveAssemblyPath, in as deleteBudgetKey, it as coerceWarmThroughput, jo as lambdaPermissionMatchesDeclared, jt as settleWrittenTags, ko as declaredPolicyDocument, ks as isSettledInstanceState, kt as isDynamoDBTableArnIn, lc as parseWebACLArn, ln as TABLE_INDEX_NOUN, lt as sentWarmThroughputMembers, md as decodeListingKey, mi as earliestDefined, mn as ECR_AUTO_DELETE_IMAGES_TAG, mo as collectPrincipalsAttachingPolicy, ms as waitForGoneAfterDelete, mt as deleteTableRetryDelays, nd as stringifyValue, nn as beginDeleteWait, ns as getCurrentResourceSecrets, nt as reverseMapSecondaryIndex, od as listNestedTemplateRows, oi as calculateResourceDrift, on as resolveDynamoDbDeleteBudgetMs, ot as desiredBagIsInformative, pc as outputReferenceProvenanceOf, pn as waitForIndexesSettled, po as collectManagedPolicyArnsAttachedBySiblings, pt as KINESIS_DISABLE_PENDING_STATUSES, q as streamPolicyMatchesDeclared, qc as maskedSecretSegment, qi as getCurrentProducerRegions, qn as getCurrentNestedStackContext, qo as evaluateSignals, qr as canonicalizeIpv6Cidr, qt as indexDeclaresContributorInsights, rf as renderAssemblyPathEscape, rn as compensateRemovedDeletionProtection, rt as sameJsonValue, sd as renderNestedTemplateTreeDefect, sn as DELETE_INDEX_WAIT_PROCEED_NOTE, st as isRefusedWarmThroughput, t as DeployEngine, tf as displayAssemblyPath, tn as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, tt as projectIndexesOnto, un as deleteTableWithIndexBusyRetry, ut as trimUnsentWarmMembers, uu as refuseMalformedResourcesForDestroy, vi as acquireIdempotencyToken, vo as awaitInFlightSibling, vt as mapSSESpecification, wo as KMS_DEFAULT_KEY_POLICY_ID, wt as tableDeleteGoneWait, wu as findSdkUnwiredProperties, xt as readCapacityNumber, ys as deleteSkipReason, yt as maskLeafValue, z as declaredStreamPolicyMember, zo as policyContentKey, zr as siblingOwnedSgRuleIdentities, zt as planVectorIndexUpdates } from "./deploy-engine-Dtsub41u.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-DA9TSeTJ.js";
|
|
11
|
+
import { W as timePhase, _ as onlySecretReferencesDiffer, a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, f as markRefusedBeforeApplying, i as observeThenDisableInstanceApiTermination, j as withRetry, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedPerTypeResourceTimeoutMs, u as getPriorAttempts, v as unchangedBehindSecretReference } from "./ec2-termination-protection-NjsX1wkX.js";
|
|
12
|
+
import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-D-eXBnXf.js";
|
|
13
13
|
import { n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
|
|
14
14
|
import { f as ambientRegion, r as awsEndpointOverrideActive } from "./aws-client-defaults-DAebi99J.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-
|
|
16
|
-
import { RDSProvider } from "./rds-provider-
|
|
17
|
-
import { NeptuneProvider } from "./neptune-provider-
|
|
18
|
-
import { ASGProvider } from "./asg-provider-
|
|
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, c as parseLambdaFunctionAddress, 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-Cn95yn6B.js";
|
|
16
|
+
import { RDSProvider } from "./rds-provider-BH_C1IUh.js";
|
|
17
|
+
import { NeptuneProvider } from "./neptune-provider-C0m4IHD7.js";
|
|
18
|
+
import { ASGProvider } from "./asg-provider-C6ZZEfBX.js";
|
|
19
19
|
import { createHash, randomUUID } from "node:crypto";
|
|
20
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";
|
|
21
21
|
import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteConflictException, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetLoginProfileCommand, 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";
|
|
@@ -28,7 +28,7 @@ import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, De
|
|
|
28
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";
|
|
29
29
|
import { CreateArchiveCommand, CreateEventBusCommand, DeleteArchiveCommand, DeleteEventBusCommand, DeleteRuleCommand, DescribeArchiveCommand, 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, UpdateArchiveCommand, UpdateEventBusCommand } from "@aws-sdk/client-eventbridge";
|
|
30
30
|
import { CreateSecretCommand, DeleteSecretCommand, DescribeSecretCommand, RemoveRegionsFromReplicationCommand, ReplicateSecretToRegionsCommand, ResourceNotFoundException as ResourceNotFoundException$3, SecretsManagerClient, TagResourceCommand as TagResourceCommand$5, UntagResourceCommand as UntagResourceCommand$5, UpdateSecretCommand } from "@aws-sdk/client-secrets-manager";
|
|
31
|
-
import { AddTagsToResourceCommand, CreateAssociationCommand, DeleteAssociationCommand, DeleteParameterCommand, DescribeAssociationCommand, DescribeParametersCommand, GetParameterCommand, ListAssociationsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$2, ParameterNotFound, PutParameterCommand, RemoveTagsFromResourceCommand, SSMClient } from "@aws-sdk/client-ssm";
|
|
31
|
+
import { AddTagsToResourceCommand, CreateAssociationCommand, DeleteAssociationCommand, DeleteParameterCommand, DescribeAssociationCommand, DescribeDocumentCommand, DescribeParametersCommand, GetParameterCommand, ListAssociationsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$2, ParameterNotFound, PutParameterCommand, RemoveTagsFromResourceCommand, SSMClient } from "@aws-sdk/client-ssm";
|
|
32
32
|
import { CloudFrontClient, CreateCloudFrontOriginAccessIdentityCommand, CreateDistributionCommand, CreateDistributionWithTagsCommand, CreateOriginAccessControlCommand, DeleteCloudFrontOriginAccessIdentityCommand, DeleteDistributionCommand, DeleteOriginAccessControlCommand, DistributionAlreadyExists, GetCloudFrontOriginAccessIdentityCommand, GetDistributionCommand, GetDistributionConfigCommand, GetOriginAccessControlCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$3, NoSuchCloudFrontOriginAccessIdentity, NoSuchDistribution, NoSuchOriginAccessControl, NoSuchResource, TagResourceCommand as TagResourceCommand$6, UntagResourceCommand as UntagResourceCommand$6, UpdateCloudFrontOriginAccessIdentityCommand, UpdateDistributionCommand, UpdateOriginAccessControlCommand } from "@aws-sdk/client-cloudfront";
|
|
33
33
|
import { CloudWatchClient, DeleteAlarmsCommand, DeleteAnomalyDetectorCommand, DescribeAlarmsCommand, DescribeAnomalyDetectorsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$4, PutAnomalyDetectorCommand, PutMetricAlarmCommand, ResourceNotFoundException as ResourceNotFoundException$4, TagResourceCommand as TagResourceCommand$7, UntagResourceCommand as UntagResourceCommand$7 } from "@aws-sdk/client-cloudwatch";
|
|
34
34
|
import { AssociateKmsKeyCommand, CloudWatchLogsClient, CreateDeliveryCommand, CreateLogGroupCommand, DeleteDataProtectionPolicyCommand, DeleteDeliveryCommand, DeleteDeliveryDestinationCommand, DeleteDeliveryDestinationPolicyCommand, DeleteDeliverySourceCommand, DeleteIndexPolicyCommand, DeleteLogGroupCommand, DeleteRetentionPolicyCommand, DescribeDeliveriesCommand, DescribeIndexPoliciesCommand, DescribeLogGroupsCommand, DisassociateKmsKeyCommand, GetDataProtectionPolicyCommand, GetDeliveryCommand, GetDeliveryDestinationCommand, GetDeliveryDestinationPolicyCommand, GetDeliverySourceCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$5, PutBearerTokenAuthenticationCommand, PutDataProtectionPolicyCommand, PutDeliveryDestinationCommand, PutDeliveryDestinationPolicyCommand, PutDeliverySourceCommand, PutIndexPolicyCommand, PutLogGroupDeletionProtectionCommand, PutRetentionPolicyCommand, ResourceAlreadyExistsException, ResourceNotFoundException as ResourceNotFoundException$5, TagResourceCommand as TagResourceCommand$8, UntagResourceCommand as UntagResourceCommand$8, UpdateDeliveryConfigurationCommand } from "@aws-sdk/client-cloudwatch-logs";
|
|
@@ -46,7 +46,6 @@ import { AddTagsCommand, CreateListenerCommand, CreateLoadBalancerCommand, Creat
|
|
|
46
46
|
import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, DisabledException, EnableKeyCommand, EnableKeyRotationCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, KMSClient, ListAliasesCommand, ListKeysCommand, ListResourceTagsCommand, NotFoundException as NotFoundException$2, PutKeyPolicyCommand, ScheduleKeyDeletionCommand, TagResourceCommand as TagResourceCommand$12, UnsupportedOperationException, UntagResourceCommand as UntagResourceCommand$12, UpdateAliasCommand, UpdateKeyDescriptionCommand } from "@aws-sdk/client-kms";
|
|
47
47
|
import { isDeepStrictEqual } from "node:util";
|
|
48
48
|
import { AddTagsToResourceCommand as AddTagsToResourceCommand$2, CreateDBProxyCommand, CreateDBProxyEndpointCommand, DBProxyEndpointNotFoundFault, DBProxyNotFoundFault, DBProxyTargetGroupNotFoundFault, DBProxyTargetNotFoundFault, DeleteDBProxyCommand, DeleteDBProxyEndpointCommand, DeregisterDBProxyTargetsCommand, DescribeDBProxiesCommand, DescribeDBProxyEndpointsCommand, DescribeDBProxyTargetGroupsCommand, DescribeDBProxyTargetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$10, ModifyDBProxyCommand, ModifyDBProxyEndpointCommand, ModifyDBProxyTargetGroupCommand, RDSClient, RegisterDBProxyTargetsCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$2 } from "@aws-sdk/client-rds";
|
|
49
|
-
import { isIPv6 } from "node:net";
|
|
50
49
|
import { ListTagsForResourceCommand as ListTagsForResourceCommand$11, S3ControlClient, TagResourceCommand as TagResourceCommand$13, UntagResourceCommand as UntagResourceCommand$13 } from "@aws-sdk/client-s3-control";
|
|
51
50
|
import * as zlib from "node:zlib";
|
|
52
51
|
import { DeleteAlarmCommand, GetAlarmsCommand, LightsailClient, PutAlarmCommand } from "@aws-sdk/client-lightsail";
|
|
@@ -66,7 +65,7 @@ import { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, ListS
|
|
|
66
65
|
import { CreatePipeCommand, DeletePipeCommand, DescribePipeCommand, NotFoundException as NotFoundException$6, PipesClient, TagResourceCommand as TagResourceCommand$24, UntagResourceCommand as UntagResourceCommand$25, UpdatePipeCommand } from "@aws-sdk/client-pipes";
|
|
67
66
|
import { AccessPointAlreadyExists, AccessPointNotFound, CreateAccessPointCommand, CreateFileSystemCommand, CreateMountTargetCommand, DeleteAccessPointCommand, DeleteFileSystemCommand, DeleteFileSystemPolicyCommand, DeleteMountTargetCommand, DeleteReplicationConfigurationCommand, DescribeAccessPointsCommand, DescribeBackupPolicyCommand, DescribeFileSystemPolicyCommand, DescribeFileSystemsCommand, DescribeLifecycleConfigurationCommand, DescribeMountTargetSecurityGroupsCommand, DescribeMountTargetsCommand, DescribeReplicationConfigurationsCommand, EFSClient, FileSystemAlreadyExists, FileSystemNotFound, ModifyMountTargetSecurityGroupsCommand, MountTargetNotFound, PutBackupPolicyCommand, PutFileSystemPolicyCommand, PutLifecycleConfigurationCommand, TagResourceCommand as TagResourceCommand$25, UntagResourceCommand as UntagResourceCommand$26, UpdateFileSystemCommand, UpdateFileSystemProtectionCommand } from "@aws-sdk/client-efs";
|
|
68
67
|
import { AssociateFileSystemAliasesCommand, CreateFileSystemCommand as CreateFileSystemCommand$1, CreateFileSystemFromBackupCommand, DeleteFileSystemCommand as DeleteFileSystemCommand$1, DescribeFileSystemAliasesCommand, DescribeFileSystemsCommand as DescribeFileSystemsCommand$1, DisassociateFileSystemAliasesCommand, FSxClient, FileSystemNotFound as FileSystemNotFound$1, TagResourceCommand as TagResourceCommand$26, UntagResourceCommand as UntagResourceCommand$27, UpdateFileSystemCommand as UpdateFileSystemCommand$1 } from "@aws-sdk/client-fsx";
|
|
69
|
-
import { AddInstanceFleetCommand, AddInstanceGroupsCommand, AddTagsCommand as AddTagsCommand$1, DescribeClusterCommand, EMRClient, InvalidRequestException, ListClustersCommand, ListInstanceFleetsCommand, ListInstanceGroupsCommand, ModifyClusterCommand, ModifyInstanceFleetCommand, ModifyInstanceGroupsCommand, PutAutoScalingPolicyCommand, PutAutoTerminationPolicyCommand, PutManagedScalingPolicyCommand, RemoveAutoScalingPolicyCommand, RemoveAutoTerminationPolicyCommand, RemoveManagedScalingPolicyCommand, RemoveTagsCommand as RemoveTagsCommand$1, RunJobFlowCommand, SetTerminationProtectionCommand, SetUnhealthyNodeReplacementCommand, SetVisibleToAllUsersCommand, TerminateJobFlowsCommand } from "@aws-sdk/client-emr";
|
|
68
|
+
import { AddInstanceFleetCommand, AddInstanceGroupsCommand, AddTagsCommand as AddTagsCommand$1, DescribeClusterCommand, EMRClient, GetAutoTerminationPolicyCommand, GetManagedScalingPolicyCommand, InvalidRequestException, ListClustersCommand, ListInstanceFleetsCommand, ListInstanceGroupsCommand, ModifyClusterCommand, ModifyInstanceFleetCommand, ModifyInstanceGroupsCommand, PutAutoScalingPolicyCommand, PutAutoTerminationPolicyCommand, PutManagedScalingPolicyCommand, RemoveAutoScalingPolicyCommand, RemoveAutoTerminationPolicyCommand, RemoveManagedScalingPolicyCommand, RemoveTagsCommand as RemoveTagsCommand$1, RunJobFlowCommand, SetTerminationProtectionCommand, SetUnhealthyNodeReplacementCommand, SetVisibleToAllUsersCommand, TerminateJobFlowsCommand } from "@aws-sdk/client-emr";
|
|
70
69
|
import { CreateDeliveryStreamCommand, DeleteDeliveryStreamCommand, DescribeDeliveryStreamCommand, FirehoseClient, ListTagsForDeliveryStreamCommand, ResourceNotFoundException as ResourceNotFoundException$15, StartDeliveryStreamEncryptionCommand, StopDeliveryStreamEncryptionCommand, TagDeliveryStreamCommand, UntagDeliveryStreamCommand, UpdateDestinationCommand } from "@aws-sdk/client-firehose";
|
|
71
70
|
import { AddTagsCommand as AddTagsCommand$2, CloudTrailClient, CreateTrailCommand, DeleteTrailCommand, GetEventConfigurationCommand, GetEventSelectorsCommand, GetInsightSelectorsCommand, GetTrailCommand, GetTrailStatusCommand, InsightNotEnabledException, ListTagsCommand as ListTagsCommand$2, PutEventConfigurationCommand, PutEventSelectorsCommand, PutInsightSelectorsCommand, RemoveTagsCommand as RemoveTagsCommand$2, ResourceNotFoundException as ResourceNotFoundException$16, StartLoggingCommand, StopLoggingCommand, TrailNotFoundException, UpdateTrailCommand } from "@aws-sdk/client-cloudtrail";
|
|
72
71
|
import { BatchGetProjectsCommand, CodeBuildClient, CreateProjectCommand, CreateWebhookCommand, DeleteProjectCommand, DeleteWebhookCommand, ResourceNotFoundException as ResourceNotFoundException$17, UpdateProjectCommand, UpdateProjectVisibilityCommand, UpdateWebhookCommand } from "@aws-sdk/client-codebuild";
|
|
@@ -302,10 +301,10 @@ async function update$42(logicalId, physicalId, resourceType, properties, previo
|
|
|
302
301
|
kind: "role",
|
|
303
302
|
desired: new Set(newRoles || []),
|
|
304
303
|
recorded: new Set(oldRoles || []),
|
|
305
|
-
put: (name, policyName) => this.iamClient.send(new PutRolePolicyCommand({
|
|
304
|
+
put: (name, policyName, document) => this.iamClient.send(new PutRolePolicyCommand({
|
|
306
305
|
RoleName: name,
|
|
307
306
|
PolicyName: policyName,
|
|
308
|
-
PolicyDocument: policyDoc
|
|
307
|
+
PolicyDocument: document ?? policyDoc
|
|
309
308
|
})),
|
|
310
309
|
remove: (name, policyName) => this.iamClient.send(new DeleteRolePolicyCommand({
|
|
311
310
|
RoleName: name,
|
|
@@ -316,10 +315,10 @@ async function update$42(logicalId, physicalId, resourceType, properties, previo
|
|
|
316
315
|
kind: "group",
|
|
317
316
|
desired: new Set(newGroups || []),
|
|
318
317
|
recorded: new Set(oldGroups || []),
|
|
319
|
-
put: (name, policyName) => this.iamClient.send(new PutGroupPolicyCommand({
|
|
318
|
+
put: (name, policyName, document) => this.iamClient.send(new PutGroupPolicyCommand({
|
|
320
319
|
GroupName: name,
|
|
321
320
|
PolicyName: policyName,
|
|
322
|
-
PolicyDocument: policyDoc
|
|
321
|
+
PolicyDocument: document ?? policyDoc
|
|
323
322
|
})),
|
|
324
323
|
remove: (name, policyName) => this.iamClient.send(new DeleteGroupPolicyCommand({
|
|
325
324
|
GroupName: name,
|
|
@@ -330,10 +329,10 @@ async function update$42(logicalId, physicalId, resourceType, properties, previo
|
|
|
330
329
|
kind: "user",
|
|
331
330
|
desired: new Set(newUsers || []),
|
|
332
331
|
recorded: new Set(oldUsers || []),
|
|
333
|
-
put: (name, policyName) => this.iamClient.send(new PutUserPolicyCommand({
|
|
332
|
+
put: (name, policyName, document) => this.iamClient.send(new PutUserPolicyCommand({
|
|
334
333
|
UserName: name,
|
|
335
334
|
PolicyName: policyName,
|
|
336
|
-
PolicyDocument: policyDoc
|
|
335
|
+
PolicyDocument: document ?? policyDoc
|
|
337
336
|
})),
|
|
338
337
|
remove: (name, policyName) => this.iamClient.send(new DeleteUserPolicyCommand({
|
|
339
338
|
UserName: name,
|
|
@@ -382,9 +381,35 @@ async function update$42(logicalId, physicalId, resourceType, properties, previo
|
|
|
382
381
|
}
|
|
383
382
|
return verdict?.kind === "gone";
|
|
384
383
|
};
|
|
384
|
+
const respelled = oldPolicyNames.filter((name) => name !== newPolicyName && name.toLowerCase() === newPolicyName.toLowerCase());
|
|
385
|
+
const recordedDocument = previousProperties["PolicyDocument"];
|
|
386
|
+
const previousDoc = typeof recordedDocument === "string" ? recordedDocument : recordedDocument !== void 0 && recordedDocument !== null ? JSON.stringify(recordedDocument) : void 0;
|
|
385
387
|
for (const { kind, desired, recorded, put, remove } of kinds) {
|
|
388
|
+
const held = new Set([...recorded].map((name) => name.toLowerCase()));
|
|
386
389
|
for (const name of desired) {
|
|
387
|
-
|
|
390
|
+
const respell = held.has(name.toLowerCase()) ? respelled : [];
|
|
391
|
+
for (const policyName of respell) {
|
|
392
|
+
try {
|
|
393
|
+
await remove(name, policyName);
|
|
394
|
+
} catch (error) {
|
|
395
|
+
if (!(error instanceof NoSuchEntityException)) throw error;
|
|
396
|
+
}
|
|
397
|
+
log.debug(`Deleted inline policy ${v(policyName)} from ${kind} ${v(name)} before putting it as ${v(newPolicyName)}`);
|
|
398
|
+
}
|
|
399
|
+
try {
|
|
400
|
+
await put(name, newPolicyName);
|
|
401
|
+
} catch (error) {
|
|
402
|
+
const restoreName = respell[0];
|
|
403
|
+
if (restoreName !== void 0) {
|
|
404
|
+
let restored = false;
|
|
405
|
+
if (previousDoc !== void 0 && !holdsSecretDerivedEntry(recordedDocument)) try {
|
|
406
|
+
await put(name, restoreName, previousDoc);
|
|
407
|
+
restored = true;
|
|
408
|
+
} catch {}
|
|
409
|
+
if (!restored) log.warn(`Could not put inline policy ${v(restoreName)} back on ${kind} ${v(name)} after its re-put as ${v(newPolicyName)} failed; it is absent until the next deploy or ${proseQuoted(cdkdRemedy("cdkd drift", "--revert"))}`);
|
|
410
|
+
}
|
|
411
|
+
throw error;
|
|
412
|
+
}
|
|
388
413
|
log.debug(`Attached inline policy ${v(newPolicyName)} to ${kind} ${v(name)}`);
|
|
389
414
|
}
|
|
390
415
|
const stays = new Set([...desired].map((name) => name.toLowerCase()));
|
|
@@ -2935,16 +2960,47 @@ async function updateUserInlinePolicies(userName, newPolicies, oldPolicies, log,
|
|
|
2935
2960
|
const { value: v } = log;
|
|
2936
2961
|
const newMap = new Map((newPolicies || []).map((p) => [p.PolicyName, p.PolicyDocument]));
|
|
2937
2962
|
const oldMap = new Map((oldPolicies || []).map((p) => [p.PolicyName, p.PolicyDocument]));
|
|
2963
|
+
const plan = planInlinePolicyNames(newMap.keys(), oldMap.keys());
|
|
2938
2964
|
for (const [policyName, policyDoc] of newMap) {
|
|
2939
2965
|
const policyDocument = typeof policyDoc === "string" ? policyDoc : JSON.stringify(policyDoc);
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2966
|
+
const respelled = plan.respelled.filter((old) => sameInlinePolicyName(old, policyName));
|
|
2967
|
+
for (const old of respelled) {
|
|
2968
|
+
try {
|
|
2969
|
+
await this.iamClient.send(new DeleteUserPolicyCommand({
|
|
2970
|
+
UserName: userName,
|
|
2971
|
+
PolicyName: old
|
|
2972
|
+
}));
|
|
2973
|
+
} catch (error) {
|
|
2974
|
+
if (!(error instanceof NoSuchEntityException)) throw error;
|
|
2975
|
+
}
|
|
2976
|
+
log.debug(`Deleted inline policy ${v(old)} before putting it as ${v(policyName)}`);
|
|
2977
|
+
}
|
|
2978
|
+
try {
|
|
2979
|
+
await this.iamClient.send(new PutUserPolicyCommand({
|
|
2980
|
+
UserName: userName,
|
|
2981
|
+
PolicyName: policyName,
|
|
2982
|
+
PolicyDocument: policyDocument
|
|
2983
|
+
}));
|
|
2984
|
+
} catch (error) {
|
|
2985
|
+
const restoreName = respelled[0];
|
|
2986
|
+
if (restoreName !== void 0) {
|
|
2987
|
+
const oldDoc = oldMap.get(restoreName);
|
|
2988
|
+
let restored = false;
|
|
2989
|
+
if (oldDoc !== void 0 && oldDoc !== null && !holdsSecretDerivedEntry(oldDoc)) try {
|
|
2990
|
+
await this.iamClient.send(new PutUserPolicyCommand({
|
|
2991
|
+
UserName: userName,
|
|
2992
|
+
PolicyName: restoreName,
|
|
2993
|
+
PolicyDocument: typeof oldDoc === "string" ? oldDoc : JSON.stringify(oldDoc)
|
|
2994
|
+
}));
|
|
2995
|
+
restored = true;
|
|
2996
|
+
} catch {}
|
|
2997
|
+
if (!restored) log.warn(`Could not put inline policy ${v(restoreName)} back after its re-put as ${v(policyName)} failed; it is absent until the next deploy or ${proseQuoted(cdkdRemedy("cdkd drift", "--revert"))}`);
|
|
2998
|
+
}
|
|
2999
|
+
throw error;
|
|
3000
|
+
}
|
|
2945
3001
|
log.debug(`Updated inline policy ${v(policyName)} on user ${v(userName)}`);
|
|
2946
3002
|
}
|
|
2947
|
-
for (const policyName of
|
|
3003
|
+
for (const policyName of plan.removed) {
|
|
2948
3004
|
if (claimed?.("user", userName, policyName) === true) {
|
|
2949
3005
|
log.debug(`Kept inline policy ${v(policyName)} on user ${v(userName)}: another resource of this deploy or rollback wrote it`);
|
|
2950
3006
|
continue;
|
|
@@ -3471,16 +3527,47 @@ async function updateGroupInlinePolicies(groupName, newPolicies, oldPolicies, lo
|
|
|
3471
3527
|
const { value: v } = log;
|
|
3472
3528
|
const newMap = new Map((newPolicies || []).map((p) => [p.PolicyName, p.PolicyDocument]));
|
|
3473
3529
|
const oldMap = new Map((oldPolicies || []).map((p) => [p.PolicyName, p.PolicyDocument]));
|
|
3530
|
+
const plan = planInlinePolicyNames(newMap.keys(), oldMap.keys());
|
|
3474
3531
|
for (const [policyName, policyDoc] of newMap) {
|
|
3475
3532
|
const policyDocument = typeof policyDoc === "string" ? policyDoc : JSON.stringify(policyDoc);
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3533
|
+
const respelled = plan.respelled.filter((old) => sameInlinePolicyName(old, policyName));
|
|
3534
|
+
for (const old of respelled) {
|
|
3535
|
+
try {
|
|
3536
|
+
await this.iamClient.send(new DeleteGroupPolicyCommand({
|
|
3537
|
+
GroupName: groupName,
|
|
3538
|
+
PolicyName: old
|
|
3539
|
+
}));
|
|
3540
|
+
} catch (error) {
|
|
3541
|
+
if (!(error instanceof NoSuchEntityException)) throw error;
|
|
3542
|
+
}
|
|
3543
|
+
log.debug(`Deleted inline policy ${v(old)} before putting it as ${v(policyName)}`);
|
|
3544
|
+
}
|
|
3545
|
+
try {
|
|
3546
|
+
await this.iamClient.send(new PutGroupPolicyCommand({
|
|
3547
|
+
GroupName: groupName,
|
|
3548
|
+
PolicyName: policyName,
|
|
3549
|
+
PolicyDocument: policyDocument
|
|
3550
|
+
}));
|
|
3551
|
+
} catch (error) {
|
|
3552
|
+
const restoreName = respelled[0];
|
|
3553
|
+
if (restoreName !== void 0) {
|
|
3554
|
+
const oldDoc = oldMap.get(restoreName);
|
|
3555
|
+
let restored = false;
|
|
3556
|
+
if (oldDoc !== void 0 && oldDoc !== null && !holdsSecretDerivedEntry(oldDoc)) try {
|
|
3557
|
+
await this.iamClient.send(new PutGroupPolicyCommand({
|
|
3558
|
+
GroupName: groupName,
|
|
3559
|
+
PolicyName: restoreName,
|
|
3560
|
+
PolicyDocument: typeof oldDoc === "string" ? oldDoc : JSON.stringify(oldDoc)
|
|
3561
|
+
}));
|
|
3562
|
+
restored = true;
|
|
3563
|
+
} catch {}
|
|
3564
|
+
if (!restored) log.warn(`Could not put inline policy ${v(restoreName)} back after its re-put as ${v(policyName)} failed; it is absent until the next deploy or ${proseQuoted(cdkdRemedy("cdkd drift", "--revert"))}`);
|
|
3565
|
+
}
|
|
3566
|
+
throw error;
|
|
3567
|
+
}
|
|
3481
3568
|
log.debug(`Updated inline policy ${v(policyName)} on group ${v(groupName)}`);
|
|
3482
3569
|
}
|
|
3483
|
-
for (const policyName of
|
|
3570
|
+
for (const policyName of plan.removed) {
|
|
3484
3571
|
if (claimed?.("group", groupName, policyName) === true) {
|
|
3485
3572
|
log.debug(`Kept inline policy ${v(policyName)} on group ${v(groupName)}: another resource of this deploy or rollback wrote it`);
|
|
3486
3573
|
continue;
|
|
@@ -4235,16 +4322,16 @@ function abacStatusOf(properties) {
|
|
|
4235
4322
|
return properties["AbacStatus"] ?? "Disabled";
|
|
4236
4323
|
}
|
|
4237
4324
|
function metadataBag(value) {
|
|
4238
|
-
return isPlainObject$
|
|
4325
|
+
return isPlainObject$6(value) ? value : void 0;
|
|
4239
4326
|
}
|
|
4240
4327
|
function metadataConfigurationRefusal(value) {
|
|
4241
4328
|
if (value === void 0) return void 0;
|
|
4242
4329
|
const root = "MetadataConfiguration";
|
|
4243
|
-
if (!isPlainObject$
|
|
4330
|
+
if (!isPlainObject$6(value)) return `${root} must be an object`;
|
|
4244
4331
|
const journal = value["JournalTableConfiguration"];
|
|
4245
|
-
if (!isPlainObject$
|
|
4332
|
+
if (!isPlainObject$6(journal)) return `${root}.JournalTableConfiguration must be an object`;
|
|
4246
4333
|
const expiration = journal["RecordExpiration"];
|
|
4247
|
-
if (!isPlainObject$
|
|
4334
|
+
if (!isPlainObject$6(expiration)) return `${root}.JournalTableConfiguration.RecordExpiration must be an object`;
|
|
4248
4335
|
if (typeof expiration["Expiration"] !== "string") return `${root}.JournalTableConfiguration.RecordExpiration.Expiration must be a string`;
|
|
4249
4336
|
const days = expiration["Days"];
|
|
4250
4337
|
if (days !== void 0 && (days === "" || days === null || !Number.isInteger(Number(days)))) return `${root}.JournalTableConfiguration.RecordExpiration.Days must be an integer`;
|
|
@@ -4255,11 +4342,11 @@ function metadataConfigurationRefusal(value) {
|
|
|
4255
4342
|
];
|
|
4256
4343
|
for (const [member, table] of tables) {
|
|
4257
4344
|
if (table === void 0) continue;
|
|
4258
|
-
if (!isPlainObject$
|
|
4345
|
+
if (!isPlainObject$6(table)) return `${root}.${member} must be an object`;
|
|
4259
4346
|
if (member !== "JournalTableConfiguration" && typeof table["ConfigurationState"] !== "string") return `${root}.${member}.ConfigurationState must be a string`;
|
|
4260
4347
|
const encryption = table["EncryptionConfiguration"];
|
|
4261
4348
|
if (encryption === void 0) continue;
|
|
4262
|
-
if (!isPlainObject$
|
|
4349
|
+
if (!isPlainObject$6(encryption) || typeof encryption["SseAlgorithm"] !== "string") return `${root}.${member}.EncryptionConfiguration must be an object with an SseAlgorithm`;
|
|
4263
4350
|
}
|
|
4264
4351
|
}
|
|
4265
4352
|
function metadataEncryptionToSdk(table) {
|
|
@@ -5425,7 +5512,7 @@ async function applyLifecycleConfiguration(bucketName, lifecycleConfig, onUnusab
|
|
|
5425
5512
|
if (!(exp?.["Days"] !== void 0 || exp?.["Date"] !== void 0)) sdkRule.Expiration = { ExpiredObjectDeleteMarker: true };
|
|
5426
5513
|
else this.logger.warn(`Lifecycle rule ${shownLifecycleRuleId(maskDeep(rule["Id"], this.shownMask))} on ${this.shown(bucketName)} sets ExpiredObjectDeleteMarker alongside an expiration Days/Date; S3 forbids combining them, so the delete-marker cleanup was not applied.`);
|
|
5427
5514
|
}
|
|
5428
|
-
const nve = isPlainObject$
|
|
5515
|
+
const nve = isPlainObject$6(rule["NoncurrentVersionExpiration"]) ? rule["NoncurrentVersionExpiration"] : void 0;
|
|
5429
5516
|
const legacyNveDays = rule["NoncurrentVersionExpirationInDays"];
|
|
5430
5517
|
if (nve) sdkRule.NoncurrentVersionExpiration = {
|
|
5431
5518
|
NoncurrentDays: nve["NoncurrentDays"],
|
|
@@ -5450,7 +5537,7 @@ async function applyLifecycleConfiguration(bucketName, lifecycleConfig, onUnusab
|
|
|
5450
5537
|
const singularTransition = rule["Transition"];
|
|
5451
5538
|
const allTransitions = mergeLegacySingular(transitions, singularTransition, (sc) => this.logger.warn(`Lifecycle rule ${shownLifecycleRuleId(maskDeep(rule["Id"], this.shownMask))} on ${this.shown(bucketName)} declares both Transitions and the legacy Transition for storage class ${this.shown(sc)}; S3 rejects duplicates, so the legacy singular was ignored.`));
|
|
5452
5539
|
if (allTransitions.length > 0) sdkRule.Transitions = allTransitions.map(toSdkTransition);
|
|
5453
|
-
const abort = isPlainObject$
|
|
5540
|
+
const abort = isPlainObject$6(rule["AbortIncompleteMultipartUpload"]) ? rule["AbortIncompleteMultipartUpload"] : void 0;
|
|
5454
5541
|
if (abort) sdkRule.AbortIncompleteMultipartUpload = { DaysAfterInitiation: abort["DaysAfterInitiation"] };
|
|
5455
5542
|
const { prefix, tagFilters, sizeGt, sizeLt } = lifecycleRuleScope(rule);
|
|
5456
5543
|
const hasTags = tagFilters != null && tagFilters.length > 0;
|
|
@@ -5685,7 +5772,7 @@ function resolveS3BucketDestination(dest, destinationPath, onUnusable, maskSecre
|
|
|
5685
5772
|
throw new Error(message);
|
|
5686
5773
|
};
|
|
5687
5774
|
if (dest === void 0 || dest === null) return;
|
|
5688
|
-
if (!isPlainObject$
|
|
5775
|
+
if (!isPlainObject$6(dest)) return drop(`${destinationPath} must be an object (got ${describeValue$1(dest, maskSecrets)}) — check for an unresolved intrinsic or a mis-nested template value; the destination would otherwise be dropped from the request with no error`);
|
|
5689
5776
|
if (!dest["BucketArn"]) return drop(`${destinationPath} has no destination bucket (BucketArn) (got ${describeValue$1(dest, maskSecrets)}) — the request would be rejected by S3, or silently carry no destination`);
|
|
5690
5777
|
return dest;
|
|
5691
5778
|
}
|
|
@@ -7430,17 +7517,14 @@ async function settleBucketPolicyRead(first, read, options) {
|
|
|
7430
7517
|
const declared = options.context?.afterOwnWrite === true ? declaredPolicyDocument(options.properties) : void 0;
|
|
7431
7518
|
if (declared === void 0 || first === void 0) return first;
|
|
7432
7519
|
const asMember = (answer) => answer === RESOURCE_NOT_FOUND ? "absent" : answer === void 0 ? "failed" : { value: answer };
|
|
7433
|
-
const settled = await settleDeclaredMember(asMember(first), async () => asMember(await read()), (value) => policyDocumentMatchesDeclared(value["PolicyDocument"], declared), NO_BASELINE, options.delaysMs, () => warnUnsettledMember(options.logger, options.logicalId, "AWS::S3::BucketPolicy", "PolicyDocument"));
|
|
7520
|
+
const settled = await settleDeclaredMember(asMember(first), async () => asMember(await read()), (value) => policyDocumentMatchesDeclared(value["PolicyDocument"], declared, options.partition), NO_BASELINE, options.delaysMs, () => warnUnsettledMember(options.logger, options.logicalId, "AWS::S3::BucketPolicy", "PolicyDocument"));
|
|
7434
7521
|
if (typeof settled !== "object") return first;
|
|
7435
7522
|
return settled.value === NO_BASELINE ? void 0 : settled.value;
|
|
7436
7523
|
}
|
|
7437
7524
|
|
|
7438
|
-
// src/provisioning/providers/s3-bucket-policy-
|
|
7525
|
+
// src/provisioning/providers/s3-bucket-policy-oai.ts
|
|
7439
7526
|
const OAI_USER_ARN_RE = /^arn:aws[a-z-]*:iam::cloudfront:user\/CloudFront Origin Access Identity ([A-Z0-9]+)$/;
|
|
7440
7527
|
const IAM_UNIQUE_ID_RE = /^AIDA[A-Z0-9]{12,}$/;
|
|
7441
|
-
const oaiCanonicalUserIdCache = /* @__PURE__ */ new Map();
|
|
7442
|
-
const POLICY_RECHECKS = 3;
|
|
7443
|
-
const POLICY_RECHECK_DELAY_MS = 5e3;
|
|
7444
7528
|
function buildSiblingOaiCanonicalMap(context) {
|
|
7445
7529
|
const map = /* @__PURE__ */ new Map();
|
|
7446
7530
|
for (const sib of Object.values(context?.siblings ?? {})) {
|
|
@@ -7470,10 +7554,43 @@ function findTemplateCanonicalUser(awsStmt, templateStmts) {
|
|
|
7470
7554
|
const canonical = principal["CanonicalUser"];
|
|
7471
7555
|
return typeof canonical === "string" ? canonical : void 0;
|
|
7472
7556
|
}
|
|
7557
|
+
function hasTemplateMatchedUniqueId(policyDoc, templateProps) {
|
|
7558
|
+
const templateStmts = extractStatements(templateProps?.["PolicyDocument"]);
|
|
7559
|
+
if (templateStmts.length === 0) return false;
|
|
7560
|
+
return extractStatements(policyDoc).some((stmt) => {
|
|
7561
|
+
const principal = stmt["Principal"];
|
|
7562
|
+
if (!principal || typeof principal !== "object" || Array.isArray(principal)) return false;
|
|
7563
|
+
const aws = principal["AWS"];
|
|
7564
|
+
return typeof aws === "string" && IAM_UNIQUE_ID_RE.test(aws) && findTemplateCanonicalUser(stmt, templateStmts) !== void 0;
|
|
7565
|
+
});
|
|
7566
|
+
}
|
|
7567
|
+
const oaiCanonicalUserIdCache = /* @__PURE__ */ new Map();
|
|
7568
|
+
async function resolveOaiCanonicalUserId(oaiId, debug) {
|
|
7569
|
+
const cached = oaiCanonicalUserIdCache.get(oaiId);
|
|
7570
|
+
if (cached !== void 0) return cached;
|
|
7571
|
+
let canonical = null;
|
|
7572
|
+
try {
|
|
7573
|
+
canonical = (await getAwsClients().cloudFront.send(new GetCloudFrontOriginAccessIdentityCommand({ Id: oaiId }))).CloudFrontOriginAccessIdentity?.S3CanonicalUserId ?? null;
|
|
7574
|
+
} catch (err) {
|
|
7575
|
+
debug(`Could not resolve CloudFront OAI ${oaiId} canonical user id for bucket-policy drift normalization: ${describeAwsFailure(err).detail} — leaving the principal unchanged.`);
|
|
7576
|
+
canonical = null;
|
|
7577
|
+
}
|
|
7578
|
+
oaiCanonicalUserIdCache.set(oaiId, canonical);
|
|
7579
|
+
return canonical;
|
|
7580
|
+
}
|
|
7581
|
+
|
|
7582
|
+
// src/provisioning/providers/s3-bucket-policy-provider.ts
|
|
7583
|
+
const POLICY_RECHECKS = 3;
|
|
7584
|
+
const POLICY_RECHECK_DELAY_MS = 5e3;
|
|
7473
7585
|
var S3BucketPolicyProvider = class {
|
|
7474
7586
|
s3Client;
|
|
7475
7587
|
logger = getLogger().child("S3BucketPolicyProvider");
|
|
7476
7588
|
ownWriteRereadDelaysMs = OWN_WRITE_REREAD_DELAYS_MS;
|
|
7589
|
+
transientUniqueIdRereadDelaysMs = [
|
|
7590
|
+
2e3,
|
|
7591
|
+
3e3,
|
|
7592
|
+
4e3
|
|
7593
|
+
];
|
|
7477
7594
|
sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7478
7595
|
handledProperties = /* @__PURE__ */ new Map([["AWS::S3::BucketPolicy", /* @__PURE__ */ new Set(["Bucket", "PolicyDocument"])]]);
|
|
7479
7596
|
constructor() {
|
|
@@ -7634,7 +7751,8 @@ var S3BucketPolicyProvider = class {
|
|
|
7634
7751
|
refuse(`cdkd does not overwrite it: PutBucketPolicy replaces the whole policy, so the statements its owner attached (a log-delivery service's grant, for example) would be dropped, and CloudFormation refuses this create the same way. Nothing was sent. Either remove the existing policy if nothing relies on it ('aws s3api delete-bucket-policy --bucket ${bucketArg}')${stackName !== void 0 && stackName.includes("~") ? "" : `, or merge its statements into this resource's PolicyDocument and adopt it into the stack with ${proseQuoted(importRemedyCommand(stackName, `${remedyLogicalId(logicalId)}=${bucketArg}`))}`}, then re-deploy.`);
|
|
7635
7752
|
}
|
|
7636
7753
|
async isOwnLeftover(logicalId, bucketName, policyDoc, livePolicy, ownAttemptMayHaveLanded, lookup, bucketShown, mask) {
|
|
7637
|
-
|
|
7754
|
+
const partition = await this.bucketPartition();
|
|
7755
|
+
if (ownAttemptMayHaveLanded && await this.livePolicyKey(livePolicy, policyDoc, true, partition) === policyContentKey(policyDoc, partition)) {
|
|
7638
7756
|
this.logger.debug(safeMsg`S3 bucket policy ${logicalId}: an earlier attempt of this create attached the policy; re-sending it`);
|
|
7639
7757
|
return true;
|
|
7640
7758
|
}
|
|
@@ -7649,21 +7767,21 @@ var S3BucketPolicyProvider = class {
|
|
|
7649
7767
|
for (const bag of attempts) {
|
|
7650
7768
|
const attempted = sentPolicyDocument(bag["PolicyDocument"]);
|
|
7651
7769
|
if (bag["Bucket"] !== bucketName || attempted == null) continue;
|
|
7652
|
-
if (await this.livePolicyKey(livePolicy, attempted) === policyContentKey(attempted)) {
|
|
7770
|
+
if (await this.livePolicyKey(livePolicy, attempted, false, partition) === policyContentKey(attempted, partition)) {
|
|
7653
7771
|
this.logger.info(safeMsg`S3 bucket policy ${logicalId}: the policy on bucket ${bucketShown} is the one this stack's rollback journal shows an earlier deploy of it attempted; replacing it`);
|
|
7654
7772
|
return true;
|
|
7655
7773
|
}
|
|
7656
7774
|
}
|
|
7657
7775
|
return false;
|
|
7658
7776
|
}
|
|
7659
|
-
async livePolicyKey(livePolicy, reference) {
|
|
7777
|
+
async livePolicyKey(livePolicy, reference, afterOwnWrite, partition) {
|
|
7660
7778
|
let live;
|
|
7661
7779
|
let ref = reference;
|
|
7662
7780
|
try {
|
|
7663
7781
|
live = JSON.parse(livePolicy);
|
|
7664
7782
|
if (typeof ref === "string") ref = JSON.parse(ref);
|
|
7665
7783
|
} catch {
|
|
7666
|
-
return policyContentKey(livePolicy);
|
|
7784
|
+
return policyContentKey(livePolicy, partition);
|
|
7667
7785
|
}
|
|
7668
7786
|
const siblings = {};
|
|
7669
7787
|
for (const [id, record] of getStackRecords()?.live() ?? []) siblings[id] = {
|
|
@@ -7672,8 +7790,11 @@ var S3BucketPolicyProvider = class {
|
|
|
7672
7790
|
properties: {},
|
|
7673
7791
|
...record.attributes !== void 0 && { attributes: record.attributes }
|
|
7674
7792
|
};
|
|
7675
|
-
await this.normalizeOaiPrincipals(live, { PolicyDocument: ref }, { siblings });
|
|
7676
|
-
return policyContentKey(live);
|
|
7793
|
+
await this.normalizeOaiPrincipals(live, { PolicyDocument: ref }, { siblings }, afterOwnWrite);
|
|
7794
|
+
return policyContentKey(live, partition);
|
|
7795
|
+
}
|
|
7796
|
+
async bucketPartition() {
|
|
7797
|
+
return derivePartitionAndUrlSuffix(await this.s3Client.config.region()).partition;
|
|
7677
7798
|
}
|
|
7678
7799
|
wrapOperationError(operation, logicalId, resourceType, physicalId, error, maskSecrets) {
|
|
7679
7800
|
const mask = maskSecrets ?? ((t) => t);
|
|
@@ -7693,9 +7814,28 @@ var S3BucketPolicyProvider = class {
|
|
|
7693
7814
|
properties,
|
|
7694
7815
|
context,
|
|
7695
7816
|
delaysMs: this.ownWriteRereadDelaysMs,
|
|
7817
|
+
partition: context?.afterOwnWrite === true ? await this.bucketPartition() : void 0,
|
|
7696
7818
|
logger: this.logger
|
|
7697
7819
|
};
|
|
7698
|
-
|
|
7820
|
+
let first = await read();
|
|
7821
|
+
if (context?.afterOwnWrite !== true) first = await this.outwaitTransientUniqueId(first, read, properties);
|
|
7822
|
+
return settleBucketPolicyRead(first, read, options);
|
|
7823
|
+
}
|
|
7824
|
+
async outwaitTransientUniqueId(first, read, properties) {
|
|
7825
|
+
let answer = first;
|
|
7826
|
+
for (const delayMs of this.transientUniqueIdRereadDelaysMs) {
|
|
7827
|
+
if (typeof answer !== "object" || !hasTemplateMatchedUniqueId(answer["PolicyDocument"], properties)) return answer;
|
|
7828
|
+
await this.sleep(delayMs);
|
|
7829
|
+
let next;
|
|
7830
|
+
try {
|
|
7831
|
+
next = await read();
|
|
7832
|
+
} catch {
|
|
7833
|
+
return answer;
|
|
7834
|
+
}
|
|
7835
|
+
if (next === void 0) return answer;
|
|
7836
|
+
answer = next;
|
|
7837
|
+
}
|
|
7838
|
+
return answer;
|
|
7699
7839
|
}
|
|
7700
7840
|
async readPolicyOnce(physicalId, properties, context) {
|
|
7701
7841
|
let policyJson;
|
|
@@ -7718,11 +7858,11 @@ var S3BucketPolicyProvider = class {
|
|
|
7718
7858
|
result["PolicyDocument"] = policyJson;
|
|
7719
7859
|
return result;
|
|
7720
7860
|
}
|
|
7721
|
-
await this.normalizeOaiPrincipals(policyDoc, properties, context);
|
|
7861
|
+
await this.normalizeOaiPrincipals(policyDoc, properties, context, context?.afterOwnWrite === true);
|
|
7722
7862
|
result["PolicyDocument"] = policyDoc;
|
|
7723
7863
|
return result;
|
|
7724
7864
|
}
|
|
7725
|
-
async normalizeOaiPrincipals(policyDoc, templateProps, context) {
|
|
7865
|
+
async normalizeOaiPrincipals(policyDoc, templateProps, context, afterOwnWrite) {
|
|
7726
7866
|
const stmts = extractStatements(policyDoc);
|
|
7727
7867
|
if (stmts.length === 0) return;
|
|
7728
7868
|
const templateStmts = extractStatements(templateProps?.["PolicyDocument"]);
|
|
@@ -7735,29 +7875,16 @@ var S3BucketPolicyProvider = class {
|
|
|
7735
7875
|
const arnMatch = OAI_USER_ARN_RE.exec(awsPrincipal);
|
|
7736
7876
|
if (arnMatch) {
|
|
7737
7877
|
const oaiId = arnMatch[1];
|
|
7738
|
-
const canonical = siblingCanonicalById.get(oaiId) ?? await
|
|
7878
|
+
const canonical = siblingCanonicalById.get(oaiId) ?? await resolveOaiCanonicalUserId(oaiId, (message) => this.logger.debug(message));
|
|
7739
7879
|
if (canonical) stmt["Principal"] = { CanonicalUser: canonical };
|
|
7740
7880
|
continue;
|
|
7741
7881
|
}
|
|
7742
|
-
if (IAM_UNIQUE_ID_RE.test(awsPrincipal)) {
|
|
7882
|
+
if (afterOwnWrite && IAM_UNIQUE_ID_RE.test(awsPrincipal)) {
|
|
7743
7883
|
const tmplCanonical = findTemplateCanonicalUser(stmt, templateStmts);
|
|
7744
7884
|
if (tmplCanonical) stmt["Principal"] = { CanonicalUser: tmplCanonical };
|
|
7745
7885
|
}
|
|
7746
7886
|
}
|
|
7747
7887
|
}
|
|
7748
|
-
async resolveOaiCanonicalUserId(oaiId) {
|
|
7749
|
-
const cached = oaiCanonicalUserIdCache.get(oaiId);
|
|
7750
|
-
if (cached !== void 0) return cached;
|
|
7751
|
-
let canonical = null;
|
|
7752
|
-
try {
|
|
7753
|
-
canonical = (await getAwsClients().cloudFront.send(new GetCloudFrontOriginAccessIdentityCommand({ Id: oaiId }))).CloudFrontOriginAccessIdentity?.S3CanonicalUserId ?? null;
|
|
7754
|
-
} catch (err) {
|
|
7755
|
-
this.logger.debug(`Could not resolve CloudFront OAI ${oaiId} canonical user id for bucket-policy drift normalization: ${describeAwsFailure(err).detail} — leaving the principal unchanged.`);
|
|
7756
|
-
canonical = null;
|
|
7757
|
-
}
|
|
7758
|
-
oaiCanonicalUserIdCache.set(oaiId, canonical);
|
|
7759
|
-
return canonical;
|
|
7760
|
-
}
|
|
7761
7888
|
async import(input) {
|
|
7762
7889
|
if (input.knownPhysicalId && isS3BucketName(input.knownPhysicalId)) return {
|
|
7763
7890
|
physicalId: input.knownPhysicalId,
|
|
@@ -8214,7 +8341,8 @@ var SQSQueuePolicyProvider = class {
|
|
|
8214
8341
|
leftInPlace: QUEUE_POLICY_NOT_COMPARED_LEFT_REASON
|
|
8215
8342
|
};
|
|
8216
8343
|
}
|
|
8217
|
-
const
|
|
8344
|
+
const sent = sentPolicyDocument(attempted.document);
|
|
8345
|
+
const sqsRegion = await this.sqsClient.config.region();
|
|
8218
8346
|
const fresh = new Set((context.writtenThisRun ?? []).flatMap((r) => r.resourceType === resourceType && typeof r.physicalId === "string" ? [...recordedQueues(r.physicalId, r.attributes !== null && typeof r.attributes === "object" ? r.attributes : void 0), ...listedQueues(r.properties !== null && typeof r.properties === "object" ? r.properties : {})] : []));
|
|
8219
8347
|
let unreadable = false;
|
|
8220
8348
|
let mismatched = false;
|
|
@@ -8232,7 +8360,7 @@ var SQSQueuePolicyProvider = class {
|
|
|
8232
8360
|
} else if (current.kind === "unreadable") {
|
|
8233
8361
|
unreadable = true;
|
|
8234
8362
|
this.logger.warn(safeMsg`Could not read the policy of queue ${queueUrl} (${current.reason}), so it is not cleared: it may still carry the policy of ${logicalId}.`);
|
|
8235
|
-
} else if (current.kind === "none" || policyContentKey(current.policy) ===
|
|
8363
|
+
} else if (current.kind === "none" || policyContentKey(current.policy, queuePartition(queueUrl, sqsRegion)) === policyContentKey(sent, queuePartition(queueUrl, sqsRegion))) try {
|
|
8236
8364
|
await this.clearQueuePolicy(queueUrl, resourceType, logicalId, context.expectedRegion);
|
|
8237
8365
|
} catch (error) {
|
|
8238
8366
|
if (error instanceof ProvisioningError) throw error;
|
|
@@ -8425,6 +8553,10 @@ function policyReference(document) {
|
|
|
8425
8553
|
if (typeof document === "string" && document.length > 0) return canonicalPolicy$1(document);
|
|
8426
8554
|
if (document !== null && typeof document === "object") return canonicalJson$2(document);
|
|
8427
8555
|
}
|
|
8556
|
+
function queuePartition(queueUrl, clientRegion) {
|
|
8557
|
+
const m = /^https?:\/\/(?:sqs\.)?([a-z]{2}(?:-[a-z]+)+-\d+)\./.exec(queueUrl);
|
|
8558
|
+
return derivePartitionAndUrlSuffix(m?.[1] ?? clientRegion).partition;
|
|
8559
|
+
}
|
|
8428
8560
|
function splitQueueUrls(physicalId) {
|
|
8429
8561
|
return physicalId.split(",").filter((url) => url.length > 0);
|
|
8430
8562
|
}
|
|
@@ -9469,7 +9601,7 @@ var SNSTopicPolicyProvider = class {
|
|
|
9469
9601
|
this.logger.debug(safeMsg`${logicalId} set no policy of its own; nothing to reset`);
|
|
9470
9602
|
return;
|
|
9471
9603
|
}
|
|
9472
|
-
const
|
|
9604
|
+
const sent = sentPolicyDocument(document);
|
|
9473
9605
|
const fresh = new Set((context.writtenThisRun ?? []).flatMap((r) => r.resourceType === resourceType && typeof r.physicalId === "string" ? [...splitTopicArns(r.physicalId), ...listedTopics(r.properties !== null && typeof r.properties === "object" ? r.properties : {})] : []));
|
|
9474
9606
|
let unreadable = false;
|
|
9475
9607
|
let mismatched = false;
|
|
@@ -9491,7 +9623,9 @@ var SNSTopicPolicyProvider = class {
|
|
|
9491
9623
|
this.logger.warn(safeMsg`Could not read the policy of topic ${topicArn} (${current.reason}), so it is not reset: it may still carry the policy of ${logicalId}.`);
|
|
9492
9624
|
continue;
|
|
9493
9625
|
}
|
|
9494
|
-
const
|
|
9626
|
+
const partition = arnPartition(topicArn);
|
|
9627
|
+
const reference = policyContentKey(sent, partition);
|
|
9628
|
+
const live = current.kind === "none" ? void 0 : policyContentKey(current.policy, partition);
|
|
9495
9629
|
if (live === void 0 || live === reference) {
|
|
9496
9630
|
try {
|
|
9497
9631
|
await this.resetTopicPolicy(topicArn, resourceType, logicalId, context.expectedRegion);
|
|
@@ -9502,7 +9636,7 @@ var SNSTopicPolicyProvider = class {
|
|
|
9502
9636
|
continue;
|
|
9503
9637
|
}
|
|
9504
9638
|
const defaultPolicy = defaultTopicPolicy(topicArn);
|
|
9505
|
-
if (defaultPolicy !== void 0 && live === policyContentKey(defaultPolicy)) {
|
|
9639
|
+
if (defaultPolicy !== void 0 && live === policyContentKey(defaultPolicy, partition)) {
|
|
9506
9640
|
this.logger.debug(safeMsg`Topic ${topicArn} already carries its default policy`);
|
|
9507
9641
|
continue;
|
|
9508
9642
|
}
|
|
@@ -9663,6 +9797,10 @@ function canonicalJson$1(value) {
|
|
|
9663
9797
|
};
|
|
9664
9798
|
return JSON.stringify(sortKeys(value));
|
|
9665
9799
|
}
|
|
9800
|
+
function arnPartition(arn) {
|
|
9801
|
+
const m = /^arn:([a-z-]+):/.exec(arn);
|
|
9802
|
+
return m ? m[1] : void 0;
|
|
9803
|
+
}
|
|
9666
9804
|
function canonicalPolicy(text) {
|
|
9667
9805
|
try {
|
|
9668
9806
|
return canonicalJson$1(JSON.parse(text));
|
|
@@ -10743,7 +10881,7 @@ async function importImpl$35(input) {
|
|
|
10743
10881
|
function settingAbsent(error) {
|
|
10744
10882
|
return error instanceof ResourceNotFoundException;
|
|
10745
10883
|
}
|
|
10746
|
-
async function readUnsettled$
|
|
10884
|
+
async function readUnsettled$8(physicalId, logicalId, resourceType, names) {
|
|
10747
10885
|
const live = await this.readCurrentState(physicalId, logicalId, resourceType);
|
|
10748
10886
|
if (typeof live !== "object" || live === null) return live;
|
|
10749
10887
|
const out = { ...live };
|
|
@@ -11083,7 +11221,7 @@ var LambdaFunctionProvider = class {
|
|
|
11083
11221
|
return getAttribute$15.call(this, physicalId, _resourceType, attributeName);
|
|
11084
11222
|
}
|
|
11085
11223
|
readUnsettled(physicalId, logicalId, resourceType, names) {
|
|
11086
|
-
return readUnsettled$
|
|
11224
|
+
return readUnsettled$8.call(this, physicalId, logicalId, resourceType, names);
|
|
11087
11225
|
}
|
|
11088
11226
|
unsettledInTransition(physicalId, _logicalId, _resourceType, names) {
|
|
11089
11227
|
return unsettledInTransition$6.call(this, physicalId, _logicalId, _resourceType, names);
|
|
@@ -11906,19 +12044,19 @@ async function update$36(logicalId, physicalId, resourceType, properties, previo
|
|
|
11906
12044
|
function clearedDestinationConfig() {
|
|
11907
12045
|
return { OnFailure: { Destination: "" } };
|
|
11908
12046
|
}
|
|
11909
|
-
const isPlainObject$
|
|
12047
|
+
const isPlainObject$5 = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
|
|
11910
12048
|
function holdsDestination(value) {
|
|
11911
|
-
if (!isPlainObject$
|
|
12049
|
+
if (!isPlainObject$5(value)) return false;
|
|
11912
12050
|
const onFailure = value["OnFailure"];
|
|
11913
|
-
if (!isPlainObject$
|
|
12051
|
+
if (!isPlainObject$5(onFailure)) return false;
|
|
11914
12052
|
const destination = onFailure["Destination"];
|
|
11915
12053
|
return destination !== void 0 && destination !== null && destination !== "";
|
|
11916
12054
|
}
|
|
11917
12055
|
function destinationConfigForUpdate(value, previous) {
|
|
11918
12056
|
if (holdsDestination(value)) return value;
|
|
11919
|
-
if (!isPlainObject$
|
|
12057
|
+
if (!isPlainObject$5(value)) return value;
|
|
11920
12058
|
const onFailure = value["OnFailure"];
|
|
11921
|
-
if (onFailure !== void 0 && !isPlainObject$
|
|
12059
|
+
if (onFailure !== void 0 && !isPlainObject$5(onFailure)) return value;
|
|
11922
12060
|
return holdsDestination(previous) ? clearedDestinationConfig() : void 0;
|
|
11923
12061
|
}
|
|
11924
12062
|
async function applyUpdate$5(logicalId, physicalId, resourceType, properties, previousProperties, log, restoring) {
|
|
@@ -12094,8 +12232,8 @@ async function readCurrentState$37(physicalId, _logicalId, _resourceType, proper
|
|
|
12094
12232
|
const result = {};
|
|
12095
12233
|
if (resp.FunctionArn !== void 0) {
|
|
12096
12234
|
const stateFn = properties?.["FunctionName"];
|
|
12097
|
-
const
|
|
12098
|
-
if (typeof stateFn === "string" && !stateFn.includes(":") &&
|
|
12235
|
+
const live = parseLambdaFunctionAddress(resp.FunctionArn);
|
|
12236
|
+
if (typeof stateFn === "string" && !stateFn.includes(":") && live?.region !== void 0 && live.name === stateFn) result["FunctionName"] = stateFn;
|
|
12099
12237
|
else result["FunctionName"] = resp.FunctionArn;
|
|
12100
12238
|
}
|
|
12101
12239
|
if (resp.EventSourceArn !== void 0) result["EventSourceArn"] = resp.EventSourceArn;
|
|
@@ -14202,74 +14340,6 @@ function versionOfArn(arn) {
|
|
|
14202
14340
|
return match ? Number(match[1]) : void 0;
|
|
14203
14341
|
}
|
|
14204
14342
|
|
|
14205
|
-
// src/provisioning/providers/dynamodb-table/table-helpers.ts
|
|
14206
|
-
function isTableName(id) {
|
|
14207
|
-
return /^[A-Za-z0-9_.-]{3,255}$/.test(id);
|
|
14208
|
-
}
|
|
14209
|
-
function mapSSESpecification(raw) {
|
|
14210
|
-
if (raw === null || typeof raw !== "object") return;
|
|
14211
|
-
const cfn = raw;
|
|
14212
|
-
const out = {};
|
|
14213
|
-
if (cfn.SSEEnabled !== void 0) out.Enabled = coerceCfnBoolean(cfn.SSEEnabled) === true;
|
|
14214
|
-
if (typeof cfn.SSEType === "string") out.SSEType = cfn.SSEType;
|
|
14215
|
-
if (typeof cfn.KMSMasterKeyId === "string") out.KMSMasterKeyId = cfn.KMSMasterKeyId;
|
|
14216
|
-
return out;
|
|
14217
|
-
}
|
|
14218
|
-
function sseSpecificationRefusal(value, logicalId) {
|
|
14219
|
-
const path = `AWS::DynamoDB::Table ${logicalId} SSESpecification`;
|
|
14220
|
-
if (value === null) return `${path} must be an object (got null)`;
|
|
14221
|
-
return configBooleanRefusal(value, "SSEEnabled", path);
|
|
14222
|
-
}
|
|
14223
|
-
function sseSpecificationToSend(desired, previous, liveSse, described) {
|
|
14224
|
-
const status = liveSse?.Status;
|
|
14225
|
-
const liveOn = status === "ENABLED" || status === "ENABLING" || status === "UPDATING";
|
|
14226
|
-
const liveOff = described && (liveSse === void 0 || status === "DISABLED" || status === "DISABLING");
|
|
14227
|
-
if (desired !== void 0) {
|
|
14228
|
-
const mapped = mapSSESpecification(desired);
|
|
14229
|
-
if (mapped === void 0 || Object.keys(mapped).length === 0) return void 0;
|
|
14230
|
-
if (mapped.Enabled === false && liveOff) return void 0;
|
|
14231
|
-
const liveKeyArn = liveSse?.KMSMasterKeyArn;
|
|
14232
|
-
if (mapped.Enabled === true && status === "ENABLED" && mapped.KMSMasterKeyId !== void 0 && liveKeyArn?.includes(":key/") === true && (mapped.KMSMasterKeyId === liveKeyArn || mapped.KMSMasterKeyId === liveKeyArn.slice(liveKeyArn.lastIndexOf(":key/") + 5)) && (mapped.SSEType === void 0 || mapped.SSEType === liveSse?.SSEType)) return;
|
|
14233
|
-
return mapped;
|
|
14234
|
-
}
|
|
14235
|
-
if (liveOff) return void 0;
|
|
14236
|
-
const previousOn = previous !== null && typeof previous === "object" ? coerceCfnBoolean(previous["SSEEnabled"]) === true : false;
|
|
14237
|
-
return liveOn || previousOn ? { Enabled: false } : void 0;
|
|
14238
|
-
}
|
|
14239
|
-
function readCapacityNumber(block, member) {
|
|
14240
|
-
if (!isPlainCapacityBlock(block)) return void 0;
|
|
14241
|
-
return coerceCfnInteger(block[member]);
|
|
14242
|
-
}
|
|
14243
|
-
function pointInTimeRecoveryRefusal(spec) {
|
|
14244
|
-
return configIntegerRefusal(spec, "RecoveryPeriodInDays", "AWS::DynamoDB::Table PointInTimeRecoverySpecification", 1, 35);
|
|
14245
|
-
}
|
|
14246
|
-
function isPlainCapacityBlock(value) {
|
|
14247
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14248
|
-
}
|
|
14249
|
-
function hasUsableDeclaredCapacity(entry) {
|
|
14250
|
-
const declared = entry?.["ProvisionedThroughput"];
|
|
14251
|
-
return readCapacityNumber(declared, "ReadCapacityUnits") !== void 0 && readCapacityNumber(declared, "WriteCapacityUnits") !== void 0;
|
|
14252
|
-
}
|
|
14253
|
-
const KINESIS_DESTINATION_SETTLE_POLL_MS = 2e3;
|
|
14254
|
-
const KINESIS_DISABLE_PENDING_STATUSES = /* @__PURE__ */ new Set([
|
|
14255
|
-
"ACTIVE",
|
|
14256
|
-
"ENABLING",
|
|
14257
|
-
"UPDATING",
|
|
14258
|
-
"DISABLING"
|
|
14259
|
-
]);
|
|
14260
|
-
const deleteTableRetryDelays = {};
|
|
14261
|
-
function maskLeafValue(value, maskSecrets) {
|
|
14262
|
-
return maskDeep(value, maskSecrets);
|
|
14263
|
-
}
|
|
14264
|
-
const tableNameReleaseWait = {
|
|
14265
|
-
maxPolls: 600,
|
|
14266
|
-
intervalMs: INDEX_SETTLE_POLL_INTERVAL_MS
|
|
14267
|
-
};
|
|
14268
|
-
const tableDeleteGoneWait = {
|
|
14269
|
-
maxWaitMs: 600 * DYNAMODB_DELETE_POLL_COST_MS,
|
|
14270
|
-
pollIntervalMs: INDEX_SETTLE_POLL_INTERVAL_MS
|
|
14271
|
-
};
|
|
14272
|
-
|
|
14273
14343
|
// src/provisioning/providers/dynamodb-table/capacity.ts
|
|
14274
14344
|
const PROVISIONED_CAPACITY_MEMBERS = ["ReadCapacityUnits", "WriteCapacityUnits"];
|
|
14275
14345
|
const ON_DEMAND_CEILING_MEMBERS = ["MaxReadRequestUnits", "MaxWriteRequestUnits"];
|
|
@@ -14433,222 +14503,6 @@ function liveCapacityAlreadyMatches(live, requested) {
|
|
|
14433
14503
|
return liveRead === wantRead && liveWrite === wantWrite;
|
|
14434
14504
|
}
|
|
14435
14505
|
|
|
14436
|
-
// src/provisioning/providers/dynamodb-table/warm-throughput.ts
|
|
14437
|
-
function isSendableWarmThroughput(value) {
|
|
14438
|
-
return coerceWarmThroughput(value) !== void 0;
|
|
14439
|
-
}
|
|
14440
|
-
function coerceWarmThroughput(value) {
|
|
14441
|
-
const { spec, droppedMembers } = coerceWarmThroughput$1(value);
|
|
14442
|
-
if (spec === void 0) return void 0;
|
|
14443
|
-
return {
|
|
14444
|
-
spec,
|
|
14445
|
-
dropped: [...droppedMembers]
|
|
14446
|
-
};
|
|
14447
|
-
}
|
|
14448
|
-
function isRecordedSentStandIn(value) {
|
|
14449
|
-
return typeof value === "string" && (dynamicReferenceTokens(value).length > 0 || value === "***");
|
|
14450
|
-
}
|
|
14451
|
-
function sentWarmThroughputMembers(value) {
|
|
14452
|
-
const members = /* @__PURE__ */ new Set();
|
|
14453
|
-
const coerced = coerceWarmThroughput(value);
|
|
14454
|
-
for (const member of WARM_THROUGHPUT_MEMBERS) if (coerced?.spec[member] !== void 0) members.add(member);
|
|
14455
|
-
else if (isPlainCapacityBlock(value) && isRecordedSentStandIn(value[member])) members.add(member);
|
|
14456
|
-
return members;
|
|
14457
|
-
}
|
|
14458
|
-
function wasSentWarmThroughput(value) {
|
|
14459
|
-
return sentWarmThroughputMembers(value).size > 0;
|
|
14460
|
-
}
|
|
14461
|
-
function readbackWarmThroughput(live, members, declared) {
|
|
14462
|
-
const moving = live.Status === "UPDATING" ? coerceWarmThroughput(declared)?.spec : void 0;
|
|
14463
|
-
const out = {};
|
|
14464
|
-
for (const member of WARM_THROUGHPUT_MEMBERS) {
|
|
14465
|
-
const value = live[member];
|
|
14466
|
-
if (value === void 0) continue;
|
|
14467
|
-
if (members !== void 0 && !members.has(member)) continue;
|
|
14468
|
-
const target = moving?.[member];
|
|
14469
|
-
out[member] = target === void 0 ? value : Math.max(value, target);
|
|
14470
|
-
}
|
|
14471
|
-
return Object.keys(out).length > 0 ? out : void 0;
|
|
14472
|
-
}
|
|
14473
|
-
function trimUnsentWarmMembers(baselineBlock, sent) {
|
|
14474
|
-
if (sent.size === 0 || !isPlainCapacityBlock(baselineBlock)) return baselineBlock;
|
|
14475
|
-
const unsent = WARM_THROUGHPUT_MEMBERS.filter((member) => member in baselineBlock && !sent.has(member));
|
|
14476
|
-
if (unsent.length === 0) return baselineBlock;
|
|
14477
|
-
const trimmed = { ...baselineBlock };
|
|
14478
|
-
for (const member of unsent) delete trimmed[member];
|
|
14479
|
-
return trimmed;
|
|
14480
|
-
}
|
|
14481
|
-
function isRefusedWarmThroughput(value) {
|
|
14482
|
-
if (value === void 0) return false;
|
|
14483
|
-
if (!value) return false;
|
|
14484
|
-
return !isSendableWarmThroughput(value);
|
|
14485
|
-
}
|
|
14486
|
-
function desiredBagIsInformative(properties) {
|
|
14487
|
-
return properties !== void 0 && Object.keys(properties).length > 0;
|
|
14488
|
-
}
|
|
14489
|
-
function declaresWarmThroughput(properties) {
|
|
14490
|
-
if (!desiredBagIsInformative(properties)) return true;
|
|
14491
|
-
return properties !== void 0 && wasSentWarmThroughput(properties["WarmThroughput"]);
|
|
14492
|
-
}
|
|
14493
|
-
function warmThroughputAlreadyMatches(desired, live) {
|
|
14494
|
-
if (live === void 0) return false;
|
|
14495
|
-
let compared = 0;
|
|
14496
|
-
for (const member of WARM_THROUGHPUT_MEMBERS) {
|
|
14497
|
-
if (desired[member] === void 0) continue;
|
|
14498
|
-
const wanted = toFiniteNumber(desired[member]);
|
|
14499
|
-
const current = toFiniteNumber(live[member]);
|
|
14500
|
-
if (wanted === void 0 || current === void 0) return false;
|
|
14501
|
-
if (wanted !== current) return false;
|
|
14502
|
-
compared++;
|
|
14503
|
-
}
|
|
14504
|
-
return compared > 0;
|
|
14505
|
-
}
|
|
14506
|
-
|
|
14507
|
-
// src/provisioning/providers/dynamodb-table/indexes.ts
|
|
14508
|
-
function reverseMapSecondaryIndex(live, desired, bagInformative) {
|
|
14509
|
-
const out = {};
|
|
14510
|
-
if (live.IndexName !== void 0) out["IndexName"] = live.IndexName;
|
|
14511
|
-
if (live.KeySchema !== void 0) out["KeySchema"] = live.KeySchema.map((element) => ({ ...element }));
|
|
14512
|
-
if (live.Projection !== void 0) {
|
|
14513
|
-
const projection = {};
|
|
14514
|
-
if (live.Projection.ProjectionType !== void 0) projection["ProjectionType"] = live.Projection.ProjectionType;
|
|
14515
|
-
if (live.Projection.NonKeyAttributes !== void 0) projection["NonKeyAttributes"] = [...live.Projection.NonKeyAttributes];
|
|
14516
|
-
if (Object.keys(projection).length > 0) out["Projection"] = projection;
|
|
14517
|
-
}
|
|
14518
|
-
if ("ProvisionedThroughput" in live && indexDeclares(desired, "ProvisionedThroughput", bagInformative) && live.ProvisionedThroughput) {
|
|
14519
|
-
const provisioned = live.ProvisionedThroughput;
|
|
14520
|
-
const pt = {};
|
|
14521
|
-
if (provisioned.ReadCapacityUnits !== void 0) pt["ReadCapacityUnits"] = provisioned.ReadCapacityUnits;
|
|
14522
|
-
if (provisioned.WriteCapacityUnits !== void 0) pt["WriteCapacityUnits"] = provisioned.WriteCapacityUnits;
|
|
14523
|
-
if (Object.keys(pt).length > 0) out["ProvisionedThroughput"] = pt;
|
|
14524
|
-
}
|
|
14525
|
-
if ("OnDemandThroughput" in live && indexDeclares(desired, "OnDemandThroughput", bagInformative) && live.OnDemandThroughput) {
|
|
14526
|
-
const onDemand = live.OnDemandThroughput;
|
|
14527
|
-
const odt = {};
|
|
14528
|
-
if (onDemand.MaxReadRequestUnits !== void 0) odt["MaxReadRequestUnits"] = onDemand.MaxReadRequestUnits;
|
|
14529
|
-
if (onDemand.MaxWriteRequestUnits !== void 0) odt["MaxWriteRequestUnits"] = onDemand.MaxWriteRequestUnits;
|
|
14530
|
-
if (Object.keys(odt).length > 0) out["OnDemandThroughput"] = odt;
|
|
14531
|
-
}
|
|
14532
|
-
if ("WarmThroughput" in live && indexDeclares(desired, "WarmThroughput", bagInformative) && live.WarmThroughput) {
|
|
14533
|
-
const wt = readbackWarmThroughput(live.WarmThroughput, bagInformative ? sentWarmThroughputMembers(desired?.["WarmThroughput"]) : void 0, bagInformative ? desired?.["WarmThroughput"] : void 0);
|
|
14534
|
-
if (wt !== void 0) out["WarmThroughput"] = wt;
|
|
14535
|
-
}
|
|
14536
|
-
return out;
|
|
14537
|
-
}
|
|
14538
|
-
const SDK_ONLY_INDEX_MEMBERS = [
|
|
14539
|
-
"IndexStatus",
|
|
14540
|
-
"Backfilling",
|
|
14541
|
-
"IndexSizeBytes",
|
|
14542
|
-
"ItemCount",
|
|
14543
|
-
"IndexArn"
|
|
14544
|
-
];
|
|
14545
|
-
const SDK_ONLY_THROUGHPUT_MEMBERS = [
|
|
14546
|
-
"NumberOfDecreasesToday",
|
|
14547
|
-
"LastIncreaseDateTime",
|
|
14548
|
-
"LastDecreaseDateTime"
|
|
14549
|
-
];
|
|
14550
|
-
function canonicalizeStaleIndexDescription(element) {
|
|
14551
|
-
if (typeof element !== "object" || element === null || Array.isArray(element)) return element;
|
|
14552
|
-
const copy = { ...element };
|
|
14553
|
-
let changed = false;
|
|
14554
|
-
for (const member of SDK_ONLY_INDEX_MEMBERS) if (member in copy) {
|
|
14555
|
-
delete copy[member];
|
|
14556
|
-
changed = true;
|
|
14557
|
-
}
|
|
14558
|
-
const pt = copy["ProvisionedThroughput"];
|
|
14559
|
-
if (isPlainCapacityBlock(pt) && SDK_ONLY_THROUGHPUT_MEMBERS.some((member) => member in pt)) {
|
|
14560
|
-
changed = true;
|
|
14561
|
-
const trimmed = { ...pt };
|
|
14562
|
-
for (const member of SDK_ONLY_THROUGHPUT_MEMBERS) delete trimmed[member];
|
|
14563
|
-
if ((trimmed["ReadCapacityUnits"] ?? 0) === 0 && (trimmed["WriteCapacityUnits"] ?? 0) === 0) delete copy["ProvisionedThroughput"];
|
|
14564
|
-
else copy["ProvisionedThroughput"] = trimmed;
|
|
14565
|
-
}
|
|
14566
|
-
const warm = copy["WarmThroughput"];
|
|
14567
|
-
if (isPlainCapacityBlock(warm) && "Status" in warm) {
|
|
14568
|
-
delete copy["WarmThroughput"];
|
|
14569
|
-
changed = true;
|
|
14570
|
-
}
|
|
14571
|
-
return changed ? copy : element;
|
|
14572
|
-
}
|
|
14573
|
-
function sameJsonValue(a, b) {
|
|
14574
|
-
const toJson = (v) => v === void 0 ? void 0 : JSON.parse(JSON.stringify(v));
|
|
14575
|
-
return isDeepStrictEqual(toJson(a), toJson(b));
|
|
14576
|
-
}
|
|
14577
|
-
function gsiUnsendableChangeRefusal(previousGsis, desiredGsis, logicalId) {
|
|
14578
|
-
const asEntries = (value) => value === void 0 || value === null ? [] : Array.isArray(value) ? value.filter((entry) => typeof entry === "object" && entry !== null && Boolean(entry["IndexName"])) : void 0;
|
|
14579
|
-
const prev = asEntries(previousGsis);
|
|
14580
|
-
const desired = asEntries(desiredGsis);
|
|
14581
|
-
if (prev === void 0 || desired === void 0) return void 0;
|
|
14582
|
-
const prevByName = new Map(prev.map((g) => [String(g["IndexName"]), g]));
|
|
14583
|
-
for (const gsi of desired) {
|
|
14584
|
-
const name = String(gsi["IndexName"]);
|
|
14585
|
-
const before = prevByName.get(name);
|
|
14586
|
-
if (before === void 0) {
|
|
14587
|
-
if (!gsi["KeySchema"]) return `GlobalSecondaryIndex ${name} on DynamoDB table ${logicalId} is missing KeySchema`;
|
|
14588
|
-
} else if (!sameJsonValue(before["KeySchema"], gsi["KeySchema"]) || !sameJsonValue(before["Projection"], gsi["Projection"])) return `GlobalSecondaryIndex ${name} on DynamoDB table ${logicalId} changed its KeySchema or Projection, which DynamoDB cannot modify in place. Rename the index (so it is dropped and re-created) or replace the table.`;
|
|
14589
|
-
}
|
|
14590
|
-
}
|
|
14591
|
-
function indexDeclares(desired, key, bagInformative) {
|
|
14592
|
-
if (!bagInformative) return true;
|
|
14593
|
-
const value = desired?.[key];
|
|
14594
|
-
return key === "WarmThroughput" ? wasSentWarmThroughput(value) : Boolean(value);
|
|
14595
|
-
}
|
|
14596
|
-
function declaresIndexList(value) {
|
|
14597
|
-
return Array.isArray(value) && value.length > 0;
|
|
14598
|
-
}
|
|
14599
|
-
function deletionProtectionRefusal(value, logicalId) {
|
|
14600
|
-
return configBooleanRefusal({ DeletionProtectionEnabled: value }, "DeletionProtectionEnabled", `AWS::DynamoDB::Table ${logicalId}`);
|
|
14601
|
-
}
|
|
14602
|
-
function localSecondaryIndexesKey(value) {
|
|
14603
|
-
if (value === void 0 || value === null) return "[]";
|
|
14604
|
-
if (!Array.isArray(value)) return JSON.stringify(value);
|
|
14605
|
-
const isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
14606
|
-
const entries = value.map((entry) => {
|
|
14607
|
-
if (!isRecord(entry)) return JSON.stringify(entry);
|
|
14608
|
-
const keySchema = Array.isArray(entry["KeySchema"]) ? entry["KeySchema"].map((element) => isRecord(element) ? {
|
|
14609
|
-
AttributeName: element["AttributeName"],
|
|
14610
|
-
KeyType: element["KeyType"]
|
|
14611
|
-
} : element) : entry["KeySchema"];
|
|
14612
|
-
const projection = entry["Projection"];
|
|
14613
|
-
const projectionKey = isRecord(projection) ? {
|
|
14614
|
-
ProjectionType: projection["ProjectionType"],
|
|
14615
|
-
NonKeyAttributes: Array.isArray(projection["NonKeyAttributes"]) ? projection["NonKeyAttributes"].length > 0 ? [...projection["NonKeyAttributes"]].map(String).sort() : void 0 : projection["NonKeyAttributes"]
|
|
14616
|
-
} : projection;
|
|
14617
|
-
return JSON.stringify({
|
|
14618
|
-
IndexName: entry["IndexName"],
|
|
14619
|
-
KeySchema: keySchema,
|
|
14620
|
-
Projection: projectionKey
|
|
14621
|
-
});
|
|
14622
|
-
});
|
|
14623
|
-
return JSON.stringify(entries.sort());
|
|
14624
|
-
}
|
|
14625
|
-
function desiredIndexEntriesByName(value) {
|
|
14626
|
-
const byName = /* @__PURE__ */ new Map();
|
|
14627
|
-
if (!declaresIndexList(value)) return byName;
|
|
14628
|
-
for (const entry of value) {
|
|
14629
|
-
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) continue;
|
|
14630
|
-
const name = entry["IndexName"];
|
|
14631
|
-
if (typeof name === "string") byName.set(name, entry);
|
|
14632
|
-
}
|
|
14633
|
-
return byName;
|
|
14634
|
-
}
|
|
14635
|
-
function projectIndexesOnto(live, recorded, desired, attempted = /* @__PURE__ */ new Set()) {
|
|
14636
|
-
if (!Array.isArray(live)) return void 0;
|
|
14637
|
-
const named = new Set([...attempted].filter(isUsableAttemptedName));
|
|
14638
|
-
for (const list of [recorded, desired]) {
|
|
14639
|
-
if (!Array.isArray(list)) continue;
|
|
14640
|
-
for (const entry of list) {
|
|
14641
|
-
const name = typeof entry === "object" && entry !== null ? entry["IndexName"] : void 0;
|
|
14642
|
-
if (typeof name === "string") named.add(name);
|
|
14643
|
-
}
|
|
14644
|
-
}
|
|
14645
|
-
const kept = live.filter((entry) => {
|
|
14646
|
-
const name = typeof entry === "object" && entry !== null ? entry["IndexName"] : void 0;
|
|
14647
|
-
return typeof name === "string" && named.has(name);
|
|
14648
|
-
});
|
|
14649
|
-
return kept.length > 0 ? kept : void 0;
|
|
14650
|
-
}
|
|
14651
|
-
|
|
14652
14506
|
// src/provisioning/providers/dynamodb-table/create.ts
|
|
14653
14507
|
async function create$34(logicalId, resourceType, properties, context) {
|
|
14654
14508
|
const maskSecrets = context?.maskSecrets ?? ((text) => text);
|
|
@@ -15079,7 +14933,7 @@ async function canonicalizeDriftPair$5(resourceType, baseline, aws, properties)
|
|
|
15079
14933
|
aws
|
|
15080
14934
|
};
|
|
15081
14935
|
}
|
|
15082
|
-
async function readUnsettled$
|
|
14936
|
+
async function readUnsettled$7(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
|
|
15083
14937
|
const live = await this.readCurrentState(physicalId, logicalId, resourceType, recordedProperties);
|
|
15084
14938
|
if (typeof live !== "object" || live === null) return live;
|
|
15085
14939
|
const out = { ...live };
|
|
@@ -16782,7 +16636,7 @@ var DynamoDBTableProvider = class {
|
|
|
16782
16636
|
return canonicalizeDriftPair$5.call(this, resourceType, baseline, aws, properties);
|
|
16783
16637
|
}
|
|
16784
16638
|
async readUnsettled(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
|
|
16785
|
-
return readUnsettled$
|
|
16639
|
+
return readUnsettled$7.call(this, physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems);
|
|
16786
16640
|
}
|
|
16787
16641
|
async unsettledInTransition(physicalId, _logicalId, _resourceType, names) {
|
|
16788
16642
|
return unsettledInTransition$5.call(this, physicalId, _logicalId, _resourceType, names);
|
|
@@ -21130,30 +20984,6 @@ const CREATE_TAGS_DENIAL_NAMES = /* @__PURE__ */ new Set(["UnauthorizedOperation
|
|
|
21130
20984
|
const IDEMPOTENT_MISMATCH_NAMES = /* @__PURE__ */ new Set(["IdempotentParameterMismatch"]);
|
|
21131
20985
|
const ORPHAN_LIST_PAGE_SIZE = 1e3;
|
|
21132
20986
|
|
|
21133
|
-
// src/utils/ipv6-cidr.ts
|
|
21134
|
-
function canonicalizeIpv6Cidr(value) {
|
|
21135
|
-
const match = /^([0-9a-fA-F:.]{2,45})\/(\d{1,3})$/.exec(value);
|
|
21136
|
-
if (!match || !isIPv6(match[1])) return void 0;
|
|
21137
|
-
const prefix = Number(match[2]);
|
|
21138
|
-
if (prefix > 128) return void 0;
|
|
21139
|
-
try {
|
|
21140
|
-
const [left, right] = new URL(`http://[${match[1]}]/`).hostname.slice(1, -1).split("::");
|
|
21141
|
-
const before = left ? left.split(":") : [];
|
|
21142
|
-
const after = right ? right.split(":") : [];
|
|
21143
|
-
const pieces = right === void 0 ? before : [
|
|
21144
|
-
...before,
|
|
21145
|
-
...new Array(8 - before.length - after.length).fill("0"),
|
|
21146
|
-
...after
|
|
21147
|
-
];
|
|
21148
|
-
const hostBits = BigInt(128 - prefix);
|
|
21149
|
-
const hex = (BigInt(`0x${pieces.map((piece) => piece.padStart(4, "0")).join("")}`) >> hostBits << hostBits).toString(16).padStart(32, "0");
|
|
21150
|
-
const expanded = Array.from({ length: 8 }, (_, index) => hex.slice(index * 4, index * 4 + 4)).join(":");
|
|
21151
|
-
return `${new URL(`http://[${expanded}]/`).hostname.slice(1, -1)}/${prefix}`;
|
|
21152
|
-
} catch {
|
|
21153
|
-
return;
|
|
21154
|
-
}
|
|
21155
|
-
}
|
|
21156
|
-
|
|
21157
20987
|
// src/provisioning/providers/ec2/orphans.ts
|
|
21158
20988
|
function getCreateClient$8() {
|
|
21159
20989
|
const shared = this.ec2Client;
|
|
@@ -24486,6 +24316,9 @@ function instanceSsmAssociationEntries(value) {
|
|
|
24486
24316
|
function ssmDocumentName(nameOrArn) {
|
|
24487
24317
|
return nameOrArn.startsWith("arn:") ? nameOrArn.slice(nameOrArn.lastIndexOf("/") + 1) : nameOrArn;
|
|
24488
24318
|
}
|
|
24319
|
+
function sameSsmDocument(a, b) {
|
|
24320
|
+
return a === b;
|
|
24321
|
+
}
|
|
24489
24322
|
function sameSsmAssociations(a, b, resourceType) {
|
|
24490
24323
|
if (instanceSsmAssociationsRefusal(a, resourceType) !== void 0 || instanceSsmAssociationsRefusal(b, resourceType) !== void 0) return false;
|
|
24491
24324
|
const left = instanceSsmAssociationEntries(a);
|
|
@@ -24493,7 +24326,7 @@ function sameSsmAssociations(a, b, resourceType) {
|
|
|
24493
24326
|
if (left.length !== right.length) return false;
|
|
24494
24327
|
return left.every((l, i) => {
|
|
24495
24328
|
const r = right[i];
|
|
24496
|
-
if (
|
|
24329
|
+
if (!sameSsmDocument(l.DocumentName, r.DocumentName)) return false;
|
|
24497
24330
|
const lk = Object.keys(l.Parameters).sort();
|
|
24498
24331
|
const rk = Object.keys(r.Parameters).sort();
|
|
24499
24332
|
return lk.length === rk.length && lk.every((k, j) => k === rk[j] && sameOrderedStrings(l.Parameters[k], r.Parameters[k]));
|
|
@@ -25781,6 +25614,7 @@ const instanceBuildMethods = {
|
|
|
25781
25614
|
// src/provisioning/providers/ec2/instance-ssm.ts
|
|
25782
25615
|
const IAM_ROLE_NOT_YET_SEEN = "must associate an IAM role";
|
|
25783
25616
|
const ASSOCIATION_GONE_NAMES = /* @__PURE__ */ new Set(["AssociationDoesNotExist"]);
|
|
25617
|
+
const INVALID_DOCUMENT_NAMES = /* @__PURE__ */ new Set(["InvalidDocument"]);
|
|
25784
25618
|
async function createInstanceSsmAssociation(logicalId, instanceId, entry, mask) {
|
|
25785
25619
|
const watch = startInterruptWatch(`EC2 Instance ${logicalId} SSM association`);
|
|
25786
25620
|
const capAt = Date.now() + SSM_ASSOCIATION_ROLE_WAIT_CAP_MS;
|
|
@@ -25805,9 +25639,8 @@ async function createInstanceSsmAssociation(logicalId, instanceId, entry, mask)
|
|
|
25805
25639
|
watch.dispose();
|
|
25806
25640
|
}
|
|
25807
25641
|
}
|
|
25808
|
-
async function listInstanceSsmAssociations(instanceId, documentNames) {
|
|
25809
|
-
const
|
|
25810
|
-
const out = [];
|
|
25642
|
+
async function listInstanceSsmAssociations(instanceId, documentNames, options) {
|
|
25643
|
+
const all = [];
|
|
25811
25644
|
let nextToken;
|
|
25812
25645
|
do {
|
|
25813
25646
|
const resp = await this.awsClients.ssm.send(new ListAssociationsCommand({
|
|
@@ -25819,17 +25652,41 @@ async function listInstanceSsmAssociations(instanceId, documentNames) {
|
|
|
25819
25652
|
}));
|
|
25820
25653
|
for (const a of resp.Associations ?? []) {
|
|
25821
25654
|
if (a.InstanceId !== instanceId || typeof a.AssociationId !== "string") continue;
|
|
25822
|
-
|
|
25823
|
-
if (!wanted.has(ssmDocumentName(name))) continue;
|
|
25824
|
-
out.push({
|
|
25655
|
+
all.push({
|
|
25825
25656
|
AssociationId: a.AssociationId,
|
|
25826
|
-
Name:
|
|
25657
|
+
Name: typeof a.Name === "string" ? a.Name : ""
|
|
25827
25658
|
});
|
|
25828
25659
|
}
|
|
25829
25660
|
nextToken = resp.NextToken || void 0;
|
|
25830
25661
|
} while (nextToken !== void 0);
|
|
25662
|
+
const out = all.filter((a) => documentNames.some((d) => sameSsmDocument(d, a.Name)));
|
|
25663
|
+
if (options?.forDelete !== true) return out;
|
|
25664
|
+
for (const declared of documentNames) {
|
|
25665
|
+
if (!declared.startsWith("arn:") || out.some((a) => sameSsmDocument(declared, a.Name))) continue;
|
|
25666
|
+
const bare = ssmDocumentName(declared);
|
|
25667
|
+
const byName = all.filter((a) => a.Name === bare && !out.includes(a));
|
|
25668
|
+
if (byName.length === 0) continue;
|
|
25669
|
+
const owner = byName.length > 1 ? "ambiguous" : await this.ssmDocumentNameOwner(bare);
|
|
25670
|
+
if (owner === "none") {
|
|
25671
|
+
out.push(...byName);
|
|
25672
|
+
continue;
|
|
25673
|
+
}
|
|
25674
|
+
const ids = byName.map((a) => a.AssociationId).join(", ");
|
|
25675
|
+
const why = owner === "exists" ? "this account also has a document by that name, so it may be that document" : owner === "ambiguous" ? "more than one association carries that name, so cdkd cannot tell which" : `DescribeDocument failed (${owner.failed}), so cdkd cannot tell`;
|
|
25676
|
+
const region = await this.ssmRemedyRegion(void 0) ?? "<the stack's region>";
|
|
25677
|
+
this.logger.warn(safeMsg`An SSM association that the record declares by a shared document's ARN was not found on ${instanceId} under that ARN; association(s) ${ids} carry the document's bare name, but ${why}. cdkd leaves it in place. If it is the shared document's, delete it: aws ssm delete-association --association-id <id> --region ${region}.`);
|
|
25678
|
+
}
|
|
25831
25679
|
return out;
|
|
25832
25680
|
}
|
|
25681
|
+
async function ssmDocumentNameOwner(name) {
|
|
25682
|
+
try {
|
|
25683
|
+
await this.awsClients.ssm.send(new DescribeDocumentCommand({ Name: name }));
|
|
25684
|
+
return "exists";
|
|
25685
|
+
} catch (error) {
|
|
25686
|
+
if (isNamedError(error, INVALID_DOCUMENT_NAMES)) return "none";
|
|
25687
|
+
return { failed: error instanceof Error ? error.name : "unknown error" };
|
|
25688
|
+
}
|
|
25689
|
+
}
|
|
25833
25690
|
async function deleteSsmAssociationById(associationId) {
|
|
25834
25691
|
try {
|
|
25835
25692
|
await this.awsClients.ssm.send(new DeleteAssociationCommand({ AssociationId: associationId }));
|
|
@@ -25842,7 +25699,7 @@ async function applyInstanceSsmAssociationChange(logicalId, physicalId, resource
|
|
|
25842
25699
|
const remedy = async () => staleSsmAssociationRemedy(physicalId, await this.ssmRemedyRegion(expectedRegion), mask);
|
|
25843
25700
|
if (plan.recordUnreadable) this.logger.warn(plan.create !== void 0 ? safeMsg`${logicalId} (${resourceType}): the previous record's SsmAssociations is unreadable, so cdkd cannot tell which SSM association of ${physicalId} is this resource's; it deletes none and creates the declared one. ${await remedy()}.` : safeMsg`${logicalId} (${resourceType}): the previous record's SsmAssociations is unreadable, so cdkd cannot tell which SSM association of ${physicalId} is this resource's and deletes none. ${await remedy()}.`);
|
|
25844
25701
|
const deleted = [];
|
|
25845
|
-
if (plan.documentNames.length > 0) for (const a of await this.listInstanceSsmAssociations(physicalId, plan.documentNames)) {
|
|
25702
|
+
if (plan.documentNames.length > 0) for (const a of await this.listInstanceSsmAssociations(physicalId, plan.documentNames, { forDelete: true })) {
|
|
25846
25703
|
await this.deleteSsmAssociationById(a.AssociationId);
|
|
25847
25704
|
deleted.push(a.Name);
|
|
25848
25705
|
}
|
|
@@ -25861,7 +25718,7 @@ async function applyInstanceSsmAssociationChange(logicalId, physicalId, resource
|
|
|
25861
25718
|
}
|
|
25862
25719
|
async function deleteInstanceSsmAssociationsBestEffort(logicalId, instanceId, documentNames, mask) {
|
|
25863
25720
|
try {
|
|
25864
|
-
for (const a of await this.listInstanceSsmAssociations(instanceId, documentNames)) await this.deleteSsmAssociationById(a.AssociationId);
|
|
25721
|
+
for (const a of await this.listInstanceSsmAssociations(instanceId, documentNames, { forDelete: true })) await this.deleteSsmAssociationById(a.AssociationId);
|
|
25865
25722
|
} catch (error) {
|
|
25866
25723
|
const head = `Could not delete the SSM association of EC2 Instance ${logicalId} (${instanceId}): `;
|
|
25867
25724
|
this.logger.warn(safeMsg`${head}${this.warnFailureSentence(head, error, mask)} The instance is deleted; the association stays listed by Systems Manager until it is deleted (aws ssm delete-association --association-id <id>).`);
|
|
@@ -25880,7 +25737,7 @@ async function readInstanceSsmAssociations(instanceId, declared) {
|
|
|
25880
25737
|
}
|
|
25881
25738
|
const description = resp.AssociationDescription;
|
|
25882
25739
|
const name = description?.Name ?? a.Name;
|
|
25883
|
-
const match = declared.find((d) =>
|
|
25740
|
+
const match = declared.find((d) => sameSsmDocument(d.DocumentName, a.Name));
|
|
25884
25741
|
const params = description?.Parameters ?? {};
|
|
25885
25742
|
const order = match?.parameterKeys ?? [];
|
|
25886
25743
|
const keys = [...order.filter((k) => k in params), ...Object.keys(params).filter((k) => !order.includes(k)).sort()];
|
|
@@ -25906,6 +25763,7 @@ const instanceSsmMethods = {
|
|
|
25906
25763
|
ssmRemedyRegion,
|
|
25907
25764
|
createInstanceSsmAssociation,
|
|
25908
25765
|
listInstanceSsmAssociations,
|
|
25766
|
+
ssmDocumentNameOwner,
|
|
25909
25767
|
deleteSsmAssociationById,
|
|
25910
25768
|
applyInstanceSsmAssociationChange,
|
|
25911
25769
|
deleteInstanceSsmAssociationsBestEffort,
|
|
@@ -26490,7 +26348,7 @@ async function unsettledInTransition$4(physicalId, _logicalId, resourceType, nam
|
|
|
26490
26348
|
return /* @__PURE__ */ new Set(["Ipv6CidrBlock"]);
|
|
26491
26349
|
}
|
|
26492
26350
|
}
|
|
26493
|
-
async function readUnsettled$
|
|
26351
|
+
async function readUnsettled$6(physicalId, logicalId, resourceType, names, recordedProperties) {
|
|
26494
26352
|
if (resourceType === "AWS::EC2::Subnet") return this.readSubnetCurrentState(physicalId, names, recordedProperties);
|
|
26495
26353
|
return this.readCurrentState(physicalId, logicalId, resourceType, recordedProperties);
|
|
26496
26354
|
}
|
|
@@ -26670,7 +26528,7 @@ function foldNetmaskSpellings(properties, keys) {
|
|
|
26670
26528
|
const driftMethods = {
|
|
26671
26529
|
subnetIpv6InTransition,
|
|
26672
26530
|
unsettledInTransition: unsettledInTransition$4,
|
|
26673
|
-
readUnsettled: readUnsettled$
|
|
26531
|
+
readUnsettled: readUnsettled$6,
|
|
26674
26532
|
canonicalizeDriftPair: canonicalizeDriftPair$4,
|
|
26675
26533
|
canonicalizeUnsettledProperties: canonicalizeUnsettledProperties$1,
|
|
26676
26534
|
readCurrentState: readCurrentState$32,
|
|
@@ -26931,7 +26789,7 @@ async function readRouteCurrentState(physicalId) {
|
|
|
26931
26789
|
if (!rtbId || !destination) return void 0;
|
|
26932
26790
|
const rtb = (await this.ec2Client.send(new DescribeRouteTablesCommand({ RouteTableIds: [rtbId] }))).RouteTables?.[0];
|
|
26933
26791
|
if (!rtb) return RESOURCE_NOT_FOUND;
|
|
26934
|
-
const route = rtb.Routes?.find((r) => r.DestinationCidrBlock === destination || r.DestinationIpv6CidrBlock === destination || r.DestinationPrefixListId === destination);
|
|
26792
|
+
const route = rtb.Routes?.find((r) => r.Origin !== "EnableVgwRoutePropagation" && r.Origin !== "CreateRouteTable" && (r.DestinationCidrBlock === destination || r.DestinationIpv6CidrBlock === destination || r.DestinationPrefixListId === destination));
|
|
26935
26793
|
if (!route) return RESOURCE_NOT_FOUND;
|
|
26936
26794
|
const result = { RouteTableId: rtbId };
|
|
26937
26795
|
if (route.DestinationCidrBlock !== void 0) result["DestinationCidrBlock"] = route.DestinationCidrBlock;
|
|
@@ -26996,7 +26854,7 @@ async function readSecurityGroupIngressCurrentState(physicalId, properties, cont
|
|
|
26996
26854
|
const match = flat.find((r) => sgRuleKey(r, "ingress") === stateKey);
|
|
26997
26855
|
if (match) return {
|
|
26998
26856
|
GroupId: groupId,
|
|
26999
|
-
...match
|
|
26857
|
+
...withRecordedCidrSpelling(match, properties)
|
|
27000
26858
|
};
|
|
27001
26859
|
const fallback = await this.readSgIngressByIdentity(groupId, flat, properties, context);
|
|
27002
26860
|
return fallback === void 0 ? void 0 : {
|
|
@@ -27038,7 +26896,7 @@ async function readSgIngressByIdentity(groupId, flat, properties, context) {
|
|
|
27038
26896
|
}
|
|
27039
26897
|
if (owned === void 0 || owned.IsEgress === true || owned.GroupId !== groupId || !securityGroupRuleMatchesCfnIngress(owned, properties) || descriptionKey(owned.Description) !== descriptionKey(match["Description"])) return;
|
|
27040
26898
|
return {
|
|
27041
|
-
...match,
|
|
26899
|
+
...withRecordedCidrSpelling(match, properties),
|
|
27042
26900
|
...properties["FromPort"] != null && { FromPort: properties["FromPort"] },
|
|
27043
26901
|
...properties["ToPort"] != null && { ToPort: properties["ToPort"] }
|
|
27044
26902
|
};
|
|
@@ -32294,7 +32152,7 @@ async function readCurrentState$29(physicalId, _logicalId, resourceType, _proper
|
|
|
32294
32152
|
}
|
|
32295
32153
|
function getDriftUnknownPaths$7(resourceType) {
|
|
32296
32154
|
if (resourceType !== "AWS::CloudFront::Distribution") return [];
|
|
32297
|
-
return ["DistributionConfig.CallerReference"
|
|
32155
|
+
return ["DistributionConfig.CallerReference"];
|
|
32298
32156
|
}
|
|
32299
32157
|
function getDriftUnorderedPaths$5(resourceType) {
|
|
32300
32158
|
if (resourceType !== "AWS::CloudFront::Distribution") return [];
|
|
@@ -40720,7 +40578,7 @@ function canonicalizeDriftProperties$1(resourceType, properties) {
|
|
|
40720
40578
|
function canonicalizeUnsettledProperties(resourceType, properties) {
|
|
40721
40579
|
return this.canonicalizeDriftProperties(resourceType, properties);
|
|
40722
40580
|
}
|
|
40723
|
-
async function readUnsettled$
|
|
40581
|
+
async function readUnsettled$5(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
|
|
40724
40582
|
const live = await this.readCurrentState(physicalId, logicalId, resourceType);
|
|
40725
40583
|
if (resourceType !== "AWS::DocDB::DBCluster") return live;
|
|
40726
40584
|
if (live === void 0 || live === RESOURCE_NOT_FOUND) return live;
|
|
@@ -41076,7 +40934,7 @@ var DocDBProvider = class {
|
|
|
41076
40934
|
return canonicalizeUnsettledProperties.call(this, resourceType, properties);
|
|
41077
40935
|
}
|
|
41078
40936
|
readUnsettled(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
|
|
41079
|
-
return readUnsettled$
|
|
40937
|
+
return readUnsettled$5.call(this, physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems);
|
|
41080
40938
|
}
|
|
41081
40939
|
unsettledInTransition(physicalId, _logicalId, resourceType, names, _recordedProperties, desiredProperties) {
|
|
41082
40940
|
return unsettledInTransition$3.call(this, physicalId, _logicalId, resourceType, names, _recordedProperties, desiredProperties);
|
|
@@ -42967,7 +42825,7 @@ async function readCurrentState$21(physicalId, _logicalId, resourceType, propert
|
|
|
42967
42825
|
default: return;
|
|
42968
42826
|
}
|
|
42969
42827
|
}
|
|
42970
|
-
async function readUnsettled$
|
|
42828
|
+
async function readUnsettled$4(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
|
|
42971
42829
|
if (resourceType !== "AWS::Route53::HostedZone") return this.readCurrentState(physicalId, logicalId, resourceType, recordedProperties);
|
|
42972
42830
|
const live = await this.readHostedZone(physicalId, recordedProperties, names.has("QueryLoggingConfig"));
|
|
42973
42831
|
if (live === void 0 || live === RESOURCE_NOT_FOUND) return live;
|
|
@@ -43431,7 +43289,7 @@ var Route53Provider = class {
|
|
|
43431
43289
|
return readCurrentState$21.call(this, physicalId, _logicalId, resourceType, properties);
|
|
43432
43290
|
}
|
|
43433
43291
|
readUnsettled(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
|
|
43434
|
-
return readUnsettled$
|
|
43292
|
+
return readUnsettled$4.call(this, physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems);
|
|
43435
43293
|
}
|
|
43436
43294
|
getDriftUnorderedPaths(resourceType) {
|
|
43437
43295
|
return getDriftUnorderedPaths$2.call(this, resourceType);
|
|
@@ -43468,21 +43326,21 @@ function sanitizeDescription(value) {
|
|
|
43468
43326
|
if (typeof value === "string" && value.length === 0) return void 0;
|
|
43469
43327
|
return value;
|
|
43470
43328
|
}
|
|
43471
|
-
function isPlainObject$
|
|
43329
|
+
function isPlainObject$4(value) {
|
|
43472
43330
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43473
43331
|
}
|
|
43474
43332
|
const DATA_PROTECTION_FALSE_DEFAULTS = ["ExcludeRuleMatchDetails", "ExcludeRateBasedDetails"];
|
|
43475
43333
|
function toCfnDataProtectionConfig(config, baseline) {
|
|
43476
43334
|
const entries = config["DataProtections"];
|
|
43477
43335
|
if (!Array.isArray(entries)) return config;
|
|
43478
|
-
const baseEntries = isPlainObject$
|
|
43336
|
+
const baseEntries = isPlainObject$4(baseline) && Array.isArray(baseline["DataProtections"]) ? baseline["DataProtections"] : [];
|
|
43479
43337
|
return {
|
|
43480
43338
|
...config,
|
|
43481
43339
|
DataProtections: entries.map((entry, i) => {
|
|
43482
|
-
if (!isPlainObject$
|
|
43340
|
+
if (!isPlainObject$4(entry)) return entry;
|
|
43483
43341
|
const base = baseEntries[i];
|
|
43484
43342
|
const converted = { ...entry };
|
|
43485
|
-
for (const key of DATA_PROTECTION_FALSE_DEFAULTS) if (converted[key] === false && !(isPlainObject$
|
|
43343
|
+
for (const key of DATA_PROTECTION_FALSE_DEFAULTS) if (converted[key] === false && !(isPlainObject$4(base) && key in base)) delete converted[key];
|
|
43486
43344
|
return converted;
|
|
43487
43345
|
})
|
|
43488
43346
|
};
|
|
@@ -43508,10 +43366,10 @@ const ARN_REFERENCE_STATEMENT_KEYS = [
|
|
|
43508
43366
|
function toSdkStatement(statement) {
|
|
43509
43367
|
const converted = { ...statement };
|
|
43510
43368
|
const byteMatchStatement = converted["ByteMatchStatement"];
|
|
43511
|
-
if (isPlainObject$
|
|
43369
|
+
if (isPlainObject$4(byteMatchStatement)) converted["ByteMatchStatement"] = toSdkByteMatchStatement(byteMatchStatement);
|
|
43512
43370
|
for (const key of ARN_REFERENCE_STATEMENT_KEYS) {
|
|
43513
43371
|
const reference = converted[key];
|
|
43514
|
-
if (!isPlainObject$
|
|
43372
|
+
if (!isPlainObject$4(reference) || !("Arn" in reference)) continue;
|
|
43515
43373
|
const { Arn: arn, ...rest } = reference;
|
|
43516
43374
|
converted[key] = {
|
|
43517
43375
|
...rest,
|
|
@@ -43519,28 +43377,28 @@ function toSdkStatement(statement) {
|
|
|
43519
43377
|
};
|
|
43520
43378
|
}
|
|
43521
43379
|
const notStatement = converted["NotStatement"];
|
|
43522
|
-
if (isPlainObject$
|
|
43380
|
+
if (isPlainObject$4(notStatement)) {
|
|
43523
43381
|
const nested = notStatement["Statement"];
|
|
43524
|
-
if (isPlainObject$
|
|
43382
|
+
if (isPlainObject$4(nested)) converted["NotStatement"] = {
|
|
43525
43383
|
...notStatement,
|
|
43526
43384
|
Statement: toSdkStatement(nested)
|
|
43527
43385
|
};
|
|
43528
43386
|
}
|
|
43529
43387
|
for (const key of ["AndStatement", "OrStatement"]) {
|
|
43530
43388
|
const combined = converted[key];
|
|
43531
|
-
if (!isPlainObject$
|
|
43389
|
+
if (!isPlainObject$4(combined)) continue;
|
|
43532
43390
|
const nested = combined["Statements"];
|
|
43533
43391
|
if (!Array.isArray(nested)) continue;
|
|
43534
43392
|
converted[key] = {
|
|
43535
43393
|
...combined,
|
|
43536
|
-
Statements: nested.map((item) => isPlainObject$
|
|
43394
|
+
Statements: nested.map((item) => isPlainObject$4(item) ? toSdkStatement(item) : item)
|
|
43537
43395
|
};
|
|
43538
43396
|
}
|
|
43539
43397
|
for (const key of ["RateBasedStatement", "ManagedRuleGroupStatement"]) {
|
|
43540
43398
|
const scoping = converted[key];
|
|
43541
|
-
if (!isPlainObject$
|
|
43399
|
+
if (!isPlainObject$4(scoping)) continue;
|
|
43542
43400
|
const nested = scoping["ScopeDownStatement"];
|
|
43543
|
-
if (!isPlainObject$
|
|
43401
|
+
if (!isPlainObject$4(nested)) continue;
|
|
43544
43402
|
converted[key] = {
|
|
43545
43403
|
...scoping,
|
|
43546
43404
|
ScopeDownStatement: toSdkStatement(nested)
|
|
@@ -43552,9 +43410,9 @@ function toSdkRules(rules) {
|
|
|
43552
43410
|
if (!rules) return [];
|
|
43553
43411
|
if (!Array.isArray(rules)) return rules;
|
|
43554
43412
|
return rules.map((rule) => {
|
|
43555
|
-
if (!isPlainObject$
|
|
43413
|
+
if (!isPlainObject$4(rule)) return rule;
|
|
43556
43414
|
const statement = rule["Statement"];
|
|
43557
|
-
if (!isPlainObject$
|
|
43415
|
+
if (!isPlainObject$4(statement)) return rule;
|
|
43558
43416
|
return {
|
|
43559
43417
|
...rule,
|
|
43560
43418
|
Statement: toSdkStatement(statement)
|
|
@@ -43566,7 +43424,7 @@ function toCfnByteMatchStatement(byteMatchStatement, baseline) {
|
|
|
43566
43424
|
if (raw === void 0) return byteMatchStatement;
|
|
43567
43425
|
const bytes = raw instanceof Uint8Array ? Buffer.from(raw) : typeof raw === "string" ? Buffer.from(raw, "utf8") : void 0;
|
|
43568
43426
|
if (!bytes) return byteMatchStatement;
|
|
43569
|
-
const base = isPlainObject$
|
|
43427
|
+
const base = isPlainObject$4(baseline) ? baseline : void 0;
|
|
43570
43428
|
const baseEncoded = base?.["SearchStringBase64"];
|
|
43571
43429
|
const basePlain = base?.["SearchString"];
|
|
43572
43430
|
const converted = { ...byteMatchStatement };
|
|
@@ -43591,12 +43449,12 @@ function toCfnByteMatchStatement(byteMatchStatement, baseline) {
|
|
|
43591
43449
|
}
|
|
43592
43450
|
function toCfnStatement(statement, baseline) {
|
|
43593
43451
|
const converted = { ...statement };
|
|
43594
|
-
const base = isPlainObject$
|
|
43452
|
+
const base = isPlainObject$4(baseline) ? baseline : void 0;
|
|
43595
43453
|
const byteMatchStatement = converted["ByteMatchStatement"];
|
|
43596
|
-
if (isPlainObject$
|
|
43454
|
+
if (isPlainObject$4(byteMatchStatement)) converted["ByteMatchStatement"] = toCfnByteMatchStatement(byteMatchStatement, base?.["ByteMatchStatement"]);
|
|
43597
43455
|
for (const key of ARN_REFERENCE_STATEMENT_KEYS) {
|
|
43598
43456
|
const reference = converted[key];
|
|
43599
|
-
if (!isPlainObject$
|
|
43457
|
+
if (!isPlainObject$4(reference) || !("ARN" in reference)) continue;
|
|
43600
43458
|
const { ARN: arn, ...rest } = reference;
|
|
43601
43459
|
converted[key] = {
|
|
43602
43460
|
...rest,
|
|
@@ -43604,37 +43462,37 @@ function toCfnStatement(statement, baseline) {
|
|
|
43604
43462
|
};
|
|
43605
43463
|
}
|
|
43606
43464
|
const notStatement = converted["NotStatement"];
|
|
43607
|
-
if (isPlainObject$
|
|
43465
|
+
if (isPlainObject$4(notStatement)) {
|
|
43608
43466
|
const nested = notStatement["Statement"];
|
|
43609
|
-
if (isPlainObject$
|
|
43467
|
+
if (isPlainObject$4(nested)) {
|
|
43610
43468
|
const baseNot = base?.["NotStatement"];
|
|
43611
43469
|
converted["NotStatement"] = {
|
|
43612
43470
|
...notStatement,
|
|
43613
|
-
Statement: toCfnStatement(nested, isPlainObject$
|
|
43471
|
+
Statement: toCfnStatement(nested, isPlainObject$4(baseNot) ? baseNot["Statement"] : void 0)
|
|
43614
43472
|
};
|
|
43615
43473
|
}
|
|
43616
43474
|
}
|
|
43617
43475
|
for (const key of ["AndStatement", "OrStatement"]) {
|
|
43618
43476
|
const combined = converted[key];
|
|
43619
|
-
if (!isPlainObject$
|
|
43477
|
+
if (!isPlainObject$4(combined)) continue;
|
|
43620
43478
|
const nested = combined["Statements"];
|
|
43621
43479
|
if (!Array.isArray(nested)) continue;
|
|
43622
43480
|
const baseCombined = base?.[key];
|
|
43623
|
-
const baseList = isPlainObject$
|
|
43481
|
+
const baseList = isPlainObject$4(baseCombined) && Array.isArray(baseCombined["Statements"]) ? baseCombined["Statements"] : void 0;
|
|
43624
43482
|
converted[key] = {
|
|
43625
43483
|
...combined,
|
|
43626
|
-
Statements: nested.map((item, i) => isPlainObject$
|
|
43484
|
+
Statements: nested.map((item, i) => isPlainObject$4(item) ? toCfnStatement(item, baseList?.[i]) : item)
|
|
43627
43485
|
};
|
|
43628
43486
|
}
|
|
43629
43487
|
for (const key of ["RateBasedStatement", "ManagedRuleGroupStatement"]) {
|
|
43630
43488
|
const scoping = converted[key];
|
|
43631
|
-
if (!isPlainObject$
|
|
43489
|
+
if (!isPlainObject$4(scoping)) continue;
|
|
43632
43490
|
const nested = scoping["ScopeDownStatement"];
|
|
43633
|
-
if (!isPlainObject$
|
|
43491
|
+
if (!isPlainObject$4(nested)) continue;
|
|
43634
43492
|
const baseScoping = base?.[key];
|
|
43635
43493
|
converted[key] = {
|
|
43636
43494
|
...scoping,
|
|
43637
|
-
ScopeDownStatement: toCfnStatement(nested, isPlainObject$
|
|
43495
|
+
ScopeDownStatement: toCfnStatement(nested, isPlainObject$4(baseScoping) ? baseScoping["ScopeDownStatement"] : void 0)
|
|
43638
43496
|
};
|
|
43639
43497
|
}
|
|
43640
43498
|
return converted;
|
|
@@ -43643,13 +43501,13 @@ function toCfnRules(rules, baselineRules) {
|
|
|
43643
43501
|
if (!Array.isArray(rules)) return [];
|
|
43644
43502
|
const baseList = Array.isArray(baselineRules) ? baselineRules : void 0;
|
|
43645
43503
|
return rules.map((rule, i) => {
|
|
43646
|
-
if (!isPlainObject$
|
|
43504
|
+
if (!isPlainObject$4(rule)) return rule;
|
|
43647
43505
|
const statement = rule["Statement"];
|
|
43648
|
-
if (!isPlainObject$
|
|
43506
|
+
if (!isPlainObject$4(statement)) return rule;
|
|
43649
43507
|
const baseRule = baseList?.[i];
|
|
43650
43508
|
return {
|
|
43651
43509
|
...rule,
|
|
43652
|
-
Statement: toCfnStatement(statement, isPlainObject$
|
|
43510
|
+
Statement: toCfnStatement(statement, isPlainObject$4(baseRule) ? baseRule["Statement"] : void 0)
|
|
43653
43511
|
};
|
|
43654
43512
|
});
|
|
43655
43513
|
}
|
|
@@ -46079,10 +45937,10 @@ function unappliedDnsConfigMembers(properties, previousProperties, changedProper
|
|
|
46079
45937
|
if (changedProperties !== void 0 && !changedProperties.has("DnsConfig")) return [];
|
|
46080
45938
|
const desired = properties["DnsConfig"];
|
|
46081
45939
|
const previous = previousProperties["DnsConfig"];
|
|
46082
|
-
if (!isPlainObject$
|
|
45940
|
+
if (!isPlainObject$3(desired) || !isPlainObject$3(previous)) return [];
|
|
46083
45941
|
return ["NamespaceId", "RoutingPolicy"].filter((member) => !sameAsRecorded(desired[member], previous[member]));
|
|
46084
45942
|
}
|
|
46085
|
-
function isPlainObject$
|
|
45943
|
+
function isPlainObject$3(value) {
|
|
46086
45944
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
46087
45945
|
}
|
|
46088
45946
|
function isRecordedStandIn(value) {
|
|
@@ -53821,7 +53679,7 @@ function getDriftUnorderedPaths$1(resourceType) {
|
|
|
53821
53679
|
if (resourceType !== "AWS::Kinesis::Stream") return [];
|
|
53822
53680
|
return ["DesiredShardLevelMetrics"];
|
|
53823
53681
|
}
|
|
53824
|
-
async function readUnsettled$
|
|
53682
|
+
async function readUnsettled$3(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
|
|
53825
53683
|
const live = await this.readCurrentState(physicalId, logicalId, resourceType);
|
|
53826
53684
|
if (typeof live !== "object" || live === null) return live;
|
|
53827
53685
|
const out = { ...live };
|
|
@@ -53974,7 +53832,7 @@ var KinesisStreamProvider = class {
|
|
|
53974
53832
|
return warnUndeclaredLiveMetrics.call(this, physicalId, named, warn, mask);
|
|
53975
53833
|
}
|
|
53976
53834
|
readUnsettled(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
|
|
53977
|
-
return readUnsettled$
|
|
53835
|
+
return readUnsettled$3.call(this, physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems);
|
|
53978
53836
|
}
|
|
53979
53837
|
unsettledInTransition(physicalId, _logicalId, _resourceType, names) {
|
|
53980
53838
|
return unsettledInTransition$2.call(this, physicalId, _logicalId, _resourceType, names);
|
|
@@ -55271,7 +55129,7 @@ async function unsettledInTransition$1(physicalId, _logicalId, _resourceType, na
|
|
|
55271
55129
|
return names;
|
|
55272
55130
|
}
|
|
55273
55131
|
}
|
|
55274
|
-
async function readUnsettled$
|
|
55132
|
+
async function readUnsettled$2(physicalId, logicalId, resourceType, names) {
|
|
55275
55133
|
const live = await this.readCurrentState(physicalId, logicalId, resourceType);
|
|
55276
55134
|
if (typeof live !== "object" || live === null) return live;
|
|
55277
55135
|
const state = (await this.describe(physicalId)).CurrentState;
|
|
@@ -55414,7 +55272,7 @@ var PipesPipeProvider = class {
|
|
|
55414
55272
|
return unsettledInTransition$1.call(this, physicalId, _logicalId, _resourceType, names);
|
|
55415
55273
|
}
|
|
55416
55274
|
readUnsettled(physicalId, logicalId, resourceType, names) {
|
|
55417
|
-
return readUnsettled$
|
|
55275
|
+
return readUnsettled$2.call(this, physicalId, logicalId, resourceType, names);
|
|
55418
55276
|
}
|
|
55419
55277
|
async readStateForDelete(name) {
|
|
55420
55278
|
try {
|
|
@@ -57565,7 +57423,7 @@ function readWindowsConfiguration(windows) {
|
|
|
57565
57423
|
putIfDefined(config, "DailyAutomaticBackupStartTime", windows.DailyAutomaticBackupStartTime);
|
|
57566
57424
|
putIfDefined(config, "AutomaticBackupRetentionDays", windows.AutomaticBackupRetentionDays);
|
|
57567
57425
|
putIfDefined(config, "CopyTagsToBackups", windows.CopyTagsToBackups);
|
|
57568
|
-
if (windows.Aliases !== void 0) config["Aliases"] = windows.Aliases.map((alias) => alias.Name).filter((name) => name !== void 0);
|
|
57426
|
+
if (windows.Aliases !== void 0) config["Aliases"] = windows.Aliases.filter((alias) => alias.Lifecycle !== "CREATE_FAILED" && alias.Lifecycle !== "DELETING").map((alias) => alias.Name).filter((name) => name !== void 0);
|
|
57569
57427
|
if (windows.SelfManagedActiveDirectoryConfiguration) {
|
|
57570
57428
|
const ad = windows.SelfManagedActiveDirectoryConfiguration;
|
|
57571
57429
|
const adConfig = {};
|
|
@@ -57933,6 +57791,93 @@ var FSxFileSystemProvider = class {
|
|
|
57933
57791
|
}
|
|
57934
57792
|
};
|
|
57935
57793
|
|
|
57794
|
+
// src/provisioning/drift-declared-projection.ts
|
|
57795
|
+
function filledDefaultsFrom(table) {
|
|
57796
|
+
const matches = (key, value) => {
|
|
57797
|
+
if (Object.hasOwn(table, key)) {
|
|
57798
|
+
const json = JSON.stringify(value);
|
|
57799
|
+
if (table[key].some((d) => JSON.stringify(d) === json)) return true;
|
|
57800
|
+
}
|
|
57801
|
+
return isPlainObject$2(value) && Object.keys(value).length > 0 && Object.entries(value).every(([k, v]) => matches(k, v));
|
|
57802
|
+
};
|
|
57803
|
+
return matches;
|
|
57804
|
+
}
|
|
57805
|
+
const NO_FILLED_DEFAULTS = () => false;
|
|
57806
|
+
function isPlainObject$2(value) {
|
|
57807
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
57808
|
+
}
|
|
57809
|
+
function isScalar$1(value) {
|
|
57810
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
57811
|
+
}
|
|
57812
|
+
function projectOntoDeclared(declared, actual, isFilled = NO_FILLED_DEFAULTS) {
|
|
57813
|
+
if (isPlainObject$2(declared) && isPlainObject$2(actual)) {
|
|
57814
|
+
const out = {};
|
|
57815
|
+
let changed = false;
|
|
57816
|
+
for (const [key, value] of Object.entries(actual)) {
|
|
57817
|
+
if (!Object.hasOwn(declared, key)) {
|
|
57818
|
+
if (isFilled(key, value)) changed = true;
|
|
57819
|
+
else out[key] = value;
|
|
57820
|
+
continue;
|
|
57821
|
+
}
|
|
57822
|
+
const projected = projectOntoDeclared(declared[key], value, isFilled);
|
|
57823
|
+
if (projected !== value) changed = true;
|
|
57824
|
+
out[key] = projected;
|
|
57825
|
+
}
|
|
57826
|
+
return changed ? out : actual;
|
|
57827
|
+
}
|
|
57828
|
+
if (Array.isArray(declared) && Array.isArray(actual)) {
|
|
57829
|
+
let changed = false;
|
|
57830
|
+
const out = actual.map((element, i) => {
|
|
57831
|
+
if (i >= declared.length) return element;
|
|
57832
|
+
const projected = projectOntoDeclared(declared[i], element, isFilled);
|
|
57833
|
+
if (projected !== element) changed = true;
|
|
57834
|
+
return projected;
|
|
57835
|
+
});
|
|
57836
|
+
return changed ? out : actual;
|
|
57837
|
+
}
|
|
57838
|
+
if (isScalar$1(declared) && isScalar$1(actual) && typeof declared !== typeof actual && String(declared) === String(actual)) return declared;
|
|
57839
|
+
return actual;
|
|
57840
|
+
}
|
|
57841
|
+
function holdsUnsentValue(value) {
|
|
57842
|
+
if (typeof value === "string") return value === "***" || value.includes("{{resolve:");
|
|
57843
|
+
if (Array.isArray(value)) return value.some(holdsUnsentValue);
|
|
57844
|
+
if (isPlainObject$2(value)) return Object.values(value).some(holdsUnsentValue);
|
|
57845
|
+
return false;
|
|
57846
|
+
}
|
|
57847
|
+
function projectDeclaredDriftPair(keys, baseline, aws, properties, isFilled = NO_FILLED_DEFAULTS, fillUnread = false) {
|
|
57848
|
+
let nextBaseline = baseline;
|
|
57849
|
+
let nextAws = aws;
|
|
57850
|
+
for (const key of keys) {
|
|
57851
|
+
const declared = properties?.[key];
|
|
57852
|
+
if (declared === void 0 || declared === null) continue;
|
|
57853
|
+
const fallback = holdsUnsentValue(declared) ? aws[key] : declared;
|
|
57854
|
+
if (!Object.hasOwn(baseline, key) && fallback === void 0) continue;
|
|
57855
|
+
const projectedBase = projectOntoDeclared(declared, Object.hasOwn(baseline, key) ? baseline[key] : fallback, isFilled);
|
|
57856
|
+
if (!Object.hasOwn(baseline, key) || projectedBase !== baseline[key]) {
|
|
57857
|
+
if (nextBaseline === baseline) nextBaseline = { ...baseline };
|
|
57858
|
+
nextBaseline[key] = projectedBase;
|
|
57859
|
+
}
|
|
57860
|
+
if (Object.hasOwn(aws, key)) {
|
|
57861
|
+
const projectedAws = projectOntoDeclared(declared, aws[key], isFilled);
|
|
57862
|
+
if (projectedAws !== aws[key]) {
|
|
57863
|
+
if (nextAws === aws) nextAws = { ...aws };
|
|
57864
|
+
nextAws[key] = projectedAws;
|
|
57865
|
+
}
|
|
57866
|
+
} else if (fillUnread && Object.hasOwn(nextBaseline, key)) {
|
|
57867
|
+
if (nextAws === aws) nextAws = { ...aws };
|
|
57868
|
+
nextAws[key] = nextBaseline[key];
|
|
57869
|
+
}
|
|
57870
|
+
}
|
|
57871
|
+
return {
|
|
57872
|
+
baseline: nextBaseline,
|
|
57873
|
+
aws: nextAws
|
|
57874
|
+
};
|
|
57875
|
+
}
|
|
57876
|
+
function undeclaredDriftKeys(keys, properties) {
|
|
57877
|
+
if (properties === void 0 || Object.keys(properties).length === 0) return [...keys];
|
|
57878
|
+
return keys.filter((key) => properties[key] === void 0 || properties[key] === null);
|
|
57879
|
+
}
|
|
57880
|
+
|
|
57936
57881
|
// src/provisioning/providers/emr-cluster/shared.ts
|
|
57937
57882
|
const DEFAULT_MAX_WAIT_MS$2 = 36e5;
|
|
57938
57883
|
const DEFAULT_POLL_INTERVAL_MS$2 = 15e3;
|
|
@@ -59780,14 +59725,27 @@ async function describeClusterOrUndefined(clusterId) {
|
|
|
59780
59725
|
throw err;
|
|
59781
59726
|
}
|
|
59782
59727
|
}
|
|
59783
|
-
async function readCurrentState$7(physicalId, _logicalId, _resourceType) {
|
|
59728
|
+
async function readCurrentState$7(physicalId, _logicalId, _resourceType, properties) {
|
|
59784
59729
|
const cluster = await this.describeClusterOrUndefined(physicalId);
|
|
59785
59730
|
if (!cluster) return void 0;
|
|
59786
59731
|
if (cluster.Status?.State && TERMINAL_STATES.has(cluster.Status.State)) return RESOURCE_NOT_FOUND;
|
|
59787
59732
|
let instanceGroups = [];
|
|
59788
59733
|
let instanceFleets = [];
|
|
59789
|
-
|
|
59790
|
-
|
|
59734
|
+
const declares = (key) => properties?.[key] != null;
|
|
59735
|
+
let policies;
|
|
59736
|
+
try {
|
|
59737
|
+
[, policies] = await Promise.all([cluster.InstanceCollectionType === "INSTANCE_FLEET" ? this.listInstanceFleets(physicalId).then((fleets) => {
|
|
59738
|
+
instanceFleets = fleets;
|
|
59739
|
+
}) : this.listInstanceGroups(physicalId).then((groups) => {
|
|
59740
|
+
instanceGroups = groups;
|
|
59741
|
+
}), readDeclaredPolicies.call(this, physicalId, {
|
|
59742
|
+
autoTermination: declares("AutoTerminationPolicy"),
|
|
59743
|
+
managedScaling: declares("ManagedScalingPolicy")
|
|
59744
|
+
})]);
|
|
59745
|
+
} catch (err) {
|
|
59746
|
+
if (err instanceof InvalidRequestException) return void 0;
|
|
59747
|
+
throw err;
|
|
59748
|
+
}
|
|
59791
59749
|
const out = {
|
|
59792
59750
|
Name: cluster.Name ?? "",
|
|
59793
59751
|
ReleaseLabel: cluster.ReleaseLabel ?? "",
|
|
@@ -59807,7 +59765,8 @@ async function readCurrentState$7(physicalId, _logicalId, _resourceType) {
|
|
|
59807
59765
|
JobFlowRole: cluster.Ec2InstanceAttributes?.IamInstanceProfile ?? "",
|
|
59808
59766
|
Applications: cluster.Applications ?? [],
|
|
59809
59767
|
Tags: normalizeAwsTagsToCfn(cluster.Tags),
|
|
59810
|
-
Instances: this.reverseInstancesToCfn(cluster, instanceGroups, instanceFleets)
|
|
59768
|
+
Instances: this.reverseInstancesToCfn(cluster, instanceGroups, instanceFleets),
|
|
59769
|
+
...policies
|
|
59811
59770
|
};
|
|
59812
59771
|
if (typeof cluster.SessionEnabled === "boolean") out["SessionEnabled"] = cluster.SessionEnabled;
|
|
59813
59772
|
const cw = cluster.MonitoringConfiguration?.CloudWatchLogConfiguration;
|
|
@@ -59820,6 +59779,35 @@ async function readCurrentState$7(physicalId, _logicalId, _resourceType) {
|
|
|
59820
59779
|
}).filter(([, v]) => v !== void 0)) };
|
|
59821
59780
|
return out;
|
|
59822
59781
|
}
|
|
59782
|
+
const POLICY_KEYS = ["AutoTerminationPolicy", "ManagedScalingPolicy"];
|
|
59783
|
+
async function readUnsettled$1(physicalId, logicalId, resourceType, names, recordedProperties) {
|
|
59784
|
+
const wanted = POLICY_KEYS.filter((key) => names.has(key));
|
|
59785
|
+
const properties = { ...recordedProperties };
|
|
59786
|
+
for (const key of wanted) if (properties[key] == null) properties[key] = {};
|
|
59787
|
+
const live = await this.readCurrentState(physicalId, logicalId, resourceType, properties);
|
|
59788
|
+
if (live === void 0 || live === RESOURCE_NOT_FOUND) return live;
|
|
59789
|
+
const out = { ...live };
|
|
59790
|
+
for (const key of wanted) {
|
|
59791
|
+
if (!Object.hasOwn(out, key)) throw new Error(`the ${key} of EMR cluster ${logicalId} could not be read`);
|
|
59792
|
+
const value = out[key];
|
|
59793
|
+
if (typeof value === "object" && value !== null && Object.keys(value).length === 0) delete out[key];
|
|
59794
|
+
}
|
|
59795
|
+
return out;
|
|
59796
|
+
}
|
|
59797
|
+
async function readDeclaredPolicies(clusterId, wanted) {
|
|
59798
|
+
const readOne = (key, action, send) => send().then((value) => ({ value }), (err) => {
|
|
59799
|
+
if (err instanceof InvalidRequestException) throw err;
|
|
59800
|
+
const name = err?.name;
|
|
59801
|
+
const errorClass = typeof name === "string" && /^[A-Za-z0-9]{1,64}$/.test(name) ? name : "an error";
|
|
59802
|
+
const hint = isPermissionDenial(err) ? `; allow elasticmapreduce:${action}` : "";
|
|
59803
|
+
this.logger.warn(safeMsg`EMR cluster ${clusterId}: ${key} not read (${errorClass}${hint}).`);
|
|
59804
|
+
});
|
|
59805
|
+
const [autoTermination, managedScaling] = await Promise.all([wanted.autoTermination ? readOne("AutoTerminationPolicy", "GetAutoTerminationPolicy", () => this.getClient().send(new GetAutoTerminationPolicyCommand({ ClusterId: clusterId })).then((resp) => resp.AutoTerminationPolicy)) : Promise.resolve(void 0), wanted.managedScaling ? readOne("ManagedScalingPolicy", "GetManagedScalingPolicy", () => this.getClient().send(new GetManagedScalingPolicyCommand({ ClusterId: clusterId })).then((resp) => resp.ManagedScalingPolicy)) : Promise.resolve(void 0)]);
|
|
59806
|
+
const out = {};
|
|
59807
|
+
if (autoTermination !== void 0) out["AutoTerminationPolicy"] = structuredClone(autoTermination.value ?? {});
|
|
59808
|
+
if (managedScaling !== void 0) out["ManagedScalingPolicy"] = structuredClone(managedScaling.value ?? {});
|
|
59809
|
+
return out;
|
|
59810
|
+
}
|
|
59823
59811
|
async function listInstanceGroups(clusterId) {
|
|
59824
59812
|
const groups = [];
|
|
59825
59813
|
let marker;
|
|
@@ -59909,6 +59897,7 @@ function reverseInstanceFleet(f) {
|
|
|
59909
59897
|
}
|
|
59910
59898
|
|
|
59911
59899
|
// src/provisioning/providers/emr-cluster-provider.ts
|
|
59900
|
+
const EMR_DECLARED_POLICY_KEYS = ["AutoTerminationPolicy", "ManagedScalingPolicy"];
|
|
59912
59901
|
var EMRClusterProvider = class {
|
|
59913
59902
|
disableCcApiFallback = true;
|
|
59914
59903
|
client;
|
|
@@ -60042,14 +60031,20 @@ var EMRClusterProvider = class {
|
|
|
60042
60031
|
describeClusterOrUndefined(clusterId) {
|
|
60043
60032
|
return describeClusterOrUndefined.call(this, clusterId);
|
|
60044
60033
|
}
|
|
60045
|
-
readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
60046
|
-
return readCurrentState$7.call(this, physicalId, _logicalId, _resourceType);
|
|
60034
|
+
readCurrentState(physicalId, _logicalId, _resourceType, properties) {
|
|
60035
|
+
return readCurrentState$7.call(this, physicalId, _logicalId, _resourceType, properties);
|
|
60047
60036
|
}
|
|
60048
|
-
|
|
60037
|
+
readUnsettled(physicalId, logicalId, resourceType, names, recordedProperties) {
|
|
60038
|
+
return readUnsettled$1.call(this, physicalId, logicalId, resourceType, names, recordedProperties);
|
|
60039
|
+
}
|
|
60040
|
+
canonicalizeDriftPair(_resourceType, baseline, aws, properties) {
|
|
60041
|
+
return Promise.resolve(projectDeclaredDriftPair(EMR_DECLARED_POLICY_KEYS, baseline, aws, properties, void 0, true));
|
|
60042
|
+
}
|
|
60043
|
+
getDriftUnknownPaths(_resourceType, properties) {
|
|
60049
60044
|
return [
|
|
60045
|
+
...undeclaredDriftKeys(EMR_DECLARED_POLICY_KEYS, properties),
|
|
60050
60046
|
"AdditionalInfo",
|
|
60051
60047
|
"Applications",
|
|
60052
|
-
"AutoTerminationPolicy",
|
|
60053
60048
|
"BootstrapActions",
|
|
60054
60049
|
"Configurations",
|
|
60055
60050
|
"Instances.HadoopVersion",
|
|
@@ -60070,7 +60065,6 @@ var EMRClusterProvider = class {
|
|
|
60070
60065
|
"Instances.TaskInstanceFleets",
|
|
60071
60066
|
"Instances.TaskInstanceGroups",
|
|
60072
60067
|
"KerberosAttributes",
|
|
60073
|
-
"ManagedScalingPolicy",
|
|
60074
60068
|
"MonitoringConfiguration",
|
|
60075
60069
|
"PlacementGroupConfigs",
|
|
60076
60070
|
"SessionEnabled",
|
|
@@ -62946,6 +62940,38 @@ function readRepoList(kind, value, side) {
|
|
|
62946
62940
|
onlySecret: Array.isArray(value) && value.every((e) => isWellFormedRepoEntry(kind, e, side, true))
|
|
62947
62941
|
};
|
|
62948
62942
|
}
|
|
62943
|
+
function triggersToCfn(triggers) {
|
|
62944
|
+
return (triggers ?? []).map((t) => ({
|
|
62945
|
+
Name: t.name ?? "",
|
|
62946
|
+
DestinationArn: t.destinationArn ?? "",
|
|
62947
|
+
...t.customData !== void 0 && { CustomData: t.customData },
|
|
62948
|
+
Branches: [...t.branches ?? []],
|
|
62949
|
+
Events: [...t.events ?? []]
|
|
62950
|
+
}));
|
|
62951
|
+
}
|
|
62952
|
+
function canonicalizeTriggers(properties) {
|
|
62953
|
+
const list = properties["Triggers"];
|
|
62954
|
+
if (!Array.isArray(list)) return properties;
|
|
62955
|
+
const asStrings = (v) => Array.isArray(v) ? v.map((m) => scalarToString(m)) : [];
|
|
62956
|
+
let changed = false;
|
|
62957
|
+
const next = list.map((entry) => {
|
|
62958
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return entry;
|
|
62959
|
+
const t = entry;
|
|
62960
|
+
const out = { ...t };
|
|
62961
|
+
for (const key of ["Name", "DestinationArn"]) if (key in t && typeof t[key] !== "string") out[key] = scalarToString(t[key]);
|
|
62962
|
+
if (t["CustomData"] === null) delete out["CustomData"];
|
|
62963
|
+
else if (t["CustomData"] !== void 0 && typeof t["CustomData"] !== "string") out["CustomData"] = scalarToString(t["CustomData"]);
|
|
62964
|
+
out["Branches"] = asStrings(t["Branches"]);
|
|
62965
|
+
out["Events"] = asStrings(t["Events"]);
|
|
62966
|
+
if (Object.keys(out).length === Object.keys(t).length && Object.keys(out).every((k) => JSON.stringify(out[k]) === JSON.stringify(t[k]))) return entry;
|
|
62967
|
+
changed = true;
|
|
62968
|
+
return out;
|
|
62969
|
+
});
|
|
62970
|
+
return changed ? {
|
|
62971
|
+
...properties,
|
|
62972
|
+
Triggers: next
|
|
62973
|
+
} : properties;
|
|
62974
|
+
}
|
|
62949
62975
|
|
|
62950
62976
|
// src/provisioning/providers/codecommit-repository/create.ts
|
|
62951
62977
|
async function create$4(logicalId, resourceType, properties, context) {
|
|
@@ -63301,10 +63327,20 @@ async function readCurrentState$3(physicalId, _logicalId, _resourceType) {
|
|
|
63301
63327
|
throw err;
|
|
63302
63328
|
}
|
|
63303
63329
|
if (!metadata) return void 0;
|
|
63330
|
+
const arn = metadata.Arn;
|
|
63331
|
+
const repositoryName = metadata.repositoryName ?? physicalId;
|
|
63304
63332
|
let tags = [];
|
|
63305
|
-
|
|
63306
|
-
|
|
63307
|
-
|
|
63333
|
+
let triggers;
|
|
63334
|
+
try {
|
|
63335
|
+
const [tagsResp, triggersResp] = await Promise.all([arn ? this.getClient().send(new ListTagsForResourceCommand$18({ resourceArn: arn })) : Promise.resolve(void 0), this.getClient().send(new GetRepositoryTriggersCommand({ repositoryName })).catch((err) => {
|
|
63336
|
+
if (err instanceof RepositoryDoesNotExistException) throw err;
|
|
63337
|
+
const name = err?.name;
|
|
63338
|
+
const errorClass = typeof name === "string" && /^[A-Za-z0-9]{1,64}$/.test(name) ? name : "an error";
|
|
63339
|
+
const hint = isPermissionDenial(err) ? "; allow codecommit:GetRepositoryTriggers" : "";
|
|
63340
|
+
this.logger.warn(safeMsg`CodeCommit repository ${repositoryName}: Triggers not read (${errorClass}${hint}), so they are not compared.`);
|
|
63341
|
+
})]);
|
|
63342
|
+
if (tagsResp) tags = normalizeAwsTagsToCfn(tagsResp.tags);
|
|
63343
|
+
if (triggersResp) triggers = triggersToCfn(triggersResp.triggers);
|
|
63308
63344
|
} catch (err) {
|
|
63309
63345
|
if (err instanceof RepositoryDoesNotExistException) return RESOURCE_NOT_FOUND;
|
|
63310
63346
|
throw err;
|
|
@@ -63313,7 +63349,8 @@ async function readCurrentState$3(physicalId, _logicalId, _resourceType) {
|
|
|
63313
63349
|
RepositoryName: metadata.repositoryName ?? "",
|
|
63314
63350
|
RepositoryDescription: metadata.repositoryDescription ?? "",
|
|
63315
63351
|
KmsKeyId: metadata.kmsKeyId ?? "",
|
|
63316
|
-
Tags: tags
|
|
63352
|
+
Tags: tags,
|
|
63353
|
+
...triggers !== void 0 && { Triggers: triggers }
|
|
63317
63354
|
};
|
|
63318
63355
|
}
|
|
63319
63356
|
async function importImpl$3(input) {
|
|
@@ -63437,7 +63474,53 @@ var CodeCommitRepositoryProvider = class {
|
|
|
63437
63474
|
return readCurrentState$3.call(this, physicalId, _logicalId, _resourceType);
|
|
63438
63475
|
}
|
|
63439
63476
|
getDriftUnknownPaths(_resourceType) {
|
|
63440
|
-
return ["Code"
|
|
63477
|
+
return ["Code"];
|
|
63478
|
+
}
|
|
63479
|
+
canonicalizeDriftProperties(_resourceType, properties) {
|
|
63480
|
+
return canonicalizeTriggers(properties);
|
|
63481
|
+
}
|
|
63482
|
+
canonicalizeDriftPair(_resourceType, baseline, aws, properties = {}) {
|
|
63483
|
+
const inAws = Object.hasOwn(aws, "Triggers");
|
|
63484
|
+
const inBaseline = Object.hasOwn(baseline, "Triggers");
|
|
63485
|
+
if (!inAws && inBaseline) return Promise.resolve({
|
|
63486
|
+
baseline,
|
|
63487
|
+
aws: {
|
|
63488
|
+
...aws,
|
|
63489
|
+
Triggers: baseline["Triggers"]
|
|
63490
|
+
}
|
|
63491
|
+
});
|
|
63492
|
+
if (inAws && !inBaseline && Array.isArray(properties["Triggers"])) {
|
|
63493
|
+
const declared = canonicalizeTriggers({ Triggers: properties["Triggers"] })["Triggers"];
|
|
63494
|
+
return Promise.resolve({
|
|
63495
|
+
baseline: {
|
|
63496
|
+
...baseline,
|
|
63497
|
+
Triggers: declared
|
|
63498
|
+
},
|
|
63499
|
+
aws
|
|
63500
|
+
});
|
|
63501
|
+
}
|
|
63502
|
+
return Promise.resolve({
|
|
63503
|
+
baseline,
|
|
63504
|
+
aws
|
|
63505
|
+
});
|
|
63506
|
+
}
|
|
63507
|
+
async unsettledInTransition(physicalId, _logicalId, _resourceType, names) {
|
|
63508
|
+
if (!names.has("Triggers")) return /* @__PURE__ */ new Set();
|
|
63509
|
+
try {
|
|
63510
|
+
await this.getClient().send(new GetRepositoryTriggersCommand({ repositoryName: physicalId }));
|
|
63511
|
+
return /* @__PURE__ */ new Set();
|
|
63512
|
+
} catch (err) {
|
|
63513
|
+
if (err instanceof RepositoryDoesNotExistException) return /* @__PURE__ */ new Set();
|
|
63514
|
+
return /* @__PURE__ */ new Set(["Triggers"]);
|
|
63515
|
+
}
|
|
63516
|
+
}
|
|
63517
|
+
async readUnsettled(physicalId, logicalId, resourceType, names) {
|
|
63518
|
+
const live = await this.readCurrentState(physicalId, logicalId, resourceType);
|
|
63519
|
+
if (names.has("Triggers") && live !== void 0 && live !== RESOURCE_NOT_FOUND && !Object.hasOwn(live, "Triggers")) throw new Error(`the Triggers of CodeCommit repository ${logicalId} could not be read`);
|
|
63520
|
+
return live;
|
|
63521
|
+
}
|
|
63522
|
+
canonicalizeUnsettledProperties(_resourceType, properties) {
|
|
63523
|
+
return canonicalizeTriggers(properties);
|
|
63441
63524
|
}
|
|
63442
63525
|
import(input) {
|
|
63443
63526
|
return importImpl$3.call(this, input);
|
|
@@ -63454,6 +63537,30 @@ var CodeCommitRepositoryProvider = class {
|
|
|
63454
63537
|
};
|
|
63455
63538
|
|
|
63456
63539
|
// src/provisioning/providers/dlm-lifecycle-policy-provider.ts
|
|
63540
|
+
const DEFAULT_POLICY_SHORTHAND_KEYS = [
|
|
63541
|
+
"CreateInterval",
|
|
63542
|
+
"RetainInterval",
|
|
63543
|
+
"CopyTags",
|
|
63544
|
+
"ExtendDeletion",
|
|
63545
|
+
"CrossRegionCopyTargets",
|
|
63546
|
+
"Exclusions"
|
|
63547
|
+
];
|
|
63548
|
+
const DLM_FILLED_DEFAULTS = filledDefaultsFrom({
|
|
63549
|
+
ResourceLocations: [["CLOUD"]],
|
|
63550
|
+
PolicyLanguage: ["STANDARD", "SIMPLIFIED"],
|
|
63551
|
+
PolicyType: ["EBS_SNAPSHOT_MANAGEMENT"],
|
|
63552
|
+
ResourceType: ["VOLUME", "INSTANCE"],
|
|
63553
|
+
CopyTags: [false],
|
|
63554
|
+
Location: ["CLOUD"],
|
|
63555
|
+
Interval: [0],
|
|
63556
|
+
ExcludeVolumeTypes: [[]],
|
|
63557
|
+
ExcludeTags: [[]],
|
|
63558
|
+
CreateInterval: [1],
|
|
63559
|
+
RetainInterval: [7],
|
|
63560
|
+
ExtendDeletion: [false],
|
|
63561
|
+
ExcludeBootVolumes: [false]
|
|
63562
|
+
});
|
|
63563
|
+
const DLM_CONFIGURATION_KEYS = ["PolicyDetails", ...DEFAULT_POLICY_SHORTHAND_KEYS];
|
|
63457
63564
|
const KEPT_ON_REMOVAL = [
|
|
63458
63565
|
"Description",
|
|
63459
63566
|
"ExecutionRoleArn",
|
|
@@ -63626,6 +63733,8 @@ var DLMLifecyclePolicyProvider = class {
|
|
|
63626
63733
|
assertRegionMatch(context?.expectedRegion ? await this.getClient().config.region() : void 0, context?.expectedRegion, resourceType, logicalId, physicalId, "pre-update");
|
|
63627
63734
|
refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
|
|
63628
63735
|
if (JSON.stringify(properties["DefaultPolicy"]) !== JSON.stringify(previousProperties["DefaultPolicy"])) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `DefaultPolicy cannot be changed in place; re-run with ${deployReplaceCommand()} to recreate the policy (--replace is a boolean flag and takes no resource id; it applies to every resource in the run whose in-place update is refused)`);
|
|
63736
|
+
const shorthandSent = DEFAULT_POLICY_SHORTHAND_KEYS.filter((key) => properties[key] != null);
|
|
63737
|
+
if (properties["PolicyDetails"] != null && shorthandSent.length > 0) throw new ProvisioningError(`Failed to update DLM Lifecycle Policy ${logicalId}: PolicyDetails and ${shorthandSent.join(", ")} are both set; DLM takes a default policy's fields either at the top level or inside PolicyDetails, not both`, resourceType, logicalId, physicalId);
|
|
63629
63738
|
this.logger.debug(`Updating DLM Lifecycle Policy ${logicalId} (${physicalId})`);
|
|
63630
63739
|
try {
|
|
63631
63740
|
await this.getClient().send(new UpdateLifecyclePolicyCommand({
|
|
@@ -63698,14 +63807,23 @@ var DLMLifecyclePolicyProvider = class {
|
|
|
63698
63807
|
throw this.wrapCaughtError(void 0, error, (text) => new ProvisioningError(`Failed to resolve Arn for DLM Lifecycle Policy ${physicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
63699
63808
|
}
|
|
63700
63809
|
}
|
|
63701
|
-
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
63810
|
+
async readCurrentState(physicalId, _logicalId, _resourceType, properties) {
|
|
63702
63811
|
try {
|
|
63703
63812
|
const policy = (await this.getClient().send(new GetLifecyclePolicyCommand$1({ PolicyId: physicalId }))).Policy;
|
|
63704
63813
|
if (!policy) return void 0;
|
|
63814
|
+
const details = policy.PolicyDetails;
|
|
63815
|
+
const configuration = {};
|
|
63816
|
+
const isDefault = details !== void 0 && policy.DefaultPolicy === true;
|
|
63817
|
+
if (details !== void 0 && (!isDefault || properties?.["PolicyDetails"] != null)) configuration["PolicyDetails"] = details;
|
|
63818
|
+
else if (isDefault) {
|
|
63819
|
+
for (const key of DEFAULT_POLICY_SHORTHAND_KEYS) if (details[key] !== void 0) configuration[key] = details[key];
|
|
63820
|
+
}
|
|
63821
|
+
if (isDefault && typeof details["ResourceType"] === "string") configuration["DefaultPolicy"] = details["ResourceType"];
|
|
63705
63822
|
return {
|
|
63706
63823
|
...policy.Description !== void 0 && { Description: policy.Description },
|
|
63707
63824
|
...policy.State !== void 0 && { State: policy.State },
|
|
63708
63825
|
...policy.ExecutionRoleArn !== void 0 && { ExecutionRoleArn: policy.ExecutionRoleArn },
|
|
63826
|
+
...configuration,
|
|
63709
63827
|
Tags: normalizeAwsTagsToCfn(policy.Tags)
|
|
63710
63828
|
};
|
|
63711
63829
|
} catch (error) {
|
|
@@ -63713,17 +63831,20 @@ var DLMLifecyclePolicyProvider = class {
|
|
|
63713
63831
|
throw error;
|
|
63714
63832
|
}
|
|
63715
63833
|
}
|
|
63716
|
-
getDriftUnknownPaths(_resourceType) {
|
|
63717
|
-
return [
|
|
63718
|
-
|
|
63719
|
-
|
|
63720
|
-
|
|
63721
|
-
|
|
63722
|
-
|
|
63723
|
-
|
|
63724
|
-
|
|
63725
|
-
|
|
63726
|
-
|
|
63834
|
+
getDriftUnknownPaths(_resourceType, properties) {
|
|
63835
|
+
return [...undeclaredDriftKeys(DLM_CONFIGURATION_KEYS, properties), "DefaultPolicy"];
|
|
63836
|
+
}
|
|
63837
|
+
canonicalizeDriftPair(_resourceType, baseline, aws, properties) {
|
|
63838
|
+
const pair = projectDeclaredDriftPair(DLM_CONFIGURATION_KEYS, baseline, aws, properties, DLM_FILLED_DEFAULTS);
|
|
63839
|
+
const declaredDefault = properties?.["DefaultPolicy"];
|
|
63840
|
+
if (declaredDefault !== void 0 && declaredDefault !== null && !Object.hasOwn(pair.baseline, "DefaultPolicy")) return Promise.resolve({
|
|
63841
|
+
baseline: {
|
|
63842
|
+
...pair.baseline,
|
|
63843
|
+
DefaultPolicy: declaredDefault
|
|
63844
|
+
},
|
|
63845
|
+
aws: pair.aws
|
|
63846
|
+
});
|
|
63847
|
+
return Promise.resolve(pair);
|
|
63727
63848
|
}
|
|
63728
63849
|
async import(input) {
|
|
63729
63850
|
if (input.knownPhysicalId) try {
|
|
@@ -67952,4 +68073,4 @@ var ACMCertificateProvider = class {
|
|
|
67952
68073
|
};
|
|
67953
68074
|
|
|
67954
68075
|
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, EventBridgeArchiveProvider, 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, LightsailAlarmProvider, LogsDeliveryDestinationProvider, LogsDeliveryProvider, LogsDeliverySourceProvider, 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, WaitConditionProvider };
|
|
67955
|
-
//# sourceMappingURL=provider-classes-
|
|
68076
|
+
//# sourceMappingURL=provider-classes-Dc0pZOL3.js.map
|