@cdkd/cli 0.362.0 → 0.364.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ambient-client-defaults-lvt_quOX.js → ambient-client-defaults-BKnLt9R9.js} +4 -3
- package/dist/ambient-client-defaults-BKnLt9R9.js.map +1 -0
- package/dist/{asg-provider-fEPlW1VD.js → asg-provider-D-wGQIgg.js} +6 -6
- package/dist/{asg-provider-fEPlW1VD.js.map → asg-provider-D-wGQIgg.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{custom-resource-runtime-DWIcvRGQ.js → custom-resource-runtime-BDRipTIL.js} +6 -6
- package/dist/{custom-resource-runtime-DWIcvRGQ.js.map → custom-resource-runtime-BDRipTIL.js.map} +1 -1
- package/dist/{db-associated-roles-bxCMZbZE.js → db-associated-roles-cQd3Zmr5.js} +2 -2
- package/dist/{db-associated-roles-bxCMZbZE.js.map → db-associated-roles-cQd3Zmr5.js.map} +1 -1
- package/dist/{delete-started-CdhzmNUy.js → delete-started-DHQvQxWa.js} +13 -9
- package/dist/delete-started-DHQvQxWa.js.map +1 -0
- package/dist/{deploy-engine-XCVGar9z.js → deploy-engine-9rzhYsZc.js} +518 -313
- package/dist/deploy-engine-9rzhYsZc.js.map +1 -0
- package/dist/{ec2-termination-protection-CprPM9CV.js → ec2-termination-protection-Dttj-XrE.js} +8 -6
- package/dist/ec2-termination-protection-Dttj-XrE.js.map +1 -0
- package/dist/{ecr-uri-Bco-bZxQ.js → ecr-uri-BYWBRpzv.js} +2 -2
- package/dist/{ecr-uri-Bco-bZxQ.js.map → ecr-uri-BYWBRpzv.js.map} +1 -1
- package/dist/{expected-bucket-owner-DNrpjI15.js → expected-bucket-owner-DWEAlmAk.js} +2 -2
- package/dist/{expected-bucket-owner-DNrpjI15.js.map → expected-bucket-owner-DWEAlmAk.js.map} +1 -1
- package/dist/{iam-role-provider-n08e_UqG.js → iam-role-provider-fCKVbuHw.js} +385 -14
- package/dist/iam-role-provider-fCKVbuHw.js.map +1 -0
- package/dist/{image-plan-PkDml11o.js → image-plan-XyUNOBmz.js} +8 -8
- package/dist/{image-plan-PkDml11o.js.map → image-plan-XyUNOBmz.js.map} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-CS467GaW.js → logger-xueeC0uS.js} +2 -2
- package/dist/{logger-CS467GaW.js.map → logger-xueeC0uS.js.map} +1 -1
- package/dist/{neptune-provider-B6VK2Cbj.js → neptune-provider-ClN-LvMb.js} +7 -7
- package/dist/{neptune-provider-B6VK2Cbj.js.map → neptune-provider-ClN-LvMb.js.map} +1 -1
- package/dist/{program-BgTzsbxH.js → program-Dz-HwMKe.js} +253 -85
- package/dist/program-Dz-HwMKe.js.map +1 -0
- package/dist/{provider-classes-BPg5qXSB.js → provider-classes-Bmipcl6d.js} +397 -201
- package/dist/provider-classes-Bmipcl6d.js.map +1 -0
- package/dist/{rds-provider-6MbfXMoG.js → rds-provider-X8pB7V-7.js} +10 -10
- package/dist/{rds-provider-6MbfXMoG.js.map → rds-provider-X8pB7V-7.js.map} +1 -1
- package/dist/{read-replica-Zx5KMOal.js → read-replica-B9F3-d8h.js} +3 -3
- package/dist/{read-replica-Zx5KMOal.js.map → read-replica-B9F3-d8h.js.map} +1 -1
- package/dist/{replacement-rules-D_XjAts6.js → replacement-rules-TNt9wPax.js} +3 -3
- package/dist/{replacement-rules-D_XjAts6.js.map → replacement-rules-TNt9wPax.js.map} +1 -1
- package/dist/{resource-deadline-o6RvWixc.js → resource-deadline-CUApArbf.js} +4 -4
- package/dist/{resource-deadline-o6RvWixc.js.map → resource-deadline-CUApArbf.js.map} +1 -1
- package/dist/{restore-source-guard-ORkhNnNg.js → restore-source-guard-jCM5yJzQ.js} +4 -4
- package/dist/{restore-source-guard-ORkhNnNg.js.map → restore-source-guard-jCM5yJzQ.js.map} +1 -1
- package/dist/{run-cli-Dp5c7Am8.js → run-cli-BDjbpUsh.js} +2 -2
- package/dist/{run-cli-Dp5c7Am8.js.map → run-cli-BDjbpUsh.js.map} +1 -1
- package/dist/{settle-own-write-members-SaiOYQGZ.js → settle-own-write-members-CSkozE9A.js} +13 -135
- package/dist/settle-own-write-members-CSkozE9A.js.map +1 -0
- package/dist/{version-DFX4Mg8N.js → version-BXn3jGiB.js} +2 -2
- package/dist/{version-DFX4Mg8N.js.map → version-BXn3jGiB.js.map} +1 -1
- package/package.json +3 -3
- package/dist/ambient-client-defaults-lvt_quOX.js.map +0 -1
- package/dist/delete-started-CdhzmNUy.js.map +0 -1
- package/dist/deploy-engine-XCVGar9z.js.map +0 -1
- package/dist/ec2-termination-protection-CprPM9CV.js.map +0 -1
- package/dist/iam-role-provider-n08e_UqG.js.map +0 -1
- package/dist/program-BgTzsbxH.js.map +0 -1
- package/dist/provider-classes-BPg5qXSB.js.map +0 -1
- package/dist/settle-own-write-members-SaiOYQGZ.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { a as restoreOwnWriteRemovals, c 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 { a as restoreOwnWriteRemovals, c as MANAGED_POLICY_OWNER, d as verifyInlinePolicyPrincipals, f as verifyOwnIdentityBeforeUpdate, h as IamCreateClientCache, i as recordOwnWriteRemoval, l as assertInlinePolicyAttachTargets, m as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, o as takeOwnWriteRemovals, p as iamEntityLeftByThisCreate, r as clearOwnWriteRemovals, s as InlinePolicyPrincipalMismatchError, t as IAMRoleProvider, u as compareMembershipWrites } from "./iam-role-provider-fCKVbuHw.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-xueeC0uS.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 isProceedDbStatus, $t as markAuxiliaryFailure, A as assertRegionMatch, At as canonicalizeRoute53QueryName, B as resolveExplicitPhysicalId, Bt as createMaskedRetryLogger, C as isInsideWindow, Ct as SECRET_DERIVED_READ_LIVE, D as withoutServerErrorRetries, E as setBounded, Et as readPrincipalLists, F as isQuotableImportValue, Ft as packCompositeId, G as logGroupProtectionSite, H as markNotGone, Ht as maskDeep, I as normalizeAwsTagsToCfn, K as observeThenDisableProtection, L as quotedRemedyLogicalId, Lt as segmentAfterAnchor, M as importRemedyCommand, Mt as compositeIdSeparatorRefusal, N as isPlainImportJson, Nt as compositeIdSkipResult, O as DriftReadRefusedError, Ot as recordedPrincipalsRepair, P as isPlainImportValue, Pt as logicalIdShown, R as refusalTypeShown, Rt as stateOrphanRecordRemedy, S as createAttemptKey, T as replayedSendWindow, Tt as onlySecretDerived, Ut as maskerOrIdentity, Vt as isSecretDerivedValue, W as deleteWithProtectionCompensation, Wt as withDerivedNameMasks, X as PROTECTION_FLIP_RETRY_WAIT_MS, Y as userPoolProtectionSite, Z as deleteAfterProtectionFlipWithFinalSnapshot, Zt as isAuxiliaryFailure, _ as AMBIGUOUS_LATCH_TTL_MS, _n as withPasteableAwsProfile, a as clearOnUpdateRemoval, b as RecentIdSet, bt as startInterruptWatch, c as removedTemplateKeys, dt as WITHHELD_AWS_COMMAND, en as markCreatedBeforeFailure, et as isTerminalDbWaitStatus, ft as isAwsCliLiteral, g as retractCreatedResource, ht as renderDisableCommand, it as protectionFlipKey, j as VALUE_NOT_SHOWN, jt as compositeIdFormatMessage, k as RESOURCE_NOT_FOUND, l as withRemovalDefaults, m as reportCreatedResource, mt as protectedReplacementAdvice, n as enclosingDeadlineRemainingMs, nt as ProtectionFlipRegistry, ot as ElapsedBudget, pt as pasteableAwsCommand, q as rdsFamilyProtectionSite, qt as clearCreatedBeforeFailure, rt as isTerminalDeleteFailure, st as ElapsedBudgetRegistry, t as enclosingDeadlineExpired, tn as markSupersedesEarlierCreate, ut as UNNAMEABLE_ID_CLAUSE, v as AmbiguousCreateLatch, vn as injectiveKey, w as replayFollowedAmbiguousAttempt, wt as holdsSecretDerivedEntry, x as ambiguousAttemptLead, y as CREATION_DATE_SKEW_MARGIN_MS, yn as injectiveKeyPrefix, yt as isInterruptedWaitError, z as remedyLogicalId, zt as createMaskedLogSinks } 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 {
|
|
8
|
-
import { $ 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,
|
|
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-BKnLt9R9.js";
|
|
5
|
+
import { $ as isProceedDbStatus, $t as markAuxiliaryFailure, A as assertRegionMatch, At as canonicalizeRoute53QueryName, B as resolveExplicitPhysicalId, Bt as createMaskedRetryLogger, C as isInsideWindow, Ct as SECRET_DERIVED_READ_LIVE, D as withoutServerErrorRetries, E as setBounded, Et as readPrincipalLists, F as isQuotableImportValue, Ft as packCompositeId, G as logGroupProtectionSite, H as markNotGone, Ht as maskDeep, I as normalizeAwsTagsToCfn, K as observeThenDisableProtection, L as quotedRemedyLogicalId, Lt as segmentAfterAnchor, M as importRemedyCommand, Mt as compositeIdSeparatorRefusal, N as isPlainImportJson, Nt as compositeIdSkipResult, O as DriftReadRefusedError, Ot as recordedPrincipalsRepair, P as isPlainImportValue, Pt as logicalIdShown, R as refusalTypeShown, Rt as stateOrphanRecordRemedy, S as createAttemptKey, T as replayedSendWindow, Tt as onlySecretDerived, Ut as maskerOrIdentity, Vt as isSecretDerivedValue, W as deleteWithProtectionCompensation, Wt as withDerivedNameMasks, X as PROTECTION_FLIP_RETRY_WAIT_MS, Y as userPoolProtectionSite, Z as deleteAfterProtectionFlipWithFinalSnapshot, Zt as isAuxiliaryFailure, _ as AMBIGUOUS_LATCH_TTL_MS, _n as withPasteableAwsProfile, a as clearOnUpdateRemoval, b as RecentIdSet, bt as startInterruptWatch, c as removedTemplateKeys, dt as WITHHELD_AWS_COMMAND, en as markCreatedBeforeFailure, et as isTerminalDbWaitStatus, ft as isAwsCliLiteral, g as retractCreatedResource, ht as renderDisableCommand, it as protectionFlipKey, j as VALUE_NOT_SHOWN, jt as compositeIdFormatMessage, k as RESOURCE_NOT_FOUND, l as withRemovalDefaults, m as reportCreatedResource, mt as protectedReplacementAdvice, n as enclosingDeadlineRemainingMs, nt as ProtectionFlipRegistry, ot as ElapsedBudget, pt as pasteableAwsCommand, q as rdsFamilyProtectionSite, qt as clearCreatedBeforeFailure, rt as isTerminalDeleteFailure, st as ElapsedBudgetRegistry, t as enclosingDeadlineExpired, tn as markSupersedesEarlierCreate, ut as UNNAMEABLE_ID_CLAUSE, v as AmbiguousCreateLatch, vn as injectiveKey, w as replayFollowedAmbiguousAttempt, wt as holdsSecretDerivedEntry, x as ambiguousAttemptLead, y as CREATION_DATE_SKEW_MARGIN_MS, yn as injectiveKeyPrefix, yt as isInterruptedWaitError, z as remedyLogicalId, zt as createMaskedLogSinks } from "./resource-deadline-CUApArbf.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-BXn3jGiB.js";
|
|
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-DHQvQxWa.js";
|
|
8
|
+
import { $ as effectiveInventoryItem, A as tagListsMatch, B as LIFECYCLE_DEFAULT_STATUS, C as reconcileSgRules, D as singleSecurityGroupRuleId, E as sgRuleKey, 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 stackIngressRuleHolder, P as LIFECYCLE_BASELINE_REREAD_DELAYS_MS, Q as effectiveIntelligentTieringItem, R as settleLifecycleRead, S as narrowIngressIpProtocol, T as securityGroupRuleMatchesCfnIngress, 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 flattenIpPermissions, a as resolveSecretDerivedPrincipals, at as declaresBucketObjectLock, b as isDefaultEgressRule, c as readSgIngressById, ct as isPlainObject$5, d as SG_RULE_PAGE_SIZE, dt as shownLifecycleRuleId, et as effectiveNotificationConfiguration, f as authorizeDefinitelyNotApplied, g as descriptionKey, h as comparableIngressIdentity, i as isResolvableSecretPrincipalList, it as configItemId, j as markCopiesAgreed, k as survivingRecordOfRuleId, l as siblingIdOwnedSgRules, lt as manualBucketDeletionClause, m as canonicalizeSgRuleProtocol, n as runDestroyForStack, nt as caughtErrorName, o as refuseRevertRevokingSiblingRules, ot as declaresNestedObjectLock, p as canonicalizeSgInlineRuleProtocols, q as lifecycleRuleScope, r as holdsUnprovenSecretPrincipalToken, rt as coerceCfnNumber, s as sgRuleDiffKey, st as describeValue$1, t as canonicalizeIpv4Cidr, tt as eventBridgeEnabledOf, u as SG_READBACK_RETRY_DELAY_MS, ut as mergeLegacySingular, v as ingressRuleIdentity, w as securityGroupReadbackDelays, x as isResendableSocketFailure, y as isConnectTimeout, z as takeLifecycleWrite } from "./program-Dz-HwMKe.js";
|
|
9
|
+
import { $ as recordTagWrite, $a as settleDeclaredMember, $r as REDACTED_DELETE_ADDRESS_SKIP_REASON, Aa as collectGroupsAddedBySiblings, Ao as waitForLambdaFunctionActive, At as resolveDynamoDbDeleteBudgetMs, B as declaredStreamTagsMember, Bt as hasCdkAutoDeleteTag, Ct as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, Cu as isAbsoluteAssetPath, Dr as calculateResourceDrift, Ds as parseWebACLArn, Dt as compensateRemovedDeletionProtection, Et as beginDeleteWait, Fa as withoutSiblingOwned, Fl as withheldAccountClause, Fr as earliestDefined, Ft as maskedLogger, G as streamDeclaresTags, Ga as SNS_DEFAULT_POLICY_ID, Gi as replacedDeleteFailureVerdict, Ha as KMS_DEFAULT_KEY_POLICY_ID, I as DynamoDBGlobalTableProvider, Ia as awaitInFlightSibling, It as relayedIndexBusyDelete, J as streamTagsMatchDeclared, Ja as efsPolicyMatchesDeclared, K as streamMemberRefusals, Ka as declaredMemberDocument, Kl as withoutSdkUnwiredProperties, L as STREAM_POLICY_KEY, Lo as deleteSkipReason, Lr as reserveStackCreateToken, Ls as getAccountInfo, Lt as waitForIndexesSettled, Ma as collectPrincipalsAttachingPolicy, Mo as waitForGoneAfterDelete, Mt as INDEX_SETTLE_POLL_INTERVAL_MS, Mu as decodeListingKey, Na as isStoredExpression, Nt as TABLE_INDEX_NOUN, Ot as deleteBudgetKey, Pa as withoutSiblingAttachedArns, Pl as accountArgs, Pt as deleteTableWithIndexBusyRetry, Q as isDynamoDBTableArnIn, Qa as reReadUntilSettled, R as STREAM_TAGS_KEY, Ra as getStackRecords, Ro as withIndeterminateGuard, Rt as ECR_AUTO_DELETE_IMAGES_TAG, Sd as resolveAssemblyPath, St as stripIndexContributorInsights, Su as findNestedTemplateTreeDefect, Tt as DYNAMODB_DELETE_POLL_COST_MS, Tu as renderNestedTemplateTreeDefect, U as reverseMapStreamPolicy, Ul as findSdkUnwiredProperties, V as planStreamMemberOps, Vo as markWaitAbandoned, Vt as isTruthyCfnBoolean, W as streamDeclaresPolicy, Wa as OWN_WRITE_REREAD_DELAYS_MS, Wu as rewriteTemplateAssetReferences, X as clearTagWrites, Xa as memberReadFailure, Xs as LEGACY_HANDLE_ID_PREFIX, Y as TAGS_BASELINE_REREAD_DELAYS_MS, Ya as lambdaPermissionMatchesDeclared, Za as policyDocumentMatchesDeclared, Zs as isLegacyHandleId, _n as getCurrentNestedStackContext, _s as s3BucketWebsiteUrl, _t as planContributorInsightsOp, ac as WARM_THROUGHPUT_MEMBERS, at as planTimeToLive, bo as getCurrentResourceSecrets, bt as reverseMapIndexContributorInsights, bu as stringifyValue, cc as toCfnInteger, ct as planVectorIndexUpdates, do as evaluateSignals, dr as withoutSiblingOwnedSgRules, dt as vectorIndexesSettled, ei as isRedactedRecordedValue, eo as warnUnsettledMember, et as settleWrittenTags, eu as normalizeRecordName, fc as maskedSecretSegment, fr as SG_RULE_ID_PATTERN, ft as vectorIndexesShapeDetail, gs as s3BucketRegionalDomainName, gt as indexDeclaresContributorInsights, ha as secretNamedAttributeNamesOf, hr as sgProtocolKey, hs as s3BucketDualStackDomainName, ht as contributorInsightsRefusals, it as isTtlRateLimited, ja as collectManagedPolicyArnsAttachedBySiblings, js as outputReferenceProvenanceOf, jt as DELETE_INDEX_WAIT_PROCEED_NOTE, kl as refuseMalformedResourcesForDestroy, kt as resolveDynamoDbDeleteBudgetClock, lc as toFiniteNumber, lo as WaitConditionSignalStore, lr as siblingOwnedSgRuleIdentities, lt as readbackVectorIndexes, mr as recordedSgRuleId, ms as s3BucketDomainName, mt as completeTableContributorInsightsBaseline, ni as redactedDeleteAddressSkip, nn as licensedNameHolder, no as attemptedPolicyDocument, nt as takeTagWrite, oc as coerceWarmThroughput$1, ot as readTtlSpec, pi as getCurrentProducerRegions, pn as revertNestedChildFromJournal, pr as cfnIngressPortValue, ps as s3BucketArn, pt as CONTRIBUTOR_INSIGHTS_KEY, q as streamPolicyMatchesDeclared, qa as declaredPolicyDocument, qo as isSettledInstanceState, ro as policyContentKey, rt as isTtlAlreadyDisabled, sc as isWarmThroughputDecrease, st as sendTtlWaitingOutRateLimit, t as DeployEngine, ti as redactedDeleteAddressFields, to as verbatimEchoDriftKeys, tu as planSubscriptionAttributes, uc as APPSYNC_APIKEY_ARN_RESOURCE_PATH, un as getNestedRevertRun, uo as classifyHandleUrl, ut as vectorIndexesForCreate, vd as describeFileReadFailure, vn as withNestedStackContext, vt as planIndexContributorInsightsOps, wc as passedParameterClassesOf, wt as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, wu as listNestedTemplateRows, xd as renderAssemblyPathEscape, xt as reverseMapTableContributorInsights, yd as displayAssemblyPath, yl as refuseMalformedNestedChildOutputs, yt as readContributorInsightsSpec, z as declaredStreamPolicyMember, zr as acquireIdempotencyToken, zt as S3_AUTO_DELETE_OBJECTS_TAG } from "./deploy-engine-9rzhYsZc.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-jCM5yJzQ.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-Dttj-XrE.js";
|
|
12
|
+
import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-CSkozE9A.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, 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-TNt9wPax.js";
|
|
16
|
+
import { RDSProvider } from "./rds-provider-X8pB7V-7.js";
|
|
17
|
+
import { NeptuneProvider } from "./neptune-provider-ClN-LvMb.js";
|
|
18
|
+
import { ASGProvider } from "./asg-provider-D-wGQIgg.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
|
-
import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand,
|
|
21
|
+
import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateAccessKeyCommand, UpdateGroupCommand, UpdateLoginProfileCommand, UpdateUserCommand } from "@aws-sdk/client-iam";
|
|
22
22
|
import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQueueUrlCommand, ListQueueTagsCommand, QueueDoesNotExist, SQSClient, SetQueueAttributesCommand, TagQueueCommand, UntagQueueCommand } from "@aws-sdk/client-sqs";
|
|
23
23
|
import { AuthorizationErrorException, CreateTopicCommand, DeleteTopicCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, InvalidParameterException, ListSubscriptionsByTopicCommand, ListTagsForResourceCommand, ListTopicsCommand, NotFoundException, SNSClient, SetSubscriptionAttributesCommand, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand } from "@aws-sdk/client-sns";
|
|
24
24
|
import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCodeSigningConfigCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionEventInvokeConfigCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCodeSigningConfigCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionConfigurationCommand, GetFunctionEventInvokeConfigCommand, GetFunctionRecursionConfigCommand, GetFunctionScalingConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, GetRuntimeManagementConfigCommand, LambdaClient, ListEventSourceMappingsCommand, ListLayerVersionsCommand, ListTagsCommand, PublishLayerVersionCommand, PublishVersionCommand, PutFunctionCodeSigningConfigCommand, PutFunctionConcurrencyCommand, PutFunctionEventInvokeConfigCommand, PutFunctionRecursionConfigCommand, PutFunctionScalingConfigCommand, PutRuntimeManagementConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionActiveV2, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
|
|
@@ -141,6 +141,16 @@ async function create$41(logicalId, resourceType, properties, context) {
|
|
|
141
141
|
users: []
|
|
142
142
|
};
|
|
143
143
|
try {
|
|
144
|
+
await assertInlinePolicyAttachTargets({
|
|
145
|
+
client: this.iamClient,
|
|
146
|
+
principals: [
|
|
147
|
+
...(roles ?? []).map((name) => ["role", name]),
|
|
148
|
+
...(groups ?? []).map((name) => ["group", name]),
|
|
149
|
+
...(users ?? []).map((name) => ["user", name])
|
|
150
|
+
],
|
|
151
|
+
policyLogicalId: logicalId,
|
|
152
|
+
physicalId: policyName
|
|
153
|
+
});
|
|
144
154
|
const policyDoc = typeof policyDocument === "string" ? policyDocument : JSON.stringify(policyDocument);
|
|
145
155
|
if (roles) for (const roleName of roles) {
|
|
146
156
|
await this.iamClient.send(new PutRolePolicyCommand({
|
|
@@ -175,6 +185,7 @@ async function create$41(logicalId, resourceType, properties, context) {
|
|
|
175
185
|
attributes: { PolicyName: policyName }
|
|
176
186
|
};
|
|
177
187
|
} catch (error) {
|
|
188
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
178
189
|
const cause = error instanceof Error ? error : void 0;
|
|
179
190
|
await this.detachPartialPolicy(logicalId, policyName, attached, log, context?.maskSecrets);
|
|
180
191
|
const errorSinks = withDerivedNameMasks(this.logger, log, [
|
|
@@ -244,140 +255,6 @@ function revertReplacementRefusal(resourceType, logicalId, reason) {
|
|
|
244
255
|
return new ResourceUpdateNotSupportedError(resourceType, logicalId, `${reason}, so reverting it would replace it, and a drift revert never replaces a resource. Nothing was changed; re-deploy with ${deployReplaceCommand()} to replace it`);
|
|
245
256
|
}
|
|
246
257
|
|
|
247
|
-
// src/provisioning/providers/iam-policy/principal-identity.ts
|
|
248
|
-
const PRINCIPAL_SPECS = {
|
|
249
|
-
role: {
|
|
250
|
-
resourceType: "AWS::IAM::Role",
|
|
251
|
-
label: "IAM role",
|
|
252
|
-
attribute: "RoleId",
|
|
253
|
-
read: async (client, name) => (await client.send(new GetRoleCommand({ RoleName: name }))).Role?.RoleId
|
|
254
|
-
},
|
|
255
|
-
group: {
|
|
256
|
-
resourceType: "AWS::IAM::Group",
|
|
257
|
-
label: "IAM group",
|
|
258
|
-
attribute: "GroupId",
|
|
259
|
-
read: async (client, name) => (await client.send(new GetGroupCommand({
|
|
260
|
-
GroupName: name,
|
|
261
|
-
MaxItems: 1
|
|
262
|
-
}))).Group?.GroupId
|
|
263
|
-
},
|
|
264
|
-
user: {
|
|
265
|
-
resourceType: "AWS::IAM::User",
|
|
266
|
-
label: "IAM user",
|
|
267
|
-
attribute: "UserId",
|
|
268
|
-
read: async (client, name) => (await client.send(new GetUserCommand({ UserName: name }))).User?.UserId
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
function inStackRecordedIds(kind, name) {
|
|
272
|
-
const view = getStackRecords();
|
|
273
|
-
if (view === void 0) return void 0;
|
|
274
|
-
const { resourceType } = PRINCIPAL_SPECS[kind];
|
|
275
|
-
let found;
|
|
276
|
-
for (const [logicalId, record] of view.live()) {
|
|
277
|
-
if (record.resourceType !== resourceType || record.physicalId !== name) continue;
|
|
278
|
-
const recorded = recordedIdentityId(resourceType, { recordedAttributes: record.attributes });
|
|
279
|
-
if (recorded === void 0) continue;
|
|
280
|
-
if (found === void 0) found = {
|
|
281
|
-
logicalId,
|
|
282
|
-
key: recorded.key,
|
|
283
|
-
values: []
|
|
284
|
-
};
|
|
285
|
-
if (!found.values.includes(recorded.value)) found.values.push(recorded.value);
|
|
286
|
-
}
|
|
287
|
-
return found;
|
|
288
|
-
}
|
|
289
|
-
async function verifyInlinePolicyPrincipal(params) {
|
|
290
|
-
const { client, kind, name, policyLogicalId, physicalId, operation } = params;
|
|
291
|
-
const recorded = inStackRecordedIds(kind, name);
|
|
292
|
-
if (recorded === void 0) return { kind: "unchecked" };
|
|
293
|
-
const spec = PRINCIPAL_SPECS[kind];
|
|
294
|
-
const value = recorded.values[0];
|
|
295
|
-
const read = async () => {
|
|
296
|
-
const id = await spec.read(client, name);
|
|
297
|
-
return id !== void 0 && recorded.values.includes(id) ? value : id;
|
|
298
|
-
};
|
|
299
|
-
try {
|
|
300
|
-
await assertRecordedIdentity({
|
|
301
|
-
label: spec.label,
|
|
302
|
-
resourceType: spec.resourceType,
|
|
303
|
-
logicalId: recorded.logicalId,
|
|
304
|
-
physicalId: name,
|
|
305
|
-
liveId: await read(),
|
|
306
|
-
reread: read,
|
|
307
|
-
context: { recordedAttributes: { [recorded.key]: value } }
|
|
308
|
-
});
|
|
309
|
-
return { kind: "verified" };
|
|
310
|
-
} catch (error) {
|
|
311
|
-
if (error instanceof NoSuchEntityException) return { kind: "gone" };
|
|
312
|
-
if (error instanceof RecordedIdentityMismatchError) return {
|
|
313
|
-
kind: "mismatch",
|
|
314
|
-
principalLogicalId: recorded.logicalId,
|
|
315
|
-
label: spec.label,
|
|
316
|
-
attribute: error.attribute
|
|
317
|
-
};
|
|
318
|
-
if (error instanceof RecordedIdentityError) throw new InlinePolicyPrincipalUnconfirmedError(policyLogicalId, physicalId, `${spec.label} ${recorded.logicalId}`, recorded.key, operation);
|
|
319
|
-
throw error;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
const PRINCIPAL_READ_CONCURRENCY = 5;
|
|
323
|
-
async function verifyInlinePolicyPrincipals(params) {
|
|
324
|
-
const { client, principals, policyLogicalId, physicalId, operation } = params;
|
|
325
|
-
const distinct = principals.filter(([kind, name], i) => principals.findIndex(([k, n]) => injectiveKey(k, n) === injectiveKey(kind, name)) === i);
|
|
326
|
-
const results = [];
|
|
327
|
-
let next = 0;
|
|
328
|
-
const worker = async () => {
|
|
329
|
-
while (next < distinct.length) {
|
|
330
|
-
const index = next++;
|
|
331
|
-
const [kind, name] = distinct[index];
|
|
332
|
-
try {
|
|
333
|
-
results[index] = {
|
|
334
|
-
status: "fulfilled",
|
|
335
|
-
value: await verifyInlinePolicyPrincipal({
|
|
336
|
-
client,
|
|
337
|
-
kind,
|
|
338
|
-
name,
|
|
339
|
-
policyLogicalId,
|
|
340
|
-
physicalId,
|
|
341
|
-
operation
|
|
342
|
-
})
|
|
343
|
-
};
|
|
344
|
-
} catch (reason) {
|
|
345
|
-
results[index] = {
|
|
346
|
-
status: "rejected",
|
|
347
|
-
reason
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
await Promise.all(Array.from({ length: Math.min(5, distinct.length) }, worker));
|
|
353
|
-
const verdicts = /* @__PURE__ */ new Map();
|
|
354
|
-
for (const [index, result] of results.entries()) {
|
|
355
|
-
if (result.status === "rejected") throw result.reason;
|
|
356
|
-
const [kind, name] = distinct[index];
|
|
357
|
-
verdicts.set(injectiveKey(kind, name), result.value);
|
|
358
|
-
}
|
|
359
|
-
return verdicts;
|
|
360
|
-
}
|
|
361
|
-
var InlinePolicyPrincipalUnconfirmedError = class InlinePolicyPrincipalUnconfirmedError extends RecordedIdentityError {
|
|
362
|
-
constructor(policyLogicalId, physicalId, principal, attribute, operation) {
|
|
363
|
-
super((operation === "update" ? `Cannot remove IAM policy ${policyLogicalId} from ${principal} during an update: ` : `Cannot delete IAM policy ${policyLogicalId} from ${principal}: `) + `AWS answered without its ${attribute}, so cdkd cannot confirm it is the one cdkd created; nothing was sent to it and the record is kept. Re-run the operation.`, "AWS::IAM::Policy", policyLogicalId, physicalId);
|
|
364
|
-
Object.setPrototypeOf(this, InlinePolicyPrincipalUnconfirmedError.prototype);
|
|
365
|
-
this.name = "InlinePolicyPrincipalUnconfirmedError";
|
|
366
|
-
markNotGone(this);
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
var InlinePolicyPrincipalMismatchError = class InlinePolicyPrincipalMismatchError extends RecordedIdentityError {
|
|
370
|
-
constructor(params) {
|
|
371
|
-
const { policyLogicalId, physicalId, mismatches, context } = params;
|
|
372
|
-
const named = mismatches.map((m) => `${m.label} ${m.principalLogicalId} (its ${m.attribute} differs)`).join(", ");
|
|
373
|
-
super(`Cannot delete IAM policy ${policyLogicalId} from ${named}: the principal holding the name cdkd recorded is not the one cdkd created, so cdkd sent it no delete and kept the record (the principal's own record refuses its delete the same way). Leave that principal alone; if the one cdkd created is gone (its inline policy went with it), drop the record with ${stateOrphanRecordRemedy(context, policyLogicalId)}.`, "AWS::IAM::Policy", policyLogicalId, physicalId);
|
|
374
|
-
Object.setPrototypeOf(this, InlinePolicyPrincipalMismatchError.prototype);
|
|
375
|
-
this.name = "InlinePolicyPrincipalMismatchError";
|
|
376
|
-
markNonRetryable(this);
|
|
377
|
-
markNotGone(this);
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
|
|
381
258
|
// src/provisioning/providers/iam-policy/update.ts
|
|
382
259
|
async function update$42(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
383
260
|
const oldPolicyName = physicalId.includes(":") ? physicalId.split(":")[0] : physicalId;
|
|
@@ -485,6 +362,12 @@ async function update$42(logicalId, physicalId, resourceType, properties, previo
|
|
|
485
362
|
physicalId,
|
|
486
363
|
operation: "update"
|
|
487
364
|
});
|
|
365
|
+
await assertInlinePolicyAttachTargets({
|
|
366
|
+
client: this.iamClient,
|
|
367
|
+
principals: kinds.flatMap(({ kind, desired }) => [...desired].map((name) => [kind, name])),
|
|
368
|
+
policyLogicalId: logicalId,
|
|
369
|
+
physicalId
|
|
370
|
+
});
|
|
488
371
|
const warned = /* @__PURE__ */ new Set();
|
|
489
372
|
const settledByVerdict = (kind, name) => {
|
|
490
373
|
const key = injectiveKey(kind, name);
|
|
@@ -1020,6 +903,7 @@ async function create$40(logicalId, resourceType, properties, context) {
|
|
|
1020
903
|
let leftBehindArn;
|
|
1021
904
|
let createdPolicyIdentity;
|
|
1022
905
|
try {
|
|
906
|
+
await this.assertAttachTargets(logicalId, policyName, principals.lists);
|
|
1023
907
|
const createParams = {
|
|
1024
908
|
PolicyName: policyName,
|
|
1025
909
|
PolicyDocument: policyDoc
|
|
@@ -1195,6 +1079,7 @@ async function update$41(logicalId, physicalId, resourceType, properties, previo
|
|
|
1195
1079
|
}
|
|
1196
1080
|
let createdVersionId;
|
|
1197
1081
|
try {
|
|
1082
|
+
const strangers = await this.comparePrincipalChanges(logicalId, physicalId, newPrincipals.lists, oldLists, log);
|
|
1198
1083
|
const newDocument = properties["PolicyDocument"];
|
|
1199
1084
|
const oldDocument = previousProperties["PolicyDocument"];
|
|
1200
1085
|
if (newDocument) {
|
|
@@ -1209,7 +1094,7 @@ async function update$41(logicalId, physicalId, resourceType, properties, previo
|
|
|
1209
1094
|
log.debug(`Updated PolicyDocument for ${v(physicalId)}`);
|
|
1210
1095
|
}
|
|
1211
1096
|
}
|
|
1212
|
-
await this.updatePrincipals(physicalId, newPrincipals.lists.Groups, oldLists.Groups, newPrincipals.lists.Roles, oldLists.Roles, newPrincipals.lists.Users, oldLists.Users, log);
|
|
1097
|
+
await this.updatePrincipals(physicalId, newPrincipals.lists.Groups, oldLists.Groups, newPrincipals.lists.Roles, oldLists.Roles, newPrincipals.lists.Users, oldLists.Users, log, strangers);
|
|
1213
1098
|
await this.updateTags(physicalId, resourceType, logicalId, properties["Tags"], previousProperties["Tags"], log);
|
|
1214
1099
|
const recorded = context?.recordedAttributes;
|
|
1215
1100
|
const recordedString = (key) => {
|
|
@@ -1243,6 +1128,7 @@ async function update$41(logicalId, physicalId, resourceType, properties, previo
|
|
|
1243
1128
|
attributes: managedPolicyAttributes(physicalId, readBack)
|
|
1244
1129
|
};
|
|
1245
1130
|
} catch (error) {
|
|
1131
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
1246
1132
|
const cause = error instanceof Error ? error : void 0;
|
|
1247
1133
|
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to update IAM managed policy ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
1248
1134
|
}
|
|
@@ -1465,6 +1351,13 @@ async function importImpl$39(input) {
|
|
|
1465
1351
|
|
|
1466
1352
|
// src/provisioning/providers/iam-managed-policy-provider.ts
|
|
1467
1353
|
const MANAGED_POLICY_TYPE = "AWS::IAM::ManagedPolicy";
|
|
1354
|
+
function principalPairs(lists) {
|
|
1355
|
+
return [
|
|
1356
|
+
...(lists.Groups ?? []).map((n) => ["group", n]),
|
|
1357
|
+
...(lists.Roles ?? []).map((n) => ["role", n]),
|
|
1358
|
+
...(lists.Users ?? []).map((n) => ["user", n])
|
|
1359
|
+
];
|
|
1360
|
+
}
|
|
1468
1361
|
const CUSTOMER_POLICY_ARN_RE = /^(arn:aws[a-z0-9-]*:iam::\d{12}):policy\/(?:[!-~]{0,510}\/)?([\w+=,.@-]{1,128})$/;
|
|
1469
1362
|
var IAMManagedPolicyProvider = class {
|
|
1470
1363
|
iamClient;
|
|
@@ -1565,6 +1458,41 @@ var IAMManagedPolicyProvider = class {
|
|
|
1565
1458
|
if (token === void 0) throw new Error("IAM returned no PolicyId");
|
|
1566
1459
|
return token;
|
|
1567
1460
|
}
|
|
1461
|
+
async assertAttachTargets(logicalId, physicalId, lists) {
|
|
1462
|
+
await assertInlinePolicyAttachTargets({
|
|
1463
|
+
client: this.iamClient,
|
|
1464
|
+
principals: principalPairs(lists),
|
|
1465
|
+
policyLogicalId: logicalId,
|
|
1466
|
+
physicalId,
|
|
1467
|
+
owner: MANAGED_POLICY_OWNER
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
async comparePrincipalChanges(logicalId, policyArn, desired, recorded, log) {
|
|
1471
|
+
const added = principalPairs(desired).filter(([kind, name]) => !principalPairs(recorded).some(([k, n]) => k === kind && n === name));
|
|
1472
|
+
const leaving = principalPairs(recorded).filter(([kind, name]) => !principalPairs(desired).some(([k, n]) => k === kind && n === name));
|
|
1473
|
+
const verdicts = await verifyInlinePolicyPrincipals({
|
|
1474
|
+
client: this.iamClient,
|
|
1475
|
+
principals: leaving,
|
|
1476
|
+
policyLogicalId: logicalId,
|
|
1477
|
+
physicalId: policyArn,
|
|
1478
|
+
operation: "update",
|
|
1479
|
+
owner: MANAGED_POLICY_OWNER
|
|
1480
|
+
});
|
|
1481
|
+
await assertInlinePolicyAttachTargets({
|
|
1482
|
+
client: this.iamClient,
|
|
1483
|
+
principals: added,
|
|
1484
|
+
policyLogicalId: logicalId,
|
|
1485
|
+
physicalId: policyArn,
|
|
1486
|
+
owner: MANAGED_POLICY_OWNER
|
|
1487
|
+
});
|
|
1488
|
+
const strangers = /* @__PURE__ */ new Set();
|
|
1489
|
+
for (const [key, verdict] of verdicts) {
|
|
1490
|
+
if (verdict.kind !== "mismatch") continue;
|
|
1491
|
+
strangers.add(key);
|
|
1492
|
+
log.warn(`IAM managed policy ${logicalId}: the ${verdict.label} ${verdict.principalLogicalId} leaving its principals is not the one cdkd created (its ${verdict.attribute} differs from the recorded one), so cdkd sent it no detach. Leave that ${verdict.label} alone.`);
|
|
1493
|
+
}
|
|
1494
|
+
return strangers;
|
|
1495
|
+
}
|
|
1568
1496
|
async attachToPrincipals(policyArn, groups, roles, users, log) {
|
|
1569
1497
|
const { value: v } = log;
|
|
1570
1498
|
if (groups && Array.isArray(groups)) for (const groupName of groups) {
|
|
@@ -1589,11 +1517,15 @@ var IAMManagedPolicyProvider = class {
|
|
|
1589
1517
|
log.debug(`Attached ${v(policyArn)} to user ${v(userName)}`);
|
|
1590
1518
|
}
|
|
1591
1519
|
}
|
|
1592
|
-
async updatePrincipals(policyArn, newGroups, oldGroups, newRoles, oldRoles, newUsers, oldUsers, log) {
|
|
1520
|
+
async updatePrincipals(policyArn, newGroups, oldGroups, newRoles, oldRoles, newUsers, oldUsers, log, strangers = /* @__PURE__ */ new Set()) {
|
|
1593
1521
|
const { value: v } = log;
|
|
1594
1522
|
clearOwnWriteRemovals(MANAGED_POLICY_TYPE, policyArn);
|
|
1595
1523
|
const newGroupSet = new Set(newGroups || []);
|
|
1596
1524
|
const oldGroupSet = new Set(oldGroups || []);
|
|
1525
|
+
const newRoleSet = new Set(newRoles || []);
|
|
1526
|
+
const oldRoleSet = new Set(oldRoles || []);
|
|
1527
|
+
const newUserSet = new Set(newUsers || []);
|
|
1528
|
+
const oldUserSet = new Set(oldUsers || []);
|
|
1597
1529
|
for (const g of newGroupSet) if (!oldGroupSet.has(g)) {
|
|
1598
1530
|
await this.iamClient.send(new AttachGroupPolicyCommand({
|
|
1599
1531
|
GroupName: g,
|
|
@@ -1602,6 +1534,7 @@ var IAMManagedPolicyProvider = class {
|
|
|
1602
1534
|
log.debug(`Attached ${v(policyArn)} to group ${v(g)}`);
|
|
1603
1535
|
}
|
|
1604
1536
|
for (const g of oldGroupSet) if (!newGroupSet.has(g)) {
|
|
1537
|
+
if (strangers.has(injectiveKey("group", g))) continue;
|
|
1605
1538
|
try {
|
|
1606
1539
|
await this.iamClient.send(new DetachGroupPolicyCommand({
|
|
1607
1540
|
GroupName: g,
|
|
@@ -1613,8 +1546,6 @@ var IAMManagedPolicyProvider = class {
|
|
|
1613
1546
|
}
|
|
1614
1547
|
recordOwnWriteRemoval(MANAGED_POLICY_TYPE, policyArn, "Groups", g);
|
|
1615
1548
|
}
|
|
1616
|
-
const newRoleSet = new Set(newRoles || []);
|
|
1617
|
-
const oldRoleSet = new Set(oldRoles || []);
|
|
1618
1549
|
for (const r of newRoleSet) if (!oldRoleSet.has(r)) {
|
|
1619
1550
|
await this.iamClient.send(new AttachRolePolicyCommand({
|
|
1620
1551
|
RoleName: r,
|
|
@@ -1623,6 +1554,7 @@ var IAMManagedPolicyProvider = class {
|
|
|
1623
1554
|
log.debug(`Attached ${v(policyArn)} to role ${v(r)}`);
|
|
1624
1555
|
}
|
|
1625
1556
|
for (const r of oldRoleSet) if (!newRoleSet.has(r)) {
|
|
1557
|
+
if (strangers.has(injectiveKey("role", r))) continue;
|
|
1626
1558
|
try {
|
|
1627
1559
|
await this.iamClient.send(new DetachRolePolicyCommand({
|
|
1628
1560
|
RoleName: r,
|
|
@@ -1634,8 +1566,6 @@ var IAMManagedPolicyProvider = class {
|
|
|
1634
1566
|
}
|
|
1635
1567
|
recordOwnWriteRemoval(MANAGED_POLICY_TYPE, policyArn, "Roles", r);
|
|
1636
1568
|
}
|
|
1637
|
-
const newUserSet = new Set(newUsers || []);
|
|
1638
|
-
const oldUserSet = new Set(oldUsers || []);
|
|
1639
1569
|
for (const u of newUserSet) if (!oldUserSet.has(u)) {
|
|
1640
1570
|
await this.iamClient.send(new AttachUserPolicyCommand({
|
|
1641
1571
|
UserName: u,
|
|
@@ -1644,6 +1574,7 @@ var IAMManagedPolicyProvider = class {
|
|
|
1644
1574
|
log.debug(`Attached ${v(policyArn)} to user ${v(u)}`);
|
|
1645
1575
|
}
|
|
1646
1576
|
for (const u of oldUserSet) if (!newUserSet.has(u)) {
|
|
1577
|
+
if (strangers.has(injectiveKey("user", u))) continue;
|
|
1647
1578
|
try {
|
|
1648
1579
|
await this.iamClient.send(new DetachUserPolicyCommand({
|
|
1649
1580
|
UserName: u,
|
|
@@ -1801,6 +1732,26 @@ var IAMManagedPolicyProvider = class {
|
|
|
1801
1732
|
}
|
|
1802
1733
|
};
|
|
1803
1734
|
|
|
1735
|
+
// src/provisioning/providers/iam-instance-profile-roles.ts
|
|
1736
|
+
const PROFILE_OWNER = {
|
|
1737
|
+
label: "IAM instance profile",
|
|
1738
|
+
resourceType: "AWS::IAM::InstanceProfile",
|
|
1739
|
+
membership: true
|
|
1740
|
+
};
|
|
1741
|
+
async function compareProfileRoleWrites(params) {
|
|
1742
|
+
const skip = await compareMembershipWrites({
|
|
1743
|
+
client: params.client,
|
|
1744
|
+
owner: PROFILE_OWNER,
|
|
1745
|
+
logicalId: params.logicalId,
|
|
1746
|
+
physicalId: params.physicalId,
|
|
1747
|
+
adds: params.added.map((role) => [["role", role]]),
|
|
1748
|
+
removes: params.removed.map((role) => [["role", role]]),
|
|
1749
|
+
operation: "update",
|
|
1750
|
+
warn: params.warn
|
|
1751
|
+
});
|
|
1752
|
+
return (roleName) => skip([["role", roleName]]);
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1804
1755
|
// src/provisioning/providers/iam-instance-profile-provider.ts
|
|
1805
1756
|
const INSTANCE_PROFILE_TYPE = "AWS::IAM::InstanceProfile";
|
|
1806
1757
|
function isInstanceProfileName(id) {
|
|
@@ -1840,6 +1791,20 @@ var IAMInstanceProfileProvider = class {
|
|
|
1840
1791
|
const principals = readPrincipalLists({ Roles: properties["Roles"] });
|
|
1841
1792
|
if ("malformed" in principals) throw new ProvisioningError(`Roles of IAM instance profile ${logicalId} is not a list of IAM role names — no instance profile was created`, resourceType, logicalId);
|
|
1842
1793
|
const roles = principals.lists.Roles;
|
|
1794
|
+
try {
|
|
1795
|
+
await compareProfileRoleWrites({
|
|
1796
|
+
client: this.iamClient,
|
|
1797
|
+
logicalId,
|
|
1798
|
+
physicalId: instanceProfileName,
|
|
1799
|
+
added: roles ?? [],
|
|
1800
|
+
removed: [],
|
|
1801
|
+
warn: (message) => log.warn(message)
|
|
1802
|
+
});
|
|
1803
|
+
} catch (error) {
|
|
1804
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
1805
|
+
const cause = error instanceof Error ? error : void 0;
|
|
1806
|
+
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to create IAM instance profile ${logicalId}: ${text}`, resourceType, logicalId, instanceProfileName, cause));
|
|
1807
|
+
}
|
|
1843
1808
|
let leftBehind = false;
|
|
1844
1809
|
let createdProfileIdentity;
|
|
1845
1810
|
try {
|
|
@@ -1941,7 +1906,25 @@ var IAMInstanceProfileProvider = class {
|
|
|
1941
1906
|
const newRoles = newPrincipals.lists.Roles ?? [];
|
|
1942
1907
|
const oldRoles = oldPrincipals.lists.Roles ?? [];
|
|
1943
1908
|
try {
|
|
1944
|
-
|
|
1909
|
+
const ownRead = await verifyOwnIdentityBeforeUpdate({
|
|
1910
|
+
label: "IAM instance profile",
|
|
1911
|
+
resourceType,
|
|
1912
|
+
permission: "iam:GetInstanceProfile",
|
|
1913
|
+
logicalId,
|
|
1914
|
+
physicalId,
|
|
1915
|
+
recordedAttributes: context?.recordedAttributes,
|
|
1916
|
+
read: () => this.iamClient.send(new GetInstanceProfileCommand({ InstanceProfileName: physicalId })),
|
|
1917
|
+
idOf: (response) => response.InstanceProfile?.InstanceProfileName?.toLowerCase() === physicalId.toLowerCase() ? response.InstanceProfile.InstanceProfileId : void 0
|
|
1918
|
+
});
|
|
1919
|
+
const skipRemoval = await compareProfileRoleWrites({
|
|
1920
|
+
client: this.iamClient,
|
|
1921
|
+
logicalId,
|
|
1922
|
+
physicalId,
|
|
1923
|
+
added: newRoles.filter((r) => !oldRoles.includes(r)),
|
|
1924
|
+
removed: oldRoles.filter((r) => !newRoles.includes(r)),
|
|
1925
|
+
warn: (message) => log.warn(message)
|
|
1926
|
+
});
|
|
1927
|
+
for (const roleName of oldRoles) if (!newRoles.includes(roleName) && !skipRemoval(roleName)) {
|
|
1945
1928
|
try {
|
|
1946
1929
|
await this.iamClient.send(new RemoveRoleFromInstanceProfileCommand({
|
|
1947
1930
|
InstanceProfileName: physicalId,
|
|
@@ -1968,7 +1951,7 @@ var IAMInstanceProfileProvider = class {
|
|
|
1968
1951
|
log.debug(`Added role ${v(roleName)} to instance profile ${v(physicalId)}`);
|
|
1969
1952
|
}
|
|
1970
1953
|
log.debug(`Successfully updated IAM instance profile ${logicalId}`);
|
|
1971
|
-
const getResponse = await this.iamClient.send(new GetInstanceProfileCommand({ InstanceProfileName: physicalId }));
|
|
1954
|
+
const getResponse = ownRead ?? await this.iamClient.send(new GetInstanceProfileCommand({ InstanceProfileName: physicalId }));
|
|
1972
1955
|
return {
|
|
1973
1956
|
physicalId,
|
|
1974
1957
|
wasReplaced: false,
|
|
@@ -1978,6 +1961,7 @@ var IAMInstanceProfileProvider = class {
|
|
|
1978
1961
|
}
|
|
1979
1962
|
};
|
|
1980
1963
|
} catch (error) {
|
|
1964
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
1981
1965
|
const cause = error instanceof Error ? error : void 0;
|
|
1982
1966
|
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to update IAM instance profile ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
1983
1967
|
}
|
|
@@ -2536,8 +2520,8 @@ async function create$39(logicalId, resourceType, properties, context) {
|
|
|
2536
2520
|
async function update$40(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
2537
2521
|
const log = withDerivedNameMasks(this.logger, createMaskedLogSinks(this.logger, context?.maskSecrets), [...derivedNamePairs(resourceType, logicalId, properties), ...derivedNamePairs(resourceType, logicalId, previousProperties).map(([raw]) => [raw, physicalId])]);
|
|
2538
2522
|
switch (resourceType) {
|
|
2539
|
-
case "AWS::IAM::User": return this.updateUser(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.inlinePolicyClaimed);
|
|
2540
|
-
case "AWS::IAM::Group": return this.updateGroup(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.inlinePolicyClaimed);
|
|
2523
|
+
case "AWS::IAM::User": return this.updateUser(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.inlinePolicyClaimed, context?.recordedAttributes);
|
|
2524
|
+
case "AWS::IAM::Group": return this.updateGroup(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.inlinePolicyClaimed, context?.recordedAttributes);
|
|
2541
2525
|
case "AWS::IAM::UserToGroupAddition": return this.updateUserToGroupAddition(logicalId, physicalId, resourceType, properties, previousProperties, log);
|
|
2542
2526
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
|
|
2543
2527
|
}
|
|
@@ -2559,6 +2543,23 @@ async function createUser(logicalId, resourceType, properties, log) {
|
|
|
2559
2543
|
const userName = generateResourceNameWithFallback(properties["UserName"], logicalId, { maxLength: 64 });
|
|
2560
2544
|
const groups = readPrincipalLists({ Groups: properties["Groups"] });
|
|
2561
2545
|
if ("malformed" in groups) throw new ProvisioningError(`Groups of IAM user ${logicalId} is not a list of IAM group names — no user was created`, resourceType, logicalId);
|
|
2546
|
+
try {
|
|
2547
|
+
await assertInlinePolicyAttachTargets({
|
|
2548
|
+
client: this.iamClient,
|
|
2549
|
+
principals: (groups.lists.Groups ?? []).map((g) => ["group", g]),
|
|
2550
|
+
policyLogicalId: logicalId,
|
|
2551
|
+
physicalId: userName,
|
|
2552
|
+
owner: {
|
|
2553
|
+
label: "IAM user",
|
|
2554
|
+
resourceType,
|
|
2555
|
+
membership: true
|
|
2556
|
+
}
|
|
2557
|
+
});
|
|
2558
|
+
} catch (error) {
|
|
2559
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
2560
|
+
const cause = error instanceof Error ? error : void 0;
|
|
2561
|
+
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to create IAM user ${logicalId}: ${text}`, resourceType, logicalId, userName, cause));
|
|
2562
|
+
}
|
|
2562
2563
|
let leftBehind = false;
|
|
2563
2564
|
let createdUserIdentity;
|
|
2564
2565
|
try {
|
|
@@ -2688,7 +2689,7 @@ async function createUser(logicalId, resourceType, properties, log) {
|
|
|
2688
2689
|
|
|
2689
2690
|
// src/provisioning/providers/iam-user-group/user-update.ts
|
|
2690
2691
|
const USER_TYPE = "AWS::IAM::User";
|
|
2691
|
-
async function updateUser(logicalId, physicalId, resourceType, properties, previousProperties, log, claimed) {
|
|
2692
|
+
async function updateUser(logicalId, physicalId, resourceType, properties, previousProperties, log, claimed, recordedAttributes) {
|
|
2692
2693
|
const { value: v } = log;
|
|
2693
2694
|
log.debug(`Updating IAM user ${logicalId}: ${v(physicalId)}`);
|
|
2694
2695
|
refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
|
|
@@ -2713,8 +2714,35 @@ async function updateUser(logicalId, physicalId, resourceType, properties, previ
|
|
|
2713
2714
|
});
|
|
2714
2715
|
if (groups.unmatchedKinds.length > 0) log.warn(`The recorded Groups of IAM user ${logicalId} is secret-derived, and IAM lists memberships the template does not name: cdkd removes the user from none of them, since IAM's list includes memberships made elsewhere. Remove the user by hand from any that this list used to name.`);
|
|
2715
2716
|
try {
|
|
2717
|
+
const ownRead = await verifyOwnIdentityBeforeUpdate({
|
|
2718
|
+
label: "IAM user",
|
|
2719
|
+
resourceType,
|
|
2720
|
+
permission: "iam:GetUser",
|
|
2721
|
+
logicalId,
|
|
2722
|
+
physicalId,
|
|
2723
|
+
recordedAttributes,
|
|
2724
|
+
read: () => this.iamClient.send(new GetUserCommand({ UserName: physicalId })),
|
|
2725
|
+
idOf: (response) => response.User?.UserId
|
|
2726
|
+
});
|
|
2727
|
+
const nextGroups = new Set(groups.next.Groups ?? []);
|
|
2728
|
+
const prevGroups = new Set(groups.prev.Groups ?? []);
|
|
2729
|
+
const skipRemoval = await compareMembershipWrites({
|
|
2730
|
+
client: this.iamClient,
|
|
2731
|
+
owner: {
|
|
2732
|
+
label: "IAM user",
|
|
2733
|
+
resourceType,
|
|
2734
|
+
membership: true
|
|
2735
|
+
},
|
|
2736
|
+
logicalId,
|
|
2737
|
+
physicalId,
|
|
2738
|
+
adds: [...nextGroups].filter((g) => !prevGroups.has(g)).map((g) => [["group", g]]),
|
|
2739
|
+
removes: [...prevGroups].filter((g) => !nextGroups.has(g)).map((g) => [["group", g]]),
|
|
2740
|
+
operation: "update",
|
|
2741
|
+
warn: (message) => log.warn(message)
|
|
2742
|
+
});
|
|
2716
2743
|
const newPath = iamPathOf(properties["Path"]);
|
|
2717
|
-
|
|
2744
|
+
const pathMoved = newPath !== iamPathOf(previousProperties["Path"]);
|
|
2745
|
+
if (pathMoved) {
|
|
2718
2746
|
await this.iamClient.send(new UpdateUserCommand({
|
|
2719
2747
|
UserName: physicalId,
|
|
2720
2748
|
NewPath: newPath
|
|
@@ -2760,9 +2788,9 @@ async function updateUser(logicalId, physicalId, resourceType, properties, previ
|
|
|
2760
2788
|
if (!(error instanceof NoSuchEntityException)) throw error;
|
|
2761
2789
|
}
|
|
2762
2790
|
await this.updateUserManagedPolicies(physicalId, properties["ManagedPolicyArns"], previousProperties["ManagedPolicyArns"], log);
|
|
2763
|
-
await this.updateUserGroups(physicalId, groups.next.Groups, groups.prev.Groups, log);
|
|
2791
|
+
await this.updateUserGroups(physicalId, groups.next.Groups, groups.prev.Groups?.filter((g) => !skipRemoval([["group", g]])), log);
|
|
2764
2792
|
await this.updateUserInlinePolicies(physicalId, properties["Policies"], previousProperties["Policies"], log, claimed);
|
|
2765
|
-
const getUserResponse = await this.iamClient.send(new GetUserCommand({ UserName: physicalId }));
|
|
2793
|
+
const getUserResponse = (pathMoved ? void 0 : ownRead) ?? await this.iamClient.send(new GetUserCommand({ UserName: physicalId }));
|
|
2766
2794
|
return {
|
|
2767
2795
|
physicalId,
|
|
2768
2796
|
wasReplaced: false,
|
|
@@ -2772,6 +2800,7 @@ async function updateUser(logicalId, physicalId, resourceType, properties, previ
|
|
|
2772
2800
|
}
|
|
2773
2801
|
};
|
|
2774
2802
|
} catch (error) {
|
|
2803
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
2775
2804
|
const cause = error instanceof Error ? error : void 0;
|
|
2776
2805
|
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to update IAM user ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
2777
2806
|
}
|
|
@@ -3113,13 +3142,27 @@ async function createGroup(logicalId, resourceType, properties, log) {
|
|
|
3113
3142
|
throw thrown;
|
|
3114
3143
|
}
|
|
3115
3144
|
}
|
|
3116
|
-
async function updateGroup(logicalId, physicalId, resourceType, properties, previousProperties, log, claimed) {
|
|
3145
|
+
async function updateGroup(logicalId, physicalId, resourceType, properties, previousProperties, log, claimed, recordedAttributes) {
|
|
3117
3146
|
const { value: v } = log;
|
|
3118
3147
|
log.debug(`Updating IAM group ${logicalId}: ${v(physicalId)}`);
|
|
3119
3148
|
clearOwnWriteRemovals(GROUP_TYPE, physicalId);
|
|
3120
3149
|
try {
|
|
3150
|
+
const ownRead = await verifyOwnIdentityBeforeUpdate({
|
|
3151
|
+
label: "IAM group",
|
|
3152
|
+
resourceType,
|
|
3153
|
+
permission: "iam:GetGroup",
|
|
3154
|
+
logicalId,
|
|
3155
|
+
physicalId,
|
|
3156
|
+
recordedAttributes,
|
|
3157
|
+
read: () => this.iamClient.send(new GetGroupCommand({
|
|
3158
|
+
GroupName: physicalId,
|
|
3159
|
+
MaxItems: 1
|
|
3160
|
+
})),
|
|
3161
|
+
idOf: (response) => response.Group?.GroupId
|
|
3162
|
+
});
|
|
3121
3163
|
const newPath = iamPathOf(properties["Path"]);
|
|
3122
|
-
|
|
3164
|
+
const pathMoved = newPath !== iamPathOf(previousProperties["Path"]);
|
|
3165
|
+
if (pathMoved) {
|
|
3123
3166
|
await this.iamClient.send(new UpdateGroupCommand({
|
|
3124
3167
|
GroupName: physicalId,
|
|
3125
3168
|
NewPath: newPath
|
|
@@ -3128,7 +3171,7 @@ async function updateGroup(logicalId, physicalId, resourceType, properties, prev
|
|
|
3128
3171
|
}
|
|
3129
3172
|
await this.updateGroupManagedPolicies(physicalId, properties["ManagedPolicyArns"], previousProperties["ManagedPolicyArns"], log);
|
|
3130
3173
|
await this.updateGroupInlinePolicies(physicalId, properties["Policies"], previousProperties["Policies"], log, claimed);
|
|
3131
|
-
const getGroupResponse = await this.iamClient.send(new GetGroupCommand({ GroupName: physicalId }));
|
|
3174
|
+
const getGroupResponse = (pathMoved ? void 0 : ownRead) ?? await this.iamClient.send(new GetGroupCommand({ GroupName: physicalId }));
|
|
3132
3175
|
log.debug(`Successfully updated IAM group ${logicalId}`);
|
|
3133
3176
|
return {
|
|
3134
3177
|
physicalId,
|
|
@@ -3139,6 +3182,7 @@ async function updateGroup(logicalId, physicalId, resourceType, properties, prev
|
|
|
3139
3182
|
}
|
|
3140
3183
|
};
|
|
3141
3184
|
} catch (error) {
|
|
3185
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
3142
3186
|
const cause = error instanceof Error ? error : void 0;
|
|
3143
3187
|
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to update IAM group ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
3144
3188
|
}
|
|
@@ -3291,6 +3335,12 @@ async function updateGroupInlinePolicies(groupName, newPolicies, oldPolicies, lo
|
|
|
3291
3335
|
}
|
|
3292
3336
|
|
|
3293
3337
|
// src/provisioning/providers/iam-user-group/user-to-group-addition.ts
|
|
3338
|
+
const MEMBERSHIP_OWNER = {
|
|
3339
|
+
label: "IAM UserToGroupAddition",
|
|
3340
|
+
resourceType: "AWS::IAM::UserToGroupAddition",
|
|
3341
|
+
membership: true
|
|
3342
|
+
};
|
|
3343
|
+
const membership = (group, user) => [["group", group], ["user", user]];
|
|
3294
3344
|
async function createUserToGroupAddition(logicalId, resourceType, properties, log) {
|
|
3295
3345
|
const { value: v } = log;
|
|
3296
3346
|
log.debug(`Creating IAM UserToGroupAddition ${logicalId}`);
|
|
@@ -3301,6 +3351,16 @@ async function createUserToGroupAddition(logicalId, resourceType, properties, lo
|
|
|
3301
3351
|
if (!groupName) throw new ProvisioningError(`GroupName is required for ${logicalId}`, resourceType, logicalId);
|
|
3302
3352
|
if (!users || users.length === 0) throw new ProvisioningError(`Users is required for ${logicalId}`, resourceType, logicalId);
|
|
3303
3353
|
try {
|
|
3354
|
+
await compareMembershipWrites({
|
|
3355
|
+
client: this.iamClient,
|
|
3356
|
+
owner: MEMBERSHIP_OWNER,
|
|
3357
|
+
logicalId,
|
|
3358
|
+
physicalId: logicalId,
|
|
3359
|
+
adds: users.map((user) => membership(groupName, user)),
|
|
3360
|
+
removes: [],
|
|
3361
|
+
operation: "update",
|
|
3362
|
+
warn: (message) => log.warn(message)
|
|
3363
|
+
});
|
|
3304
3364
|
for (const userName of users) {
|
|
3305
3365
|
await this.iamClient.send(new AddUserToGroupCommand({
|
|
3306
3366
|
GroupName: groupName,
|
|
@@ -3311,6 +3371,7 @@ async function createUserToGroupAddition(logicalId, resourceType, properties, lo
|
|
|
3311
3371
|
log.debug(`Successfully created IAM UserToGroupAddition ${logicalId}`);
|
|
3312
3372
|
return { physicalId: logicalId };
|
|
3313
3373
|
} catch (error) {
|
|
3374
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
3314
3375
|
const cause = error instanceof Error ? error : void 0;
|
|
3315
3376
|
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to create IAM UserToGroupAddition ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
|
|
3316
3377
|
}
|
|
@@ -3333,15 +3394,29 @@ async function updateUserToGroupAddition(logicalId, physicalId, resourceType, pr
|
|
|
3333
3394
|
const newUsers = new Set(users.next.Users ?? []);
|
|
3334
3395
|
const oldGroupName = previousProperties["GroupName"];
|
|
3335
3396
|
const oldUsers = new Set(users.prev.Users ?? []);
|
|
3397
|
+
const groupMoved = Boolean(oldGroupName) && oldGroupName !== groupName;
|
|
3336
3398
|
try {
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3399
|
+
const skipRemoval = await compareMembershipWrites({
|
|
3400
|
+
client: this.iamClient,
|
|
3401
|
+
owner: MEMBERSHIP_OWNER,
|
|
3402
|
+
logicalId,
|
|
3403
|
+
physicalId,
|
|
3404
|
+
adds: [...newUsers].filter((user) => groupMoved || !oldUsers.has(user)).map((user) => membership(groupName, user)),
|
|
3405
|
+
removes: [...oldUsers].filter((user) => groupMoved || !newUsers.has(user)).map((user) => membership(groupMoved ? oldGroupName : groupName, user)),
|
|
3406
|
+
operation: "update",
|
|
3407
|
+
warn: (message) => log.warn(message)
|
|
3408
|
+
});
|
|
3409
|
+
if (groupMoved) {
|
|
3410
|
+
for (const userName of oldUsers) {
|
|
3411
|
+
if (skipRemoval(membership(oldGroupName, userName))) continue;
|
|
3412
|
+
try {
|
|
3413
|
+
await this.iamClient.send(new RemoveUserFromGroupCommand({
|
|
3414
|
+
GroupName: oldGroupName,
|
|
3415
|
+
UserName: userName
|
|
3416
|
+
}));
|
|
3417
|
+
} catch (error) {
|
|
3418
|
+
if (!(error instanceof NoSuchEntityException)) throw error;
|
|
3419
|
+
}
|
|
3345
3420
|
}
|
|
3346
3421
|
for (const userName of newUsers) await this.iamClient.send(new AddUserToGroupCommand({
|
|
3347
3422
|
GroupName: groupName,
|
|
@@ -3355,7 +3430,7 @@ async function updateUserToGroupAddition(logicalId, physicalId, resourceType, pr
|
|
|
3355
3430
|
}));
|
|
3356
3431
|
log.debug(`Added user ${v(userName)} to group ${v(groupName)}`);
|
|
3357
3432
|
}
|
|
3358
|
-
for (const userName of oldUsers) if (!newUsers.has(userName)) try {
|
|
3433
|
+
for (const userName of oldUsers) if (!newUsers.has(userName) && !skipRemoval(membership(groupName, userName))) try {
|
|
3359
3434
|
await this.iamClient.send(new RemoveUserFromGroupCommand({
|
|
3360
3435
|
GroupName: groupName,
|
|
3361
3436
|
UserName: userName
|
|
@@ -3370,6 +3445,7 @@ async function updateUserToGroupAddition(logicalId, physicalId, resourceType, pr
|
|
|
3370
3445
|
wasReplaced: false
|
|
3371
3446
|
};
|
|
3372
3447
|
} catch (error) {
|
|
3448
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
3373
3449
|
const cause = error instanceof Error ? error : void 0;
|
|
3374
3450
|
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to update IAM UserToGroupAddition ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
3375
3451
|
}
|
|
@@ -3428,6 +3504,17 @@ async function deleteUserToGroupAddition(logicalId, physicalId, resourceType, pr
|
|
|
3428
3504
|
let secretUserNotMember = false;
|
|
3429
3505
|
let removedAny = false;
|
|
3430
3506
|
try {
|
|
3507
|
+
await compareMembershipWrites({
|
|
3508
|
+
client: this.iamClient,
|
|
3509
|
+
owner: MEMBERSHIP_OWNER,
|
|
3510
|
+
logicalId,
|
|
3511
|
+
physicalId,
|
|
3512
|
+
adds: [],
|
|
3513
|
+
removes: (users ?? []).map((user) => membership(groupName, user)),
|
|
3514
|
+
operation: "delete",
|
|
3515
|
+
context,
|
|
3516
|
+
warn: (message) => this.logger.warn(mask(message))
|
|
3517
|
+
});
|
|
3431
3518
|
for (const userName of users ?? []) {
|
|
3432
3519
|
if (resolvedNames.has(userName) && memo?.detached.has(injectiveKey("Users", userName)) !== true) {
|
|
3433
3520
|
let isMember;
|
|
@@ -3465,6 +3552,7 @@ async function deleteUserToGroupAddition(logicalId, physicalId, resourceType, pr
|
|
|
3465
3552
|
}
|
|
3466
3553
|
this.logger.debug(`Successfully deleted IAM UserToGroupAddition ${logicalId}`);
|
|
3467
3554
|
} catch (error) {
|
|
3555
|
+
if (error instanceof RecordedIdentityError) throw error;
|
|
3468
3556
|
const cause = error instanceof Error ? error : void 0;
|
|
3469
3557
|
const opMask = createMaskedLogSinks(this.logger, context?.maskSecrets).mask;
|
|
3470
3558
|
const failure = this.wrapMaskedError((text) => mask(opMask(text)), error, (text) => new ProvisioningError(`Failed to delete IAM UserToGroupAddition ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
@@ -3768,8 +3856,8 @@ var IAMUserGroupProvider = class {
|
|
|
3768
3856
|
createUser(logicalId, resourceType, properties, log) {
|
|
3769
3857
|
return createUser.call(this, logicalId, resourceType, properties, log);
|
|
3770
3858
|
}
|
|
3771
|
-
updateUser(logicalId, physicalId, resourceType, properties, previousProperties, log, claimed) {
|
|
3772
|
-
return updateUser.call(this, logicalId, physicalId, resourceType, properties, previousProperties, log, claimed);
|
|
3859
|
+
updateUser(logicalId, physicalId, resourceType, properties, previousProperties, log, claimed, recordedAttributes) {
|
|
3860
|
+
return updateUser.call(this, logicalId, physicalId, resourceType, properties, previousProperties, log, claimed, recordedAttributes);
|
|
3773
3861
|
}
|
|
3774
3862
|
deleteUser(logicalId, physicalId, resourceType, context) {
|
|
3775
3863
|
return deleteUser.call(this, logicalId, physicalId, resourceType, context);
|
|
@@ -3804,8 +3892,8 @@ var IAMUserGroupProvider = class {
|
|
|
3804
3892
|
createGroup(logicalId, resourceType, properties, log) {
|
|
3805
3893
|
return createGroup.call(this, logicalId, resourceType, properties, log);
|
|
3806
3894
|
}
|
|
3807
|
-
updateGroup(logicalId, physicalId, resourceType, properties, previousProperties, log, claimed) {
|
|
3808
|
-
return updateGroup.call(this, logicalId, physicalId, resourceType, properties, previousProperties, log, claimed);
|
|
3895
|
+
updateGroup(logicalId, physicalId, resourceType, properties, previousProperties, log, claimed, recordedAttributes) {
|
|
3896
|
+
return updateGroup.call(this, logicalId, physicalId, resourceType, properties, previousProperties, log, claimed, recordedAttributes);
|
|
3809
3897
|
}
|
|
3810
3898
|
deleteGroup(logicalId, physicalId, resourceType, context) {
|
|
3811
3899
|
return deleteGroup.call(this, logicalId, physicalId, resourceType, context);
|
|
@@ -3883,16 +3971,16 @@ function abacStatusOf(properties) {
|
|
|
3883
3971
|
return properties["AbacStatus"] ?? "Disabled";
|
|
3884
3972
|
}
|
|
3885
3973
|
function metadataBag(value) {
|
|
3886
|
-
return isPlainObject$
|
|
3974
|
+
return isPlainObject$5(value) ? value : void 0;
|
|
3887
3975
|
}
|
|
3888
3976
|
function metadataConfigurationRefusal(value) {
|
|
3889
3977
|
if (value === void 0) return void 0;
|
|
3890
3978
|
const root = "MetadataConfiguration";
|
|
3891
|
-
if (!isPlainObject$
|
|
3979
|
+
if (!isPlainObject$5(value)) return `${root} must be an object`;
|
|
3892
3980
|
const journal = value["JournalTableConfiguration"];
|
|
3893
|
-
if (!isPlainObject$
|
|
3981
|
+
if (!isPlainObject$5(journal)) return `${root}.JournalTableConfiguration must be an object`;
|
|
3894
3982
|
const expiration = journal["RecordExpiration"];
|
|
3895
|
-
if (!isPlainObject$
|
|
3983
|
+
if (!isPlainObject$5(expiration)) return `${root}.JournalTableConfiguration.RecordExpiration must be an object`;
|
|
3896
3984
|
if (typeof expiration["Expiration"] !== "string") return `${root}.JournalTableConfiguration.RecordExpiration.Expiration must be a string`;
|
|
3897
3985
|
const days = expiration["Days"];
|
|
3898
3986
|
if (days !== void 0 && (days === "" || days === null || !Number.isInteger(Number(days)))) return `${root}.JournalTableConfiguration.RecordExpiration.Days must be an integer`;
|
|
@@ -3903,11 +3991,11 @@ function metadataConfigurationRefusal(value) {
|
|
|
3903
3991
|
];
|
|
3904
3992
|
for (const [member, table] of tables) {
|
|
3905
3993
|
if (table === void 0) continue;
|
|
3906
|
-
if (!isPlainObject$
|
|
3994
|
+
if (!isPlainObject$5(table)) return `${root}.${member} must be an object`;
|
|
3907
3995
|
if (member !== "JournalTableConfiguration" && typeof table["ConfigurationState"] !== "string") return `${root}.${member}.ConfigurationState must be a string`;
|
|
3908
3996
|
const encryption = table["EncryptionConfiguration"];
|
|
3909
3997
|
if (encryption === void 0) continue;
|
|
3910
|
-
if (!isPlainObject$
|
|
3998
|
+
if (!isPlainObject$5(encryption) || typeof encryption["SseAlgorithm"] !== "string") return `${root}.${member}.EncryptionConfiguration must be an object with an SseAlgorithm`;
|
|
3911
3999
|
}
|
|
3912
4000
|
}
|
|
3913
4001
|
function metadataEncryptionToSdk(table) {
|
|
@@ -5068,7 +5156,7 @@ async function applyLifecycleConfiguration(bucketName, lifecycleConfig, onUnusab
|
|
|
5068
5156
|
if (!(exp?.["Days"] !== void 0 || exp?.["Date"] !== void 0)) sdkRule.Expiration = { ExpiredObjectDeleteMarker: true };
|
|
5069
5157
|
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.`);
|
|
5070
5158
|
}
|
|
5071
|
-
const nve = isPlainObject$
|
|
5159
|
+
const nve = isPlainObject$5(rule["NoncurrentVersionExpiration"]) ? rule["NoncurrentVersionExpiration"] : void 0;
|
|
5072
5160
|
const legacyNveDays = rule["NoncurrentVersionExpirationInDays"];
|
|
5073
5161
|
if (nve) sdkRule.NoncurrentVersionExpiration = {
|
|
5074
5162
|
NoncurrentDays: nve["NoncurrentDays"],
|
|
@@ -5093,7 +5181,7 @@ async function applyLifecycleConfiguration(bucketName, lifecycleConfig, onUnusab
|
|
|
5093
5181
|
const singularTransition = rule["Transition"];
|
|
5094
5182
|
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.`));
|
|
5095
5183
|
if (allTransitions.length > 0) sdkRule.Transitions = allTransitions.map(toSdkTransition);
|
|
5096
|
-
const abort = isPlainObject$
|
|
5184
|
+
const abort = isPlainObject$5(rule["AbortIncompleteMultipartUpload"]) ? rule["AbortIncompleteMultipartUpload"] : void 0;
|
|
5097
5185
|
if (abort) sdkRule.AbortIncompleteMultipartUpload = { DaysAfterInitiation: abort["DaysAfterInitiation"] };
|
|
5098
5186
|
const { prefix, tagFilters, sizeGt, sizeLt } = lifecycleRuleScope(rule);
|
|
5099
5187
|
const hasTags = tagFilters != null && tagFilters.length > 0;
|
|
@@ -5328,7 +5416,7 @@ function resolveS3BucketDestination(dest, destinationPath, onUnusable, maskSecre
|
|
|
5328
5416
|
throw new Error(message);
|
|
5329
5417
|
};
|
|
5330
5418
|
if (dest === void 0 || dest === null) return;
|
|
5331
|
-
if (!isPlainObject$
|
|
5419
|
+
if (!isPlainObject$5(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`);
|
|
5332
5420
|
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`);
|
|
5333
5421
|
return dest;
|
|
5334
5422
|
}
|
|
@@ -11528,6 +11616,24 @@ async function update$36(logicalId, physicalId, resourceType, properties, previo
|
|
|
11528
11616
|
throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update event source mapping ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
11529
11617
|
}
|
|
11530
11618
|
}
|
|
11619
|
+
function clearedDestinationConfig() {
|
|
11620
|
+
return { OnFailure: { Destination: "" } };
|
|
11621
|
+
}
|
|
11622
|
+
const isPlainObject$4 = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
|
|
11623
|
+
function holdsDestination(value) {
|
|
11624
|
+
if (!isPlainObject$4(value)) return false;
|
|
11625
|
+
const onFailure = value["OnFailure"];
|
|
11626
|
+
if (!isPlainObject$4(onFailure)) return false;
|
|
11627
|
+
const destination = onFailure["Destination"];
|
|
11628
|
+
return destination !== void 0 && destination !== null && destination !== "";
|
|
11629
|
+
}
|
|
11630
|
+
function destinationConfigForUpdate(value, previous) {
|
|
11631
|
+
if (holdsDestination(value)) return value;
|
|
11632
|
+
if (!isPlainObject$4(value)) return value;
|
|
11633
|
+
const onFailure = value["OnFailure"];
|
|
11634
|
+
if (onFailure !== void 0 && !isPlainObject$4(onFailure)) return value;
|
|
11635
|
+
return holdsDestination(previous) ? clearedDestinationConfig() : void 0;
|
|
11636
|
+
}
|
|
11531
11637
|
async function applyUpdate$5(logicalId, physicalId, resourceType, properties, previousProperties, log, restoring) {
|
|
11532
11638
|
log.debug(`Updating event source mapping ${logicalId}: ${physicalId}`);
|
|
11533
11639
|
const removed = (one = true) => restoring ? `${one ? "is" : "are"} absent from the configuration being restored` : `${one ? "was" : "were"} removed from the template`;
|
|
@@ -11543,7 +11649,7 @@ async function applyUpdate$5(logicalId, physicalId, resourceType, properties, pr
|
|
|
11543
11649
|
if (properties["MaximumRecordAgeInSeconds"] !== void 0) updateParams.MaximumRecordAgeInSeconds = properties["MaximumRecordAgeInSeconds"];
|
|
11544
11650
|
if (properties["ParallelizationFactor"] !== void 0) updateParams.ParallelizationFactor = properties["ParallelizationFactor"];
|
|
11545
11651
|
if (properties["FilterCriteria"] !== void 0) updateParams.FilterCriteria = properties["FilterCriteria"];
|
|
11546
|
-
if (properties["DestinationConfig"] !== void 0) updateParams.DestinationConfig = properties["DestinationConfig"];
|
|
11652
|
+
if (properties["DestinationConfig"] !== void 0) updateParams.DestinationConfig = destinationConfigForUpdate(properties["DestinationConfig"], previousProperties["DestinationConfig"]);
|
|
11547
11653
|
if (properties["TumblingWindowInSeconds"] !== void 0) updateParams.TumblingWindowInSeconds = properties["TumblingWindowInSeconds"];
|
|
11548
11654
|
if (properties["FunctionResponseTypes"] !== void 0) updateParams.FunctionResponseTypes = properties["FunctionResponseTypes"];
|
|
11549
11655
|
if (properties["SourceAccessConfigurations"] !== void 0) updateParams.SourceAccessConfigurations = properties["SourceAccessConfigurations"];
|
|
@@ -11564,7 +11670,7 @@ async function applyUpdate$5(logicalId, physicalId, resourceType, properties, pr
|
|
|
11564
11670
|
const prevKind = classifyEventSourceFromProperties(previousProperties);
|
|
11565
11671
|
if (wasSet("FilterCriteria")) updateParams.FilterCriteria = {};
|
|
11566
11672
|
if (wasSet("ScalingConfig")) updateParams.ScalingConfig = {};
|
|
11567
|
-
if (wasSet("DestinationConfig")) updateParams.DestinationConfig =
|
|
11673
|
+
if (wasSet("DestinationConfig") && holdsDestination(previousProperties["DestinationConfig"])) updateParams.DestinationConfig = clearedDestinationConfig();
|
|
11568
11674
|
if (wasSet("FunctionResponseTypes") && KINDS_WITH_FUNCTION_RESPONSE_TYPES.has(prevKind)) updateParams.FunctionResponseTypes = [];
|
|
11569
11675
|
if (wasSet("SourceAccessConfigurations") && KINDS_WITH_SOURCE_ACCESS_CONFIGURATIONS.has(prevKind)) updateParams.SourceAccessConfigurations = [];
|
|
11570
11676
|
if (wasSet("MetricsConfig")) updateParams.MetricsConfig = { Metrics: [] };
|
|
@@ -14675,6 +14781,11 @@ async function canonicalizeDriftPair$5(resourceType, baseline, aws, properties)
|
|
|
14675
14781
|
[key]: trimmed
|
|
14676
14782
|
};
|
|
14677
14783
|
}
|
|
14784
|
+
const insights = completeTableContributorInsightsBaseline(result, aws, properties);
|
|
14785
|
+
if (insights !== void 0) result = {
|
|
14786
|
+
...result,
|
|
14787
|
+
[CONTRIBUTOR_INSIGHTS_KEY]: insights
|
|
14788
|
+
};
|
|
14678
14789
|
return {
|
|
14679
14790
|
baseline: result,
|
|
14680
14791
|
aws
|
|
@@ -21803,7 +21914,7 @@ async function updateEip(logicalId, physicalId, resourceType, properties, previo
|
|
|
21803
21914
|
wasReplaced: false
|
|
21804
21915
|
};
|
|
21805
21916
|
}
|
|
21806
|
-
async function deleteEip(logicalId, physicalId, resourceType, context) {
|
|
21917
|
+
async function deleteEip(logicalId, physicalId, resourceType, context, properties) {
|
|
21807
21918
|
this.logger.debug(`Deleting EIP ${logicalId}: ${physicalId}`);
|
|
21808
21919
|
const parsed = this.parseEipPhysicalId(physicalId);
|
|
21809
21920
|
let allocationId = parsed.allocationId;
|
|
@@ -21814,8 +21925,27 @@ async function deleteEip(logicalId, physicalId, resourceType, context) {
|
|
|
21814
21925
|
return;
|
|
21815
21926
|
}
|
|
21816
21927
|
}
|
|
21928
|
+
const release = () => this.withDependencyViolationRetry(() => this.ec2Client.send(new ReleaseAddressCommand({ AllocationId: allocationId })), { description: `ReleaseAddress ${logicalId} (${allocationId})` });
|
|
21817
21929
|
try {
|
|
21818
|
-
|
|
21930
|
+
try {
|
|
21931
|
+
await release();
|
|
21932
|
+
} catch (error) {
|
|
21933
|
+
if (!isNamedError(error, EIP_IN_USE_NAMES)) throw error;
|
|
21934
|
+
const freed = await disassociateOwnAssociation.call(this, logicalId, allocationId, properties);
|
|
21935
|
+
if (freed === "not-ours") throw error;
|
|
21936
|
+
try {
|
|
21937
|
+
for (let attempt = 1;; attempt++) try {
|
|
21938
|
+
await release();
|
|
21939
|
+
break;
|
|
21940
|
+
} catch (retryError) {
|
|
21941
|
+
if (attempt >= EIP_RELEASE_AFTER_DISASSOCIATE_ATTEMPTS) throw retryError;
|
|
21942
|
+
if (!isNamedError(retryError, EIP_IN_USE_NAMES)) throw retryError;
|
|
21943
|
+
await this.sleep(2e3);
|
|
21944
|
+
}
|
|
21945
|
+
} catch (retryError) {
|
|
21946
|
+
throw freed === "disassociated" ? markDeleteStarted(retryError) : retryError;
|
|
21947
|
+
}
|
|
21948
|
+
}
|
|
21819
21949
|
this.logger.debug(`Successfully deleted EIP ${logicalId}`);
|
|
21820
21950
|
} catch (error) {
|
|
21821
21951
|
if (this.isNotFoundError(error)) {
|
|
@@ -21829,6 +21959,30 @@ async function deleteEip(logicalId, physicalId, resourceType, context) {
|
|
|
21829
21959
|
throw this.wrapDeleteError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete EIP ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
21830
21960
|
}
|
|
21831
21961
|
}
|
|
21962
|
+
const EIP_IN_USE_NAMES = /* @__PURE__ */ new Set(["InvalidIPAddress.InUse"]);
|
|
21963
|
+
const EIP_RELEASE_AFTER_DISASSOCIATE_ATTEMPTS = 5;
|
|
21964
|
+
async function disassociateOwnAssociation(logicalId, allocationId, properties) {
|
|
21965
|
+
const instanceId = properties?.["InstanceId"];
|
|
21966
|
+
if (typeof instanceId !== "string" || instanceId === "" || !allocationId) return "not-ours";
|
|
21967
|
+
let address;
|
|
21968
|
+
try {
|
|
21969
|
+
address = (await this.ec2Client.send(new DescribeAddressesCommand({ AllocationIds: [allocationId] }))).Addresses?.[0];
|
|
21970
|
+
} catch (error) {
|
|
21971
|
+
this.logger.debug(safeMsg`Could not read EIP ${logicalId} (${allocationId}) to disassociate it: ${error instanceof Error ? error.name : "unknown error"}`);
|
|
21972
|
+
return "not-ours";
|
|
21973
|
+
}
|
|
21974
|
+
if (!address) return "not-ours";
|
|
21975
|
+
if (!address.AssociationId) return "gone";
|
|
21976
|
+
if (address.InstanceId !== instanceId) return "not-ours";
|
|
21977
|
+
this.logger.debug(safeMsg`Disassociating EIP ${logicalId} (${allocationId}) from its instance before release`);
|
|
21978
|
+
try {
|
|
21979
|
+
await this.ec2Client.send(new DisassociateAddressCommand({ AssociationId: address.AssociationId }));
|
|
21980
|
+
} catch (error) {
|
|
21981
|
+
if (!isNamedError(error, EIP_ASSOCIATION_NOT_FOUND_NAMES)) throw error;
|
|
21982
|
+
}
|
|
21983
|
+
return "disassociated";
|
|
21984
|
+
}
|
|
21985
|
+
const EIP_ASSOCIATION_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidAssociationID.NotFound"]);
|
|
21832
21986
|
async function getEipAttribute(physicalId, attributeName) {
|
|
21833
21987
|
const { publicIp, allocationId } = this.parseEipPhysicalId(physicalId);
|
|
21834
21988
|
if (attributeName === "AllocationId" && allocationId) return allocationId;
|
|
@@ -26604,7 +26758,7 @@ var EC2Provider = class {
|
|
|
26604
26758
|
case "AWS::EC2::VPC": return this.deleteVpc(logicalId, physicalId, resourceType, context, properties);
|
|
26605
26759
|
case "AWS::EC2::Subnet": return this.deleteSubnet(logicalId, physicalId, resourceType, context, properties);
|
|
26606
26760
|
case "AWS::EC2::InternetGateway": return this.deleteInternetGateway(logicalId, physicalId, resourceType, context);
|
|
26607
|
-
case "AWS::EC2::EIP": return this.deleteEip(logicalId, physicalId, resourceType, context);
|
|
26761
|
+
case "AWS::EC2::EIP": return this.deleteEip(logicalId, physicalId, resourceType, context, properties);
|
|
26608
26762
|
case "AWS::EC2::VPCGatewayAttachment": return this.deleteVpcGatewayAttachment(logicalId, physicalId, resourceType, properties, context);
|
|
26609
26763
|
case "AWS::EC2::NatGateway": return this.deleteNatGateway(logicalId, physicalId, resourceType, context);
|
|
26610
26764
|
case "AWS::EC2::RouteTable": return this.deleteRouteTable(logicalId, physicalId, resourceType, context);
|
|
@@ -28757,6 +28911,10 @@ async function readCurrentStateStage(physicalId, properties) {
|
|
|
28757
28911
|
for (const { cfnKey, responseKey } of METHOD_SETTING_PATCH_FIELDS) if (stateEntry[cfnKey] !== void 0 && awsEntry?.[responseKey] !== void 0) entry[cfnKey] = awsEntry[responseKey];
|
|
28758
28912
|
return entry;
|
|
28759
28913
|
});
|
|
28914
|
+
result["Tags"] = Object.entries(resp.tags ?? {}).filter(([key]) => !key.startsWith("aws:")).map(([Key, Value]) => ({
|
|
28915
|
+
Key,
|
|
28916
|
+
Value
|
|
28917
|
+
}));
|
|
28760
28918
|
return result;
|
|
28761
28919
|
} catch (err) {
|
|
28762
28920
|
if (err instanceof NotFoundException$1) return RESOURCE_NOT_FOUND;
|
|
@@ -28792,6 +28950,11 @@ async function readCurrentStateMethod(physicalId) {
|
|
|
28792
28950
|
const authType = resp.authorizationType;
|
|
28793
28951
|
if (authType === "CUSTOM" || authType === "COGNITO_USER_POOLS") result["AuthorizerId"] = resp.authorizerId ?? "";
|
|
28794
28952
|
if (authType === "COGNITO_USER_POOLS") result["AuthorizationScopes"] = resp.authorizationScopes ? [...resp.authorizationScopes] : [];
|
|
28953
|
+
result["ApiKeyRequired"] = resp.apiKeyRequired ?? false;
|
|
28954
|
+
result["OperationName"] = resp.operationName ?? "";
|
|
28955
|
+
result["RequestValidatorId"] = resp.requestValidatorId ?? "";
|
|
28956
|
+
result["RequestParameters"] = resp.requestParameters ?? {};
|
|
28957
|
+
result["RequestModels"] = resp.requestModels ?? {};
|
|
28795
28958
|
result["Integration"] = resp.methodIntegration ?? {};
|
|
28796
28959
|
result["MethodResponses"] = resp.methodResponses ?? {};
|
|
28797
28960
|
return result;
|
|
@@ -40933,7 +41096,8 @@ const RECORD_VALUE_FIELDS = [
|
|
|
40933
41096
|
"HealthCheckId",
|
|
40934
41097
|
"GeoLocation",
|
|
40935
41098
|
"GeoProximityLocation",
|
|
40936
|
-
"CidrRoutingConfig"
|
|
41099
|
+
"CidrRoutingConfig",
|
|
41100
|
+
"AZAffinity"
|
|
40937
41101
|
];
|
|
40938
41102
|
function recordSetGroupCompositeId(hostedZoneId, groupName) {
|
|
40939
41103
|
return `${hostedZoneId}|${groupName}`;
|
|
@@ -41163,7 +41327,8 @@ async function deleteRecordSet(logicalId, physicalId, resourceType, properties,
|
|
|
41163
41327
|
HealthCheckId: properties["HealthCheckId"],
|
|
41164
41328
|
GeoLocation: properties["GeoLocation"],
|
|
41165
41329
|
GeoProximityLocation: properties["GeoProximityLocation"],
|
|
41166
|
-
CidrRoutingConfig: properties["CidrRoutingConfig"]
|
|
41330
|
+
CidrRoutingConfig: properties["CidrRoutingConfig"],
|
|
41331
|
+
AZAffinity: properties["AZAffinity"]
|
|
41167
41332
|
}));
|
|
41168
41333
|
if (redactedSkip) return redactedSkip;
|
|
41169
41334
|
const parsedComposite = parseRecordSetCompositeId(physicalId);
|
|
@@ -41293,6 +41458,13 @@ function buildResourceRecordSet(properties) {
|
|
|
41293
41458
|
if (cidrRoutingConfig["LocationName"] !== void 0) crc.LocationName = cidrRoutingConfig["LocationName"];
|
|
41294
41459
|
recordSet.CidrRoutingConfig = crc;
|
|
41295
41460
|
}
|
|
41461
|
+
const azAffinity = properties["AZAffinity"];
|
|
41462
|
+
if (azAffinity) {
|
|
41463
|
+
const aza = {};
|
|
41464
|
+
if (azAffinity["LocationType"] !== void 0) aza.LocationType = azAffinity["LocationType"];
|
|
41465
|
+
if (azAffinity["LocationId"] !== void 0) aza.LocationId = azAffinity["LocationId"];
|
|
41466
|
+
recordSet.AZAffinity = aza;
|
|
41467
|
+
}
|
|
41296
41468
|
return recordSet;
|
|
41297
41469
|
}
|
|
41298
41470
|
|
|
@@ -42108,6 +42280,12 @@ async function readRecordSetAt(identity, properties) {
|
|
|
42108
42280
|
if (recordSet.CidrRoutingConfig.LocationName !== void 0) crc["LocationName"] = recordSet.CidrRoutingConfig.LocationName;
|
|
42109
42281
|
result["CidrRoutingConfig"] = crc;
|
|
42110
42282
|
}
|
|
42283
|
+
if (recordSet.AZAffinity) {
|
|
42284
|
+
const aza = {};
|
|
42285
|
+
if (recordSet.AZAffinity.LocationType !== void 0) aza["LocationType"] = recordSet.AZAffinity.LocationType;
|
|
42286
|
+
if (recordSet.AZAffinity.LocationId !== void 0) aza["LocationId"] = recordSet.AZAffinity.LocationId;
|
|
42287
|
+
result["AZAffinity"] = aza;
|
|
42288
|
+
}
|
|
42111
42289
|
return result;
|
|
42112
42290
|
}
|
|
42113
42291
|
|
|
@@ -42273,7 +42451,8 @@ var Route53Provider = class {
|
|
|
42273
42451
|
"Comment",
|
|
42274
42452
|
"GeoLocation",
|
|
42275
42453
|
"GeoProximityLocation",
|
|
42276
|
-
"CidrRoutingConfig"
|
|
42454
|
+
"CidrRoutingConfig",
|
|
42455
|
+
"AZAffinity"
|
|
42277
42456
|
])],
|
|
42278
42457
|
["AWS::Route53::RecordSetGroup", /* @__PURE__ */ new Set([
|
|
42279
42458
|
"HostedZoneId",
|
|
@@ -47412,10 +47591,26 @@ async function readCurrentState$14(physicalId, _logicalId, resourceType, propert
|
|
|
47412
47591
|
default: return;
|
|
47413
47592
|
}
|
|
47414
47593
|
}
|
|
47594
|
+
const DEFAULT_ROOT_TYPE_NAMES = {
|
|
47595
|
+
query: "Query",
|
|
47596
|
+
mutation: "Mutation",
|
|
47597
|
+
subscription: "Subscription"
|
|
47598
|
+
};
|
|
47415
47599
|
async function canonicalizeSdl(sdl, source) {
|
|
47416
|
-
const { parse, print } = await import("graphql");
|
|
47417
|
-
try {
|
|
47418
|
-
|
|
47600
|
+
const { parse, print, Kind } = await import("graphql");
|
|
47601
|
+
try {
|
|
47602
|
+
const doc = parse(sdl);
|
|
47603
|
+
const objectTypeNames = /* @__PURE__ */ new Set();
|
|
47604
|
+
for (const def of doc.definitions) if (def.kind === Kind.OBJECT_TYPE_DEFINITION || def.kind === Kind.OBJECT_TYPE_EXTENSION) objectTypeNames.add(def.name.value);
|
|
47605
|
+
const definitions = doc.definitions.filter((def) => {
|
|
47606
|
+
if (def.kind !== Kind.SCHEMA_DEFINITION) return true;
|
|
47607
|
+
const listed = new Map(def.operationTypes.map((op) => [op.operation, op.type.name.value]));
|
|
47608
|
+
return !(!def.description && (def.directives?.length ?? 0) === 0 && [...listed].every(([op, name]) => name === DEFAULT_ROOT_TYPE_NAMES[op]) && Object.entries(DEFAULT_ROOT_TYPE_NAMES).every(([op, name]) => listed.has(op) === objectTypeNames.has(name)));
|
|
47609
|
+
});
|
|
47610
|
+
return print({
|
|
47611
|
+
...doc,
|
|
47612
|
+
definitions
|
|
47613
|
+
});
|
|
47419
47614
|
} catch (err) {
|
|
47420
47615
|
this.logger.debug(`Failed to parse ${source} SDL via graphql-js (falling back to raw): ${describeAwsFailure(err).detail}`);
|
|
47421
47616
|
return sdl;
|
|
@@ -55122,6 +55317,7 @@ async function readAccessPoint(physicalId) {
|
|
|
55122
55317
|
}
|
|
55123
55318
|
if (Object.keys(root).length > 0) result["RootDirectory"] = root;
|
|
55124
55319
|
}
|
|
55320
|
+
result["AccessPointTags"] = normalizeAwsTagsToCfn(ap.Tags);
|
|
55125
55321
|
return result;
|
|
55126
55322
|
}
|
|
55127
55323
|
async function readMountTarget(physicalId) {
|
|
@@ -66415,4 +66611,4 @@ var ACMCertificateProvider = class {
|
|
|
66415
66611
|
};
|
|
66416
66612
|
|
|
66417
66613
|
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, 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 };
|
|
66418
|
-
//# sourceMappingURL=provider-classes-
|
|
66614
|
+
//# sourceMappingURL=provider-classes-Bmipcl6d.js.map
|