@cdkd/cli 0.323.0 → 0.326.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/{asg-provider-4rNFSmz9.js → asg-provider-D1KLOLzB.js} +3 -3
- package/dist/{asg-provider-4rNFSmz9.js.map → asg-provider-D1KLOLzB.js.map} +1 -1
- package/dist/{aws-clients-DWpHZk2l.js → aws-clients-ez_oXu6x.js} +123 -2
- package/dist/aws-clients-ez_oXu6x.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{created-resource-sink-CmrPwGge.js → created-resource-sink-DMf6WEao.js} +2 -2
- package/dist/{created-resource-sink-CmrPwGge.js.map → created-resource-sink-DMf6WEao.js.map} +1 -1
- package/dist/{db-instance-modify-retry-DCLA_p9I.js → db-instance-modify-retry-2tRANTVg.js} +6 -5
- package/dist/db-instance-modify-retry-2tRANTVg.js.map +1 -0
- package/dist/{deploy-engine-dYZ0v6Kz.js → deploy-engine-l-wZygYT.js} +237 -62
- package/dist/deploy-engine-l-wZygYT.js.map +1 -0
- package/dist/{iam-role-provider-Bp4osNrj.js → iam-role-provider-CJBhHr7l.js} +4 -4
- package/dist/{iam-role-provider-Bp4osNrj.js.map → iam-role-provider-CJBhHr7l.js.map} +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{neptune-provider-BqtKFZaE.js → neptune-provider-D4a9cJ2i.js} +4 -4
- package/dist/{neptune-provider-BqtKFZaE.js.map → neptune-provider-D4a9cJ2i.js.map} +1 -1
- package/dist/{program-BYT8z2ca.js → program-ml6yCB64.js} +50 -8
- package/dist/program-ml6yCB64.js.map +1 -0
- package/dist/{provider-classes-KPYbVTtY.js → provider-classes-D60y4umw.js} +529 -75
- package/dist/provider-classes-D60y4umw.js.map +1 -0
- package/dist/{rds-provider-C8enyD9d.js → rds-provider-C6299G23.js} +182 -37
- package/dist/rds-provider-C6299G23.js.map +1 -0
- package/dist/{version-kAoaNHQI.js → version-C8PfUSmt.js} +2 -2
- package/dist/{version-kAoaNHQI.js.map → version-C8PfUSmt.js.map} +1 -1
- package/package.json +2 -1
- package/dist/aws-clients-DWpHZk2l.js.map +0 -1
- package/dist/db-instance-modify-retry-DCLA_p9I.js.map +0 -1
- package/dist/deploy-engine-dYZ0v6Kz.js.map +0 -1
- package/dist/program-BYT8z2ca.js.map +0 -1
- package/dist/provider-classes-KPYbVTtY.js.map +0 -1
- package/dist/rds-provider-C8enyD9d.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as withApiGatewayPacing, l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-ez_oXu6x.js";
|
|
2
2
|
import { $ as safeMsg, A as isBeforeStateRead, E as generatedNameFor, J as displaySafe, N as recordedGeneratedNameKept, O as getCurrentStackInstanceId, Q as plainIdentOr, T as generateResourceNameWithFallback, V as SECRET_REF_MAX_CODE_POINTS, X as isPasteableIdent, Y as displayStackName, a as safeStringify, i as isAwsAuthoredFailure, n as describeAwsFailure, q as displayIdent, r as describeAwsStatusReason, s as getLogger, t as VERBOSE_POINTER, w as generateResourceName } from "./aws-failure-text-DiHodi76.js";
|
|
3
|
-
import { $ as isTerminalDeleteFailure, A as setBounded, Ar as isThrottlingError, At as stateOrphanRecordRemedy, B as normalizeAwsTagsToCfn, C as AmbiguousCreateLatch, Cr as isExplicitDenyError, Ct as compositeIdFormatMessage, D as isInsideWindow, Dt as packCompositeId, E as createAttemptKey, Er as isTransientServerError, Et as logicalIdShown, F as assertRegionMatch, Fn as ResourceUpdateNotSupportedError, Ft as maskerOrIdentity, Gt as markAuxiliaryFailure, H as refusalTypeShown, I as VALUE_NOT_SHOWN, It as withDerivedNameMasks, J as deleteAfterProtectionFlipWithFinalSnapshot, K as ProtectionFlipRegistry, Kt as markCreatedBeforeFailure, L as isPlainImportJson, M as RESOURCE_NOT_FOUND, Mr as markRedactedCause, Mt as createMaskedRetryLogger, Nn as ProvisioningError, Nr as wrapMaskedAwsError, Nt as isSecretDerivedValue, O as replayFollowedAmbiguousAttempt, Or as THROTTLING_ERROR_NAMES, P as markNotGone, Pt as maskDeep, Q as isTerminalDbWaitStatus, Qn as pasteableCommand, R as isPlainImportValue, S as AMBIGUOUS_LATCH_TTL_MS, Sr as isAmbiguousOutcomeError, St as canonicalizeRoute53QueryName, T as ambiguousAttemptLead, Tr as isRetryableTransientError, Tt as compositeIdSkipResult, U as remedyLogicalId, Ut as isAuxiliaryFailure, V as quotedRemedyLogicalId, W as resolveExplicitPhysicalId, Xn as hasClauseBreak, Y as deleteWithProtectionCompensation, Yn as commandHole, Z as isProceedDbStatus, Zn as isInertUnquoted, b as withRemovalDefaults, bt as isInterruptedWaitError, ct as UNNAMEABLE_ID_CLAUSE, d as onlySecretDerived, dn as withPasteableAwsProfile, dt as pasteableAwsCommand, er as plainOrDescribed, et as logGroupProtectionSite, f as readPrincipalLists, fn as ambientClientDefaults, ft as protectedReplacementAdvice, g as clearOnUpdateRemoval, gn as AccountIdUnavailableError, hn as credentialFingerprint, hr as relayedNameCollision, ht as ElapsedBudgetRegistry, i as reportCreatedResource, ir as withheldTargetClause, j as withoutServerErrorRetries, jr as markNonRetryable, jt as createMaskedLogSinks, k as replayedSendWindow, kr as isMarkedNonRetryable, kt as segmentAfterAnchor, l as SECRET_DERIVED_READ_LIVE, lt as WITHHELD_AWS_COMMAND, m as recordedPrincipalsRepair, mn as clientDefaultsFor, mr as markReplayMayCollide, mt as ElapsedBudget, nt as protectionFlipKey, o as retractCreatedResource, on as injectiveKey, ot as userPoolProtectionSite, pn as ambientCredentialConfig, pr as markNameCollision, pt as renderDisableCommand, qt as markSupersedesEarlierCreate, rr as shellQuote, rt as rdsFamilyProtectionSite, sn as injectiveKeyPrefix, tt as observeThenDisableProtection, u as holdsSecretDerivedEntry, ut as isAwsCliLiteral, vn as CdkdError, w as RecentIdSet, wt as compositeIdSeparatorRefusal, xt as startInterruptWatch, y as removedTemplateKeys, yr as explicitDenyPolicyKind, z as isQuotableImportValue, zt as clearCreatedBeforeFailure } from "./created-resource-sink-
|
|
3
|
+
import { $ as isTerminalDeleteFailure, A as setBounded, Ar as isThrottlingError, At as stateOrphanRecordRemedy, B as normalizeAwsTagsToCfn, C as AmbiguousCreateLatch, Cr as isExplicitDenyError, Ct as compositeIdFormatMessage, D as isInsideWindow, Dt as packCompositeId, E as createAttemptKey, Er as isTransientServerError, Et as logicalIdShown, F as assertRegionMatch, Fn as ResourceUpdateNotSupportedError, Ft as maskerOrIdentity, Gt as markAuxiliaryFailure, H as refusalTypeShown, I as VALUE_NOT_SHOWN, It as withDerivedNameMasks, J as deleteAfterProtectionFlipWithFinalSnapshot, K as ProtectionFlipRegistry, Kt as markCreatedBeforeFailure, L as isPlainImportJson, M as RESOURCE_NOT_FOUND, Mr as markRedactedCause, Mt as createMaskedRetryLogger, Nn as ProvisioningError, Nr as wrapMaskedAwsError, Nt as isSecretDerivedValue, O as replayFollowedAmbiguousAttempt, Or as THROTTLING_ERROR_NAMES, P as markNotGone, Pt as maskDeep, Q as isTerminalDbWaitStatus, Qn as pasteableCommand, R as isPlainImportValue, S as AMBIGUOUS_LATCH_TTL_MS, Sr as isAmbiguousOutcomeError, St as canonicalizeRoute53QueryName, T as ambiguousAttemptLead, Tr as isRetryableTransientError, Tt as compositeIdSkipResult, U as remedyLogicalId, Ut as isAuxiliaryFailure, V as quotedRemedyLogicalId, W as resolveExplicitPhysicalId, Xn as hasClauseBreak, Y as deleteWithProtectionCompensation, Yn as commandHole, Z as isProceedDbStatus, Zn as isInertUnquoted, b as withRemovalDefaults, bt as isInterruptedWaitError, ct as UNNAMEABLE_ID_CLAUSE, d as onlySecretDerived, dn as withPasteableAwsProfile, dt as pasteableAwsCommand, er as plainOrDescribed, et as logGroupProtectionSite, f as readPrincipalLists, fn as ambientClientDefaults, ft as protectedReplacementAdvice, g as clearOnUpdateRemoval, gn as AccountIdUnavailableError, hn as credentialFingerprint, hr as relayedNameCollision, ht as ElapsedBudgetRegistry, i as reportCreatedResource, ir as withheldTargetClause, j as withoutServerErrorRetries, jr as markNonRetryable, jt as createMaskedLogSinks, k as replayedSendWindow, kr as isMarkedNonRetryable, kt as segmentAfterAnchor, l as SECRET_DERIVED_READ_LIVE, lt as WITHHELD_AWS_COMMAND, m as recordedPrincipalsRepair, mn as clientDefaultsFor, mr as markReplayMayCollide, mt as ElapsedBudget, nt as protectionFlipKey, o as retractCreatedResource, on as injectiveKey, ot as userPoolProtectionSite, pn as ambientCredentialConfig, pr as markNameCollision, pt as renderDisableCommand, qt as markSupersedesEarlierCreate, rr as shellQuote, rt as rdsFamilyProtectionSite, sn as injectiveKeyPrefix, tt as observeThenDisableProtection, u as holdsSecretDerivedEntry, ut as isAwsCliLiteral, vn as CdkdError, w as RecentIdSet, wt as compositeIdSeparatorRefusal, xt as startInterruptWatch, y as removedTemplateKeys, yr as explicitDenyPolicyKind, z as isQuotableImportValue, zt as clearCreatedBeforeFailure } from "./created-resource-sink-DMf6WEao.js";
|
|
4
4
|
import { c as ambientRegion } from "./aws-client-defaults-BLXFsfMa.js";
|
|
5
|
-
import { $ as isTtlRateLimited, $i as stringifyIfAssigned, A as resolvedResourceTimeoutMs, Aa as reEnableInstanceApiTermination, Ac as sameLambdaFunctionAddress, B as DELETE_INDEX_WAIT_PROCEED_NOTE, C as planContributorInsightsOp, Ca as withIndeterminateGuard, Cc as withRetry, Cd as derivePartitionAndUrlSuffix, Cl as recoverMaskedOutput, D as reverseMapTableContributorInsights, Da as isTerminationProtectionPropagationError, Dc as emrClusterInstancesReplaced, Dt as enclosingDeadlineRemainingMs, E as reverseMapIndexContributorInsights, Ea as ec2InstanceProtectionSite, Ec as ecsServiceLaunchTypeSetOrChanged, Et as enclosingDeadlineExpired, F as beginDeleteWait, Fi as earliestDefined, G as relayedIndexBusyDelete, Ga as s3BucketRegionalDomainName, Gi as DBPROXY_TAGS_WHAT, Gn as getCurrentProducerRegions, Gs as withheldAccountClause, H as TABLE_INDEX_NOUN, Ha as s3BucketArn, Hc as passedNoEchoParametersOf, Hr as awaitInFlightSibling, I as compensateRemovedDeletionProtection, Id as describeFileReadFailure, J as readbackVectorIndexes, Jc as markSameGenerationBag, Ji as readTagList, Jn as isRedactedRecordedValue, Js as findSdkUnwiredProperties, K as waitForIndexesSettled, Ka as s3BucketWebsiteUrl, Ki as DBPROXY_TAG_OPTIONS, Kr as replacedDeleteFailureVerdict, L as deleteBudgetKey, Ld as displayAssemblyPath, Li as reserveStackCreateToken, M as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, N as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Na as isUsableAttemptedName, Ns as refuseMalformedResourcesForDestroy, O as stripIndexContributorInsights, Oa as observeThenDisableInstanceApiTermination, Oc as canonicalLambdaFunctionName, Ol as carriesSecretMask, Oo as parseWebACLArn, P as DYNAMODB_DELETE_POLL_COST_MS, Q as isTtlAlreadyDisabled, Qi as definedAttributes, Qt as withNestedStackContext, R as resolveDynamoDbDeleteBudgetClock, Rd as renderAssemblyPathEscape, Ro as accountArgs, S as indexDeclaresContributorInsights, Sa as deleteSkipReason, Sd as canonicalizeRegion, Si as secretNamedAttributeNamesOf, T as readContributorInsightsSpec, Tl as recordAttributeIdCopy, U as deleteTableWithIndexBusyRetry, Ua as s3BucketDomainName, Ui as isRefusedByName, V as INDEX_SETTLE_POLL_INTERVAL_MS, Va as isSettledInstanceState, Vr as refuseRestoreFromItself, W as maskedLogger, Wa as s3BucketDualStackDomainName, Wi as markDeleteStarted, Wr as getStackRecords, Wt as getNestedRevertRun, X as vectorIndexesSettled, Xc as recordReferenceProvenanceEntry, Xi as tagMapAsList, Xn as redactedDeleteAddressSkip, Xs as withoutSdkUnwiredProperties, Y as vectorIndexesForCreate, Yc as redactForState, Yi as refuseMalformedDesiredTags, Yn as redactedDeleteAddressFields, Z as vectorIndexesShapeDetail, Za as outputReferenceProvenanceOf, Zc as snapshotPassProvenance, Zi as tagPlanWarning, Zt as getCurrentNestedStackContext, _ as streamMemberRefusals, _a as unchangedBehindSecretReference, _c as requireConfigArray, _o as getAccountInfo, _t as findNestedTemplateTreeDefect, aa as waitForLambdaFunctionActive, ac as WARM_THROUGHPUT_MEMBERS, at as hasCdkAutoDeleteTag, b as CONTRIBUTOR_INSIGHTS_KEY, bt as renderNestedTemplateTreeDefect, bu as rewriteTemplateAssetReferences, c as DynamoDBGlobalTableProvider, cc as toCfnInteger, cn as chunks, ct as markRefusedBeforeApplying, d as declaredStreamPolicyMember, dc as coerceCfnInteger, dn as withApiLimit, el as hasMaskableValues, et as planTimeToLive, f as declaredStreamTagsMember, fc as configBooleanRefusal, fu as timePhase, g as streamDeclaresTags, ga as onlySecretReferencesDiffer, gc as replayWarn, gl as dynamicReferenceTokens, h as streamDeclaresPolicy, ha as slowCcOperationTimeoutMs, hc as readConfigString, hu as stringifyValue, it as S3_AUTO_DELETE_OBJECTS_TAG, jo as passedParameterClassesOf, k as waitForGoneAfterDelete, ka as reDisableInstanceApiTermination, kc as lambdaFunctionNameForMask, l as STREAM_POLICY_KEY, la as getCurrentResourceSecrets, lc as toFiniteNumber, ln as isAccessDeniedError, m as reverseMapStreamPolicy, mc as configStringRefusal, ml as withoutPhysicalNameCopies, nt as sendTtlWaitingOutRateLimit, oc as coerceWarmThroughput$1, ot as isTruthyCfnBoolean, p as planStreamMemberOps, pc as configIntegerRefusal, ps as refuseMalformedNestedChildOutputs, q as planVectorIndexUpdates, qi as planTagDiff, qn as REDACTED_DELETE_ADDRESS_SKIP_REASON, qt as revertNestedChildFromJournal, rt as ECR_AUTO_DELETE_IMAGES_TAG, sc as isWarmThroughputDecrease, st as getPriorAttempts, t as DeployEngine, tt as readTtlSpec, u as STREAM_TAGS_KEY, uc as coerceCfnBoolean, un as lookupEachName, v as streamPolicyMatchesDeclared, vc as requireConfigObject, vt as isAbsoluteAssetPath, w as planIndexContributorInsightsOps, wc as blockDeviceMappingsDifferOnlyInDeleteOnTermination, wl as physicalNameCopiesOf, x as contributorInsightsRefusals, y as streamTagsMatchDeclared, yc as requireConfigString, yd as decodeListingKey, yt as listNestedTemplateRows, z as resolveDynamoDbDeleteBudgetMs, zd as resolveAssemblyPath, zi as acquireIdempotencyToken } from "./deploy-engine-
|
|
6
|
-
import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-
|
|
7
|
-
import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-
|
|
8
|
-
import { n as modifyDbInstanceWhenAvailable } from "./db-instance-modify-retry-
|
|
9
|
-
import { RDSProvider } from "./rds-provider-
|
|
10
|
-
import { NeptuneProvider } from "./neptune-provider-
|
|
11
|
-
import { ASGProvider } from "./asg-provider-
|
|
5
|
+
import { $ as isTtlRateLimited, $i as stringifyIfAssigned, A as resolvedResourceTimeoutMs, Aa as reEnableInstanceApiTermination, Ac as sameLambdaFunctionAddress, B as DELETE_INDEX_WAIT_PROCEED_NOTE, C as planContributorInsightsOp, Ca as withIndeterminateGuard, Cc as withRetry, Cd as derivePartitionAndUrlSuffix, Cl as recoverMaskedOutput, D as reverseMapTableContributorInsights, Da as isTerminationProtectionPropagationError, Dc as emrClusterInstancesReplaced, Dt as enclosingDeadlineRemainingMs, E as reverseMapIndexContributorInsights, Ea as ec2InstanceProtectionSite, Ec as ecsServiceLaunchTypeSetOrChanged, Et as enclosingDeadlineExpired, F as beginDeleteWait, Fi as earliestDefined, G as relayedIndexBusyDelete, Ga as s3BucketRegionalDomainName, Gi as DBPROXY_TAGS_WHAT, Gn as getCurrentProducerRegions, Gs as withheldAccountClause, H as TABLE_INDEX_NOUN, Ha as s3BucketArn, Hc as passedNoEchoParametersOf, Hr as awaitInFlightSibling, I as compensateRemovedDeletionProtection, Id as describeFileReadFailure, J as readbackVectorIndexes, Jc as markSameGenerationBag, Ji as readTagList, Jn as isRedactedRecordedValue, Js as findSdkUnwiredProperties, K as waitForIndexesSettled, Ka as s3BucketWebsiteUrl, Ki as DBPROXY_TAG_OPTIONS, Kr as replacedDeleteFailureVerdict, L as deleteBudgetKey, Ld as displayAssemblyPath, Li as reserveStackCreateToken, M as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, N as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Na as isUsableAttemptedName, Ns as refuseMalformedResourcesForDestroy, O as stripIndexContributorInsights, Oa as observeThenDisableInstanceApiTermination, Oc as canonicalLambdaFunctionName, Ol as carriesSecretMask, Oo as parseWebACLArn, P as DYNAMODB_DELETE_POLL_COST_MS, Q as isTtlAlreadyDisabled, Qi as definedAttributes, Qt as withNestedStackContext, R as resolveDynamoDbDeleteBudgetClock, Rd as renderAssemblyPathEscape, Ro as accountArgs, S as indexDeclaresContributorInsights, Sa as deleteSkipReason, Sd as canonicalizeRegion, Si as secretNamedAttributeNamesOf, T as readContributorInsightsSpec, Tl as recordAttributeIdCopy, U as deleteTableWithIndexBusyRetry, Ua as s3BucketDomainName, Ui as isRefusedByName, V as INDEX_SETTLE_POLL_INTERVAL_MS, Va as isSettledInstanceState, Vr as refuseRestoreFromItself, W as maskedLogger, Wa as s3BucketDualStackDomainName, Wi as markDeleteStarted, Wr as getStackRecords, Wt as getNestedRevertRun, X as vectorIndexesSettled, Xc as recordReferenceProvenanceEntry, Xi as tagMapAsList, Xn as redactedDeleteAddressSkip, Xs as withoutSdkUnwiredProperties, Y as vectorIndexesForCreate, Yc as redactForState, Yi as refuseMalformedDesiredTags, Yn as redactedDeleteAddressFields, Z as vectorIndexesShapeDetail, Za as outputReferenceProvenanceOf, Zc as snapshotPassProvenance, Zi as tagPlanWarning, Zt as getCurrentNestedStackContext, _ as streamMemberRefusals, _a as unchangedBehindSecretReference, _c as requireConfigArray, _o as getAccountInfo, _t as findNestedTemplateTreeDefect, aa as waitForLambdaFunctionActive, ac as WARM_THROUGHPUT_MEMBERS, at as hasCdkAutoDeleteTag, b as CONTRIBUTOR_INSIGHTS_KEY, bt as renderNestedTemplateTreeDefect, bu as rewriteTemplateAssetReferences, c as DynamoDBGlobalTableProvider, cc as toCfnInteger, cn as chunks, ct as markRefusedBeforeApplying, d as declaredStreamPolicyMember, dc as coerceCfnInteger, dn as withApiLimit, el as hasMaskableValues, et as planTimeToLive, f as declaredStreamTagsMember, fc as configBooleanRefusal, fu as timePhase, g as streamDeclaresTags, ga as onlySecretReferencesDiffer, gc as replayWarn, gl as dynamicReferenceTokens, h as streamDeclaresPolicy, ha as slowCcOperationTimeoutMs, hc as readConfigString, hu as stringifyValue, it as S3_AUTO_DELETE_OBJECTS_TAG, jo as passedParameterClassesOf, k as waitForGoneAfterDelete, ka as reDisableInstanceApiTermination, kc as lambdaFunctionNameForMask, l as STREAM_POLICY_KEY, la as getCurrentResourceSecrets, lc as toFiniteNumber, ln as isAccessDeniedError, m as reverseMapStreamPolicy, mc as configStringRefusal, ml as withoutPhysicalNameCopies, nt as sendTtlWaitingOutRateLimit, oc as coerceWarmThroughput$1, ot as isTruthyCfnBoolean, p as planStreamMemberOps, pc as configIntegerRefusal, ps as refuseMalformedNestedChildOutputs, q as planVectorIndexUpdates, qi as planTagDiff, qn as REDACTED_DELETE_ADDRESS_SKIP_REASON, qt as revertNestedChildFromJournal, rt as ECR_AUTO_DELETE_IMAGES_TAG, sc as isWarmThroughputDecrease, st as getPriorAttempts, t as DeployEngine, tt as readTtlSpec, u as STREAM_TAGS_KEY, uc as coerceCfnBoolean, un as lookupEachName, v as streamPolicyMatchesDeclared, vc as requireConfigObject, vt as isAbsoluteAssetPath, w as planIndexContributorInsightsOps, wc as blockDeviceMappingsDifferOnlyInDeleteOnTermination, wl as physicalNameCopiesOf, x as contributorInsightsRefusals, y as streamTagsMatchDeclared, yc as requireConfigString, yd as decodeListingKey, yt as listNestedTemplateRows, z as resolveDynamoDbDeleteBudgetMs, zd as resolveAssemblyPath, zi as acquireIdempotencyToken } from "./deploy-engine-l-wZygYT.js";
|
|
6
|
+
import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-CJBhHr7l.js";
|
|
7
|
+
import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-ml6yCB64.js";
|
|
8
|
+
import { n as modifyDbInstanceWhenAvailable } from "./db-instance-modify-retry-2tRANTVg.js";
|
|
9
|
+
import { RDSProvider } from "./rds-provider-C6299G23.js";
|
|
10
|
+
import { NeptuneProvider } from "./neptune-provider-D4a9cJ2i.js";
|
|
11
|
+
import { ASGProvider } from "./asg-provider-D1KLOLzB.js";
|
|
12
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
13
13
|
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";
|
|
14
14
|
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";
|
|
@@ -16,7 +16,7 @@ import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQ
|
|
|
16
16
|
import { CreateTopicCommand, DeleteTopicCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, InvalidParameterException, ListSubscriptionsByTopicCommand, ListTagsForResourceCommand, ListTopicsCommand, NotFoundException, SNSClient, SetSubscriptionAttributesCommand, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand } from "@aws-sdk/client-sns";
|
|
17
17
|
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";
|
|
18
18
|
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
19
|
-
import { AllocateAddressCommand, AssociateAddressCommand, AssociateIamInstanceProfileCommand, AssociateNatGatewayAddressCommand, AssociateRouteTableCommand, AttachInternetGatewayCommand, AttachVpnGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAddressesCommand, DescribeAvailabilityZonesCommand, DescribeIamInstanceProfileAssociationsCommand, DescribeInstanceAttributeCommand, DescribeInstanceCreditSpecificationsCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupRulesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DescribeVpnGatewaysCommand, DetachInternetGatewayCommand, DetachVpnGatewayCommand, DisassociateAddressCommand, DisassociateIamInstanceProfileCommand, DisassociateNatGatewayAddressCommand, DisassociateRouteTableCommand, EC2Client, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ModifyVpcTenancyCommand, MonitorInstancesCommand, ReleaseAddressCommand, ReplaceIamInstanceProfileAssociationCommand, ReplaceNetworkAclAssociationCommand, ReplaceNetworkAclEntryCommand, ReplaceRouteCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, StartInstancesCommand, StopInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
|
|
19
|
+
import { AllocateAddressCommand, AssociateAddressCommand, AssociateIamInstanceProfileCommand, AssociateNatGatewayAddressCommand, AssociateRouteTableCommand, AttachInternetGatewayCommand, AttachVpnGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAddressesCommand, DescribeAvailabilityZonesCommand, DescribeIamInstanceProfileAssociationsCommand, DescribeInstanceAttributeCommand, DescribeInstanceCreditSpecificationsCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupRulesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DescribeVpnGatewaysCommand, DetachInternetGatewayCommand, DetachVpnGatewayCommand, DisassociateAddressCommand, DisassociateIamInstanceProfileCommand, DisassociateNatGatewayAddressCommand, DisassociateRouteTableCommand, EC2Client, GetIpamPoolAllocationsCommand, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifyPrivateDnsNameOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ModifyVpcTenancyCommand, MonitorInstancesCommand, ReleaseAddressCommand, ReplaceIamInstanceProfileAssociationCommand, ReplaceNetworkAclAssociationCommand, ReplaceNetworkAclEntryCommand, ReplaceRouteCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, StartInstancesCommand, StopInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
|
|
20
20
|
import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DisableKinesisStreamingDestinationCommand, DynamoDBClient, EnableKinesisStreamingDestinationCommand, GetResourcePolicyCommand, ListTagsOfResourceCommand, PolicyNotFoundException, PutResourcePolicyCommand, ResourceNotFoundException as ResourceNotFoundException$1, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateContributorInsightsCommand, UpdateKinesisStreamingDestinationCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
|
|
21
21
|
import { APIGatewayClient, CreateAuthorizerCommand, CreateDeploymentCommand, CreateResourceCommand, CreateStageCommand, DeleteAuthorizerCommand, DeleteDeploymentCommand, DeleteIntegrationCommand, DeleteIntegrationResponseCommand, DeleteMethodCommand, DeleteMethodResponseCommand, DeleteResourceCommand, DeleteStageCommand, GetAccountCommand, GetAuthorizerCommand, GetAuthorizersCommand, GetDeploymentCommand, GetDeploymentsCommand, GetMethodCommand, GetResourceCommand, GetStageCommand, NotFoundException as NotFoundException$1, PutIntegrationCommand, PutIntegrationResponseCommand, PutMethodCommand, PutMethodResponseCommand, TagResourceCommand as TagResourceCommand$3, UntagResourceCommand as UntagResourceCommand$3, UpdateAccountCommand, UpdateAuthorizerCommand, UpdateDeploymentCommand, UpdateMethodCommand, UpdateStageCommand } from "@aws-sdk/client-api-gateway";
|
|
22
22
|
import { CreateEventBusCommand, DeleteEventBusCommand, DeleteRuleCommand, DescribeEventBusCommand, DescribeRuleCommand, EventBridgeClient, ListRulesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$1, ListTargetsByRuleCommand, PutPermissionCommand, PutRuleCommand, PutTargetsCommand, RemoveTargetsCommand, ResourceNotFoundException as ResourceNotFoundException$2, TagResourceCommand as TagResourceCommand$4, UntagResourceCommand as UntagResourceCommand$4, UpdateEventBusCommand } from "@aws-sdk/client-eventbridge";
|
|
@@ -3720,6 +3720,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
3720
3720
|
const holder = this.createClientHolder;
|
|
3721
3721
|
holder.client ??= this.s3Client.config.region().then((region) => withoutServerErrorRetries(new S3Client({
|
|
3722
3722
|
...clientDefaultsFor(this.credentialConfig),
|
|
3723
|
+
...s3ClientDefaults(),
|
|
3723
3724
|
region
|
|
3724
3725
|
})), (error) => {
|
|
3725
3726
|
holder.client = void 0;
|
|
@@ -10033,6 +10034,11 @@ const ARN_SERVICE_TO_EVENT_SOURCE_KIND = {
|
|
|
10033
10034
|
mq: "mq",
|
|
10034
10035
|
rds: "documentdb"
|
|
10035
10036
|
};
|
|
10037
|
+
function enabledFromState(state, properties) {
|
|
10038
|
+
if (state === "Enabled" || state === "Enabling") return true;
|
|
10039
|
+
if (state === "Disabled" || state === "Disabling") return false;
|
|
10040
|
+
return coerceCfnBoolean(properties?.["Enabled"]) ?? true;
|
|
10041
|
+
}
|
|
10036
10042
|
function classifyEventSource(resp) {
|
|
10037
10043
|
if (resp.SelfManagedEventSource !== void 0) return "kafka";
|
|
10038
10044
|
if (resp.SelfManagedKafkaEventSourceConfig !== void 0) return "kafka";
|
|
@@ -10589,7 +10595,7 @@ var LambdaEventSourceMappingProvider = class {
|
|
|
10589
10595
|
const date = raw instanceof Date ? raw : new Date(raw);
|
|
10590
10596
|
result["StartingPositionTimestamp"] = Math.floor(date.getTime() / 1e3);
|
|
10591
10597
|
}
|
|
10592
|
-
if (resp.State !== void 0) result["Enabled"] = resp.State
|
|
10598
|
+
if (resp.State !== void 0) result["Enabled"] = enabledFromState(resp.State, properties);
|
|
10593
10599
|
let tags = [];
|
|
10594
10600
|
if (resp.EventSourceMappingArn) try {
|
|
10595
10601
|
const tagMap = (await this.lambdaClient.send(new ListTagsCommand({ Resource: resp.EventSourceMappingArn }))).Tags ?? {};
|
|
@@ -17281,6 +17287,13 @@ const STOPPABLE_INSTANCE_STATES = /* @__PURE__ */ new Set([
|
|
|
17281
17287
|
]);
|
|
17282
17288
|
const instancesLeftStoppedByCdkd = /* @__PURE__ */ new Set();
|
|
17283
17289
|
const instanceStoppedAfterStart = /* @__PURE__ */ new WeakSet();
|
|
17290
|
+
function instanceStopMembers(plan) {
|
|
17291
|
+
return [
|
|
17292
|
+
plan.instanceType !== void 0 ? "InstanceType" : "",
|
|
17293
|
+
plan.userData !== void 0 ? "UserData" : "",
|
|
17294
|
+
plan.privateDnsNameOptions?.PrivateDnsHostnameType !== void 0 ? "PrivateDnsNameOptions.HostnameType" : ""
|
|
17295
|
+
].filter(Boolean);
|
|
17296
|
+
}
|
|
17284
17297
|
function isRecordedStandIn$1(value) {
|
|
17285
17298
|
if (Array.isArray(value)) return value.some(isRecordedStandIn$1);
|
|
17286
17299
|
if (value !== null && typeof value === "object") return Object.values(value).some(isRecordedStandIn$1);
|
|
@@ -17575,7 +17588,9 @@ function readbackNatZoneAddresses(live, recorded) {
|
|
|
17575
17588
|
}
|
|
17576
17589
|
const EIP_ALLOCATION_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidAllocationID.NotFound"]);
|
|
17577
17590
|
const INSTANCE_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidInstanceID.NotFound"]);
|
|
17591
|
+
const LAUNCHED_INSTANCE_VISIBILITY_ATTEMPTS = 8;
|
|
17578
17592
|
const VPC_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidVpcID.NotFound"]);
|
|
17593
|
+
const IPAM_POOL_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidIpamPoolId.NotFound"]);
|
|
17579
17594
|
const SUBNET_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidSubnetID.NotFound"]);
|
|
17580
17595
|
const SECURITY_GROUP_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidGroup.NotFound"]);
|
|
17581
17596
|
const NAT_GATEWAY_ID_PATTERN = /^nat-[0-9a-f]+$/;
|
|
@@ -17597,6 +17612,82 @@ const createSubnetLatch = new AmbiguousCreateLatch("ec2:CreateSubnet");
|
|
|
17597
17612
|
const createInternetGatewayLatch = new AmbiguousCreateLatch("ec2:CreateInternetGateway");
|
|
17598
17613
|
const allocateAddressLatch = new AmbiguousCreateLatch("ec2:AllocateAddress");
|
|
17599
17614
|
const ec2IdsCreatedByThisProcess = new RecentIdSet();
|
|
17615
|
+
const vpcIpamReleaseWait = {
|
|
17616
|
+
pollIntervalMs: 1e4,
|
|
17617
|
+
maxWaitMs: 15e5
|
|
17618
|
+
};
|
|
17619
|
+
const VPC_ENCRYPTION_CONTROL_EXCLUSIONS = [
|
|
17620
|
+
"InternetGatewayExclusion",
|
|
17621
|
+
"EgressOnlyInternetGatewayExclusion",
|
|
17622
|
+
"NatGatewayExclusion",
|
|
17623
|
+
"VirtualPrivateGatewayExclusion",
|
|
17624
|
+
"VpcPeeringExclusion",
|
|
17625
|
+
"LambdaExclusion",
|
|
17626
|
+
"VpcLatticeExclusion",
|
|
17627
|
+
"ElasticFileSystemExclusion"
|
|
17628
|
+
];
|
|
17629
|
+
function replayedRecordNote(context) {
|
|
17630
|
+
return context?.replayingState === true ? " The value comes from the state record being restored." : "";
|
|
17631
|
+
}
|
|
17632
|
+
const VPC_CREATE_ONLY_SENT = [
|
|
17633
|
+
"Ipv4IpamPoolId",
|
|
17634
|
+
"Ipv4NetmaskLength",
|
|
17635
|
+
"VpcEncryptionControl"
|
|
17636
|
+
];
|
|
17637
|
+
const INSTANCE_CREATE_ONLY_SENT = [
|
|
17638
|
+
"CpuOptions",
|
|
17639
|
+
"HibernationOptions",
|
|
17640
|
+
"PlacementGroupName",
|
|
17641
|
+
"PrivateIpAddress",
|
|
17642
|
+
"Ipv6AddressCount",
|
|
17643
|
+
"Ipv6Addresses"
|
|
17644
|
+
];
|
|
17645
|
+
function instanceIpv6AddressesRefusal(value, resourceType) {
|
|
17646
|
+
if (value === void 0 || value === null) return void 0;
|
|
17647
|
+
if (!Array.isArray(value)) return `${resourceType}.Ipv6Addresses must be a list of { Ipv6Address } entries (got ${typeof value === "object" ? "an object" : `a ${typeof value}`})`;
|
|
17648
|
+
for (const [i, item] of value.entries()) {
|
|
17649
|
+
const path = `${resourceType}.Ipv6Addresses[${i}]`;
|
|
17650
|
+
const refusal = item === void 0 || item === null ? `${path} must be an object (got ${item === null ? "null" : "undefined"})` : configStringRefusal(item, "Ipv6Address", "", path);
|
|
17651
|
+
if (refusal !== void 0) return refusal;
|
|
17652
|
+
const address = item["Ipv6Address"];
|
|
17653
|
+
if (typeof address !== "string" || address === "") return `${path}.Ipv6Address is required (the address to assign)`;
|
|
17654
|
+
}
|
|
17655
|
+
}
|
|
17656
|
+
function privateDnsNameOptionsRefusal(value, resourceType) {
|
|
17657
|
+
const path = `${resourceType}.PrivateDnsNameOptions`;
|
|
17658
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value) && value["HostnameType"] === "") return `${path}.HostnameType must not be empty`;
|
|
17659
|
+
return configStringRefusal(value, "HostnameType", "", path) ?? configBooleanRefusal(value, "EnableResourceNameDnsARecord", path) ?? configBooleanRefusal(value, "EnableResourceNameDnsAAAARecord", path);
|
|
17660
|
+
}
|
|
17661
|
+
function privateDnsNameOptionsRequest(value) {
|
|
17662
|
+
if (value === void 0 || value === null) return void 0;
|
|
17663
|
+
const block = value;
|
|
17664
|
+
const hostnameType = block["HostnameType"];
|
|
17665
|
+
const aRecord = coerceCfnBoolean(block["EnableResourceNameDnsARecord"]);
|
|
17666
|
+
const aaaaRecord = coerceCfnBoolean(block["EnableResourceNameDnsAAAARecord"]);
|
|
17667
|
+
return {
|
|
17668
|
+
...typeof hostnameType === "string" && hostnameType !== "" && { HostnameType: hostnameType },
|
|
17669
|
+
...aRecord !== void 0 && { EnableResourceNameDnsARecord: aRecord },
|
|
17670
|
+
...aaaaRecord !== void 0 && { EnableResourceNameDnsAAAARecord: aaaaRecord }
|
|
17671
|
+
};
|
|
17672
|
+
}
|
|
17673
|
+
function foldCreateOnlySent(key, value) {
|
|
17674
|
+
const asRecord = (v) => v !== null && typeof v === "object" && !Array.isArray(v) ? v : void 0;
|
|
17675
|
+
if (key === "Ipv4NetmaskLength") return coerceCfnInteger(value) ?? value;
|
|
17676
|
+
if (key === "CpuOptions") {
|
|
17677
|
+
const cpu = asRecord(value);
|
|
17678
|
+
if (cpu === void 0) return value;
|
|
17679
|
+
return Object.fromEntries(Object.entries(cpu).map(([k, v]) => [k, coerceCfnInteger(v) ?? v]));
|
|
17680
|
+
}
|
|
17681
|
+
if (key === "HibernationOptions") {
|
|
17682
|
+
const hibernation = asRecord(value);
|
|
17683
|
+
if (hibernation === void 0) return value;
|
|
17684
|
+
return Object.fromEntries(Object.entries(hibernation).map(([k, v]) => [k, coerceCfnBoolean(v) ?? v]));
|
|
17685
|
+
}
|
|
17686
|
+
return value;
|
|
17687
|
+
}
|
|
17688
|
+
function sameCreateOnlySent(key, a, b) {
|
|
17689
|
+
return isDeepStrictEqual(foldCreateOnlySent(key, a), foldCreateOnlySent(key, b));
|
|
17690
|
+
}
|
|
17600
17691
|
const mayBeLostCreate = (tags, sent) => tags === void 0 || tags.length === 0 || sent.length > 0 && tagListsMatch(tags, sent);
|
|
17601
17692
|
const lostCreateNoun = (what, sent, adjective) => sent.length === 0 ? `${adjective !== void 0 ? `${adjective}, ` : ""}untagged ${what}` : `${adjective !== void 0 ? `${adjective} ` : ""}${what} with no tags or exactly the template's tags`;
|
|
17602
17693
|
function isCreateTagsDenial(error) {
|
|
@@ -17624,7 +17715,10 @@ var EC2Provider = class {
|
|
|
17624
17715
|
"InstanceTenancy",
|
|
17625
17716
|
"EnableDnsHostnames",
|
|
17626
17717
|
"EnableDnsSupport",
|
|
17627
|
-
"Tags"
|
|
17718
|
+
"Tags",
|
|
17719
|
+
"Ipv4IpamPoolId",
|
|
17720
|
+
"Ipv4NetmaskLength",
|
|
17721
|
+
"VpcEncryptionControl"
|
|
17628
17722
|
])],
|
|
17629
17723
|
["AWS::EC2::Subnet", /* @__PURE__ */ new Set([
|
|
17630
17724
|
"VpcId",
|
|
@@ -17716,7 +17810,19 @@ var EC2Provider = class {
|
|
|
17716
17810
|
"MetadataOptions",
|
|
17717
17811
|
"Monitoring",
|
|
17718
17812
|
"EbsOptimized",
|
|
17719
|
-
"CreditSpecification"
|
|
17813
|
+
"CreditSpecification",
|
|
17814
|
+
"CpuOptions",
|
|
17815
|
+
"HibernationOptions",
|
|
17816
|
+
"InstanceInitiatedShutdownBehavior",
|
|
17817
|
+
"SourceDestCheck",
|
|
17818
|
+
"Tenancy",
|
|
17819
|
+
"PlacementGroupName",
|
|
17820
|
+
"PrivateIpAddress",
|
|
17821
|
+
"PropagateTagsToVolumeOnCreation",
|
|
17822
|
+
"AdditionalInfo",
|
|
17823
|
+
"Ipv6AddressCount",
|
|
17824
|
+
"Ipv6Addresses",
|
|
17825
|
+
"PrivateDnsNameOptions"
|
|
17720
17826
|
])],
|
|
17721
17827
|
["AWS::EC2::NetworkAcl", /* @__PURE__ */ new Set(["VpcId", "Tags"])],
|
|
17722
17828
|
["AWS::EC2::NetworkAclEntry", /* @__PURE__ */ new Set([
|
|
@@ -17732,7 +17838,7 @@ var EC2Provider = class {
|
|
|
17732
17838
|
])],
|
|
17733
17839
|
["AWS::EC2::SubnetNetworkAclAssociation", /* @__PURE__ */ new Set(["SubnetId", "NetworkAclId"])]
|
|
17734
17840
|
]);
|
|
17735
|
-
removalDefaults = /* @__PURE__ */ new Map([["AWS::EC2::VPC", /* @__PURE__ */ new Map([["EnableDnsHostnames", false], ["EnableDnsSupport", true]])], ["AWS::EC2::Instance", /* @__PURE__ */ new Map([["Monitoring", false]])]]);
|
|
17841
|
+
removalDefaults = /* @__PURE__ */ new Map([["AWS::EC2::VPC", /* @__PURE__ */ new Map([["EnableDnsHostnames", false], ["EnableDnsSupport", true]])], ["AWS::EC2::Instance", /* @__PURE__ */ new Map([["Monitoring", false], ["SourceDestCheck", true]])]]);
|
|
17736
17842
|
unhandledByDesign = /* @__PURE__ */ new Map([
|
|
17737
17843
|
["AWS::EC2::Instance", /* @__PURE__ */ new Map([["ElasticGpuSpecifications", "AWS Elastic GPU end-of-life (announced 2023-11); no replacement API"], ["ElasticInferenceAccelerators", "AWS Elastic Inference end-of-life 2024-04; use AWS Inferentia / Trainium accelerator instance families instead"]])],
|
|
17738
17844
|
["AWS::EC2::SecurityGroupIngress", /* @__PURE__ */ new Map([["GroupName", "EC2-Classic-only — use GroupId for VPC security groups (EC2-Classic retired 2022-08-15)"], ["SourceSecurityGroupName", "EC2-Classic-only — use SourceSecurityGroupId for VPC peer security groups (EC2-Classic retired 2022-08-15)"]])],
|
|
@@ -17775,27 +17881,75 @@ var EC2Provider = class {
|
|
|
17775
17881
|
inspect: (id) => lookup.inspect(aws, id, regionArg)
|
|
17776
17882
|
});
|
|
17777
17883
|
}
|
|
17778
|
-
async reportPossibleOrphanVpcs(logicalId,
|
|
17884
|
+
async reportPossibleOrphanVpcs(logicalId, match, sent, window, context) {
|
|
17779
17885
|
const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
|
|
17780
|
-
const wanted = canonicalizeIpv4Cidr(cidrBlock) ?? cidrBlock;
|
|
17886
|
+
const wanted = "cidrBlock" in match ? canonicalizeIpv4Cidr(match.cidrBlock) ?? match.cidrBlock : void 0;
|
|
17887
|
+
const listVpcs = async (inPool) => collectOrphanIds(async (token) => {
|
|
17888
|
+
const page = await this.ec2Client.send(new DescribeVpcsCommand({
|
|
17889
|
+
MaxResults: ORPHAN_LIST_PAGE_SIZE$2,
|
|
17890
|
+
NextToken: token
|
|
17891
|
+
}));
|
|
17892
|
+
return {
|
|
17893
|
+
items: page.Vpcs ?? [],
|
|
17894
|
+
next: page.NextToken
|
|
17895
|
+
};
|
|
17896
|
+
}, (vpc) => vpc.VpcId !== void 0 && vpc.IsDefault !== true && mayBeLostCreate(vpc.Tags, sent) && vpc.CidrBlock !== void 0 && (inPool !== void 0 ? inPool.has(vpc.VpcId) : (canonicalizeIpv4Cidr(vpc.CidrBlock) ?? vpc.CidrBlock) === wanted) && !ec2IdsCreatedByThisProcess.has(vpc.VpcId) ? vpc.VpcId : void 0);
|
|
17781
17897
|
await this.reportPossibleEc2Orphans(logicalId, window, log, {
|
|
17782
17898
|
action: "CreateVpc",
|
|
17783
|
-
listAction: "DescribeVpcs",
|
|
17784
|
-
subject: `a VPC with CIDR ${log.value(cidrBlock)}`,
|
|
17899
|
+
listAction: "cidrBlock" in match ? "DescribeVpcs" : "GetIpamPoolAllocations + DescribeVpcs",
|
|
17900
|
+
subject: "cidrBlock" in match ? `a VPC with CIDR ${log.value(match.cidrBlock)}` : `a VPC allocated from IPAM pool ${log.value(match.ipamPoolId)}`,
|
|
17785
17901
|
noun: lostCreateNoun("VPC(s)", sent),
|
|
17786
|
-
list:
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17902
|
+
list: async () => {
|
|
17903
|
+
if ("cidrBlock" in match) return listVpcs(void 0);
|
|
17904
|
+
const allocated = await collectOrphanIds(async (token) => {
|
|
17905
|
+
const page = await this.ec2Client.send(new GetIpamPoolAllocationsCommand({
|
|
17906
|
+
IpamPoolId: match.ipamPoolId,
|
|
17907
|
+
NextToken: token
|
|
17908
|
+
}));
|
|
17909
|
+
return {
|
|
17910
|
+
items: page.IpamPoolAllocations ?? [],
|
|
17911
|
+
next: page.NextToken
|
|
17912
|
+
};
|
|
17913
|
+
}, (allocation) => allocation.ResourceType === "vpc" && allocation.ResourceId !== void 0 ? allocation.ResourceId : void 0);
|
|
17914
|
+
const vpcs = await listVpcs(new Set(allocated.ids));
|
|
17791
17915
|
return {
|
|
17792
|
-
|
|
17793
|
-
|
|
17916
|
+
ids: vpcs.ids,
|
|
17917
|
+
truncated: allocated.truncated || vpcs.truncated
|
|
17794
17918
|
};
|
|
17795
|
-
},
|
|
17919
|
+
},
|
|
17796
17920
|
inspect: (aws, id, regionArg) => aws`aws ec2 describe-vpcs --vpc-ids ${id}${regionArg}`.render()
|
|
17797
17921
|
});
|
|
17798
17922
|
}
|
|
17923
|
+
readVpcIpamAllocation(properties, resourceType, logicalId, context) {
|
|
17924
|
+
const refusal = configStringRefusal(properties, "Ipv4IpamPoolId", "", resourceType) ?? (properties["Ipv4IpamPoolId"] === "" ? `${resourceType}.Ipv4IpamPoolId must not be blank` : void 0) ?? configIntegerRefusal(properties, "Ipv4NetmaskLength", resourceType, 0, 32);
|
|
17925
|
+
if (refusal !== void 0) throw markNonRetryable(new ProvisioningError(`${refusal}. The VPC ${logicalId} was not created.${replayedRecordNote(context)}`, resourceType, logicalId));
|
|
17926
|
+
const poolId = properties["Ipv4IpamPoolId"];
|
|
17927
|
+
const netmaskLength = coerceCfnInteger(properties["Ipv4NetmaskLength"]);
|
|
17928
|
+
return {
|
|
17929
|
+
...typeof poolId === "string" && poolId !== "" && { poolId },
|
|
17930
|
+
...netmaskLength !== void 0 && { netmaskLength }
|
|
17931
|
+
};
|
|
17932
|
+
}
|
|
17933
|
+
buildVpcEncryptionControl(value, resourceType, logicalId, context) {
|
|
17934
|
+
if (value === void 0 || value === null) return void 0;
|
|
17935
|
+
const path = `${resourceType} VpcEncryptionControl`;
|
|
17936
|
+
const refuse = (reason) => {
|
|
17937
|
+
throw markNonRetryable(new ProvisioningError(`${reason}. The VPC ${logicalId} was not created.${replayedRecordNote(context)}`, resourceType, logicalId));
|
|
17938
|
+
};
|
|
17939
|
+
const containerRefusal = configStringRefusal(value, "Mode", "", path);
|
|
17940
|
+
if (containerRefusal !== void 0) return refuse(containerRefusal);
|
|
17941
|
+
const block = value;
|
|
17942
|
+
const mode = block["Mode"];
|
|
17943
|
+
if (mode === "") return refuse(`${path}.Mode must not be blank`);
|
|
17944
|
+
const config = { Mode: typeof mode === "string" ? mode : void 0 };
|
|
17945
|
+
for (const key of VPC_ENCRYPTION_CONTROL_EXCLUSIONS) {
|
|
17946
|
+
const memberRefusal = configStringRefusal(block, key, "", path);
|
|
17947
|
+
if (memberRefusal !== void 0) return refuse(memberRefusal);
|
|
17948
|
+
const member = block[key];
|
|
17949
|
+
if (typeof member === "string" && member !== "") config[key] = member;
|
|
17950
|
+
}
|
|
17951
|
+
return config;
|
|
17952
|
+
}
|
|
17799
17953
|
async reportPossibleOrphanSubnets(logicalId, vpcId, cidrBlock, sent, window, context) {
|
|
17800
17954
|
const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
|
|
17801
17955
|
const wanted = canonicalizeIpv4Cidr(cidrBlock) ?? cidrBlock;
|
|
@@ -17917,7 +18071,7 @@ var EC2Provider = class {
|
|
|
17917
18071
|
}
|
|
17918
18072
|
async delete(logicalId, physicalId, resourceType, properties, context) {
|
|
17919
18073
|
switch (resourceType) {
|
|
17920
|
-
case "AWS::EC2::VPC": return this.deleteVpc(logicalId, physicalId, resourceType, context);
|
|
18074
|
+
case "AWS::EC2::VPC": return this.deleteVpc(logicalId, physicalId, resourceType, context, properties);
|
|
17921
18075
|
case "AWS::EC2::Subnet": return this.deleteSubnet(logicalId, physicalId, resourceType, context);
|
|
17922
18076
|
case "AWS::EC2::InternetGateway": return this.deleteInternetGateway(logicalId, physicalId, resourceType, context);
|
|
17923
18077
|
case "AWS::EC2::EIP": return this.deleteEip(logicalId, physicalId, resourceType, context);
|
|
@@ -18072,18 +18226,24 @@ var EC2Provider = class {
|
|
|
18072
18226
|
this.logger.debug(`Creating VPC ${logicalId}`);
|
|
18073
18227
|
const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
|
|
18074
18228
|
const cidrBlock = properties["CidrBlock"];
|
|
18075
|
-
|
|
18229
|
+
const ipamAllocation = this.readVpcIpamAllocation(properties, resourceType, logicalId, context);
|
|
18230
|
+
if (!cidrBlock && ipamAllocation.poolId === void 0) throw new ProvisioningError(`CidrBlock or Ipv4IpamPoolId is required for VPC ${logicalId}`, resourceType, logicalId);
|
|
18231
|
+
const encryptionControl = this.buildVpcEncryptionControl(properties["VpcEncryptionControl"], resourceType, logicalId, context);
|
|
18232
|
+
const orphanMatch = cidrBlock ? { cidrBlock } : { ipamPoolId: ipamAllocation.poolId };
|
|
18076
18233
|
let leftBehindId;
|
|
18077
18234
|
try {
|
|
18078
18235
|
const createClient = await this.getCreateClient();
|
|
18079
18236
|
const orphanWindow = createVpcLatch.take(logicalId);
|
|
18080
|
-
if (orphanWindow !== void 0) await this.reportPossibleOrphanVpcs(logicalId,
|
|
18237
|
+
if (orphanWindow !== void 0) await this.reportPossibleOrphanVpcs(logicalId, orphanMatch, desiredTags, orphanWindow, context);
|
|
18081
18238
|
const attemptStartMs = Date.now();
|
|
18082
18239
|
let response;
|
|
18083
18240
|
let tagsApplied;
|
|
18084
18241
|
try {
|
|
18085
18242
|
({response, tagsApplied} = await this.sendTaggedCreate(logicalId, "vpc", desiredTags, (TagSpecifications) => createClient.send(new CreateVpcCommand({
|
|
18086
|
-
CidrBlock: cidrBlock,
|
|
18243
|
+
...cidrBlock ? { CidrBlock: cidrBlock } : {},
|
|
18244
|
+
...ipamAllocation.poolId !== void 0 && { Ipv4IpamPoolId: ipamAllocation.poolId },
|
|
18245
|
+
...ipamAllocation.netmaskLength !== void 0 && { Ipv4NetmaskLength: ipamAllocation.netmaskLength },
|
|
18246
|
+
...encryptionControl !== void 0 && { VpcEncryptionControl: encryptionControl },
|
|
18087
18247
|
InstanceTenancy: properties["InstanceTenancy"] ?? void 0,
|
|
18088
18248
|
...TagSpecifications && { TagSpecifications }
|
|
18089
18249
|
}))));
|
|
@@ -18095,7 +18255,7 @@ var EC2Provider = class {
|
|
|
18095
18255
|
ec2IdsCreatedByThisProcess.add(vpcId);
|
|
18096
18256
|
reportCreatedResource(logicalId, resourceType, vpcId);
|
|
18097
18257
|
const vpcReplayWindow = replayedSendWindow(response, attemptStartMs);
|
|
18098
|
-
if (vpcReplayWindow !== void 0) await this.reportPossibleOrphanVpcs(logicalId,
|
|
18258
|
+
if (vpcReplayWindow !== void 0) await this.reportPossibleOrphanVpcs(logicalId, orphanMatch, desiredTags, vpcReplayWindow, context);
|
|
18099
18259
|
let defaultSgId;
|
|
18100
18260
|
try {
|
|
18101
18261
|
if (properties["EnableDnsHostnames"] === true || properties["EnableDnsHostnames"] === "true") await this.ec2Client.send(new ModifyVpcAttributeCommand({
|
|
@@ -18136,7 +18296,7 @@ var EC2Provider = class {
|
|
|
18136
18296
|
physicalId: vpcId,
|
|
18137
18297
|
attributes: definedAttributes({
|
|
18138
18298
|
VpcId: vpcId,
|
|
18139
|
-
CidrBlock: cidrBlock,
|
|
18299
|
+
CidrBlock: cidrBlock || response.Vpc?.CidrBlock,
|
|
18140
18300
|
DefaultSecurityGroup: defaultSgId
|
|
18141
18301
|
})
|
|
18142
18302
|
};
|
|
@@ -18158,10 +18318,14 @@ var EC2Provider = class {
|
|
|
18158
18318
|
const newTenancy = tenancyOf(properties["InstanceTenancy"]);
|
|
18159
18319
|
const oldTenancy = tenancyOf(previousProperties["InstanceTenancy"]);
|
|
18160
18320
|
if (newTenancy !== oldTenancy && newTenancy !== "default") throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "destroy + redeploy the VPC (and the resources that depend on it). AWS changes InstanceTenancy in place only to default, and CloudFormation creates a new VPC for this change");
|
|
18321
|
+
const createOnlyChanged = VPC_CREATE_ONLY_SENT.filter((key) => !(key === "Ipv4IpamPoolId" && (properties[key] === void 0 || previousProperties[key] === void 0)) && !sameCreateOnlySent(key, properties[key], previousProperties[key]));
|
|
18322
|
+
if (createOnlyChanged.length > 0) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `destroy + redeploy the VPC (and the resources that depend on it). ${createOnlyChanged.join(", ")} can be set only when the VPC is created, and CloudFormation creates a new VPC for this change`);
|
|
18161
18323
|
const asBool = (v) => {
|
|
18162
18324
|
if (v === void 0) return void 0;
|
|
18163
18325
|
return v === true || v === "true";
|
|
18164
18326
|
};
|
|
18327
|
+
const declaredCidr = properties["CidrBlock"];
|
|
18328
|
+
const cidrBlock = typeof declaredCidr === "string" && declaredCidr !== "" ? declaredCidr : properties["Ipv4IpamPoolId"] !== void 0 ? (await this.ec2Client.send(new DescribeVpcsCommand({ VpcIds: [physicalId] })))?.Vpcs?.[0]?.CidrBlock : void 0;
|
|
18165
18329
|
const newDnsHostnames = asBool(properties["EnableDnsHostnames"]);
|
|
18166
18330
|
const oldDnsHostnames = asBool(previousProperties["EnableDnsHostnames"]);
|
|
18167
18331
|
if (newDnsHostnames !== void 0 && newDnsHostnames !== oldDnsHostnames) await this.ec2Client.send(new ModifyVpcAttributeCommand({
|
|
@@ -18183,10 +18347,10 @@ var EC2Provider = class {
|
|
|
18183
18347
|
return {
|
|
18184
18348
|
physicalId,
|
|
18185
18349
|
wasReplaced: false,
|
|
18186
|
-
attributes: {
|
|
18350
|
+
attributes: definedAttributes({
|
|
18187
18351
|
VpcId: physicalId,
|
|
18188
|
-
CidrBlock:
|
|
18189
|
-
}
|
|
18352
|
+
CidrBlock: cidrBlock
|
|
18353
|
+
})
|
|
18190
18354
|
};
|
|
18191
18355
|
} catch (error) {
|
|
18192
18356
|
if (error instanceof CdkdError) throw error;
|
|
@@ -18194,12 +18358,13 @@ var EC2Provider = class {
|
|
|
18194
18358
|
throw this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to update VPC ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
18195
18359
|
}
|
|
18196
18360
|
}
|
|
18197
|
-
async deleteVpc(logicalId, physicalId, resourceType, context) {
|
|
18361
|
+
async deleteVpc(logicalId, physicalId, resourceType, context, properties) {
|
|
18198
18362
|
this.logger.debug(`Deleting VPC ${logicalId}: ${physicalId}`);
|
|
18199
18363
|
const maxAttempts = 10;
|
|
18200
18364
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) try {
|
|
18201
18365
|
await this.ec2Client.send(new DeleteVpcCommand({ VpcId: physicalId }));
|
|
18202
18366
|
this.logger.debug(`Successfully deleted VPC ${logicalId}`);
|
|
18367
|
+
await this.waitForVpcIpamRelease(physicalId, resourceType, properties, context);
|
|
18203
18368
|
return;
|
|
18204
18369
|
} catch (error) {
|
|
18205
18370
|
if (this.isNotFoundError(error) && (context?.failedCreateOrphan !== true || isNamedError(error, VPC_NOT_FOUND_NAMES))) {
|
|
@@ -18219,6 +18384,38 @@ var EC2Provider = class {
|
|
|
18219
18384
|
throw this.wrapDeleteError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete VPC ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
18220
18385
|
}
|
|
18221
18386
|
}
|
|
18387
|
+
async waitForVpcIpamRelease(vpcId, resourceType, properties, context) {
|
|
18388
|
+
const poolId = properties?.["Ipv4IpamPoolId"];
|
|
18389
|
+
if (typeof poolId !== "string" || !/^ipam-pool-[0-9a-z]+$/.test(poolId)) return;
|
|
18390
|
+
this.logger.info(maskerOrIdentity(context?.maskSecrets)(safeMsg` Waiting for IPAM pool ${poolId} to release the allocation of deleted VPC ${vpcId}; AWS can take about 18 minutes, and the pool CIDR cannot be deprovisioned before then`));
|
|
18391
|
+
await waitForGoneAfterDelete({
|
|
18392
|
+
what: maskerOrIdentity(context?.maskSecrets)(`the IPAM pool ${poolId} allocation of VPC ${vpcId}`),
|
|
18393
|
+
resourceType,
|
|
18394
|
+
consequence: "AWS releases the allocation on its side; until it does, the pool refuses to deprovision its CIDR (\"The CIDR has one or more allocations.\"), so re-run the destroy if it stops there.",
|
|
18395
|
+
describe: async () => {
|
|
18396
|
+
try {
|
|
18397
|
+
let token;
|
|
18398
|
+
let pages = 0;
|
|
18399
|
+
do {
|
|
18400
|
+
const page = await this.ec2Client.send(new GetIpamPoolAllocationsCommand({
|
|
18401
|
+
IpamPoolId: poolId,
|
|
18402
|
+
NextToken: token
|
|
18403
|
+
}));
|
|
18404
|
+
if ((page.IpamPoolAllocations ?? []).some((a) => a.ResourceId === vpcId)) return "allocated";
|
|
18405
|
+
token = page.NextToken;
|
|
18406
|
+
pages++;
|
|
18407
|
+
} while (token && pages < 20);
|
|
18408
|
+
return token ? "unknown (allocation listing truncated)" : void 0;
|
|
18409
|
+
} catch (error) {
|
|
18410
|
+
if (isNamedError(error, IPAM_POOL_NOT_FOUND_NAMES)) return void 0;
|
|
18411
|
+
throw error;
|
|
18412
|
+
}
|
|
18413
|
+
},
|
|
18414
|
+
logger: this.logger,
|
|
18415
|
+
pollIntervalMs: vpcIpamReleaseWait.pollIntervalMs,
|
|
18416
|
+
maxWaitMs: vpcIpamReleaseWait.maxWaitMs
|
|
18417
|
+
});
|
|
18418
|
+
}
|
|
18222
18419
|
async getVpcAttribute(physicalId, attributeName) {
|
|
18223
18420
|
try {
|
|
18224
18421
|
switch (attributeName) {
|
|
@@ -19941,6 +20138,7 @@ var EC2Provider = class {
|
|
|
19941
20138
|
if (!imageId) throw new ProvisioningError(`ImageId is required for EC2 Instance ${logicalId}`, resourceType, logicalId);
|
|
19942
20139
|
const instanceType = requireConfigString(properties["InstanceType"], "t3.micro", "AWS::EC2::Instance InstanceType", replayWarn(this.logger, context));
|
|
19943
20140
|
const blockDeviceMappings = this.buildBlockDeviceMappings(properties, logicalId);
|
|
20141
|
+
const launchOnlyOptions = this.buildLaunchOnlyInstanceOptions(properties, resourceType, logicalId);
|
|
19944
20142
|
let leftBehindId;
|
|
19945
20143
|
try {
|
|
19946
20144
|
const securityGroupIds = properties["SecurityGroupIds"];
|
|
@@ -19951,8 +20149,12 @@ var EC2Provider = class {
|
|
|
19951
20149
|
scope: "RunInstances",
|
|
19952
20150
|
logicalId
|
|
19953
20151
|
});
|
|
20152
|
+
const propagateToVolumes = coerceCfnBoolean(properties["PropagateTagsToVolumeOnCreation"]) === true;
|
|
19954
20153
|
const { response, tagsApplied } = await this.sendTaggedCreate(logicalId, "instance", desiredTags, (TagSpecifications) => this.ec2Client.send(new RunInstancesCommand({
|
|
19955
|
-
...TagSpecifications && { TagSpecifications
|
|
20154
|
+
...TagSpecifications && { TagSpecifications: propagateToVolumes ? [...TagSpecifications, ...TagSpecifications.map((spec) => ({
|
|
20155
|
+
...spec,
|
|
20156
|
+
ResourceType: "volume"
|
|
20157
|
+
}))] : TagSpecifications },
|
|
19956
20158
|
ClientToken: runInstancesToken.value,
|
|
19957
20159
|
ImageId: imageId,
|
|
19958
20160
|
InstanceType: instanceType,
|
|
@@ -19974,14 +20176,15 @@ var EC2Provider = class {
|
|
|
19974
20176
|
Monitoring: this.buildRunInstancesMonitoring(properties),
|
|
19975
20177
|
MetadataOptions: this.buildMetadataOptions(properties),
|
|
19976
20178
|
CreditSpecification: this.buildCreditSpecification(properties),
|
|
19977
|
-
Placement: this.buildPlacement(properties)
|
|
20179
|
+
Placement: this.buildPlacement(properties),
|
|
20180
|
+
...launchOnlyOptions
|
|
19978
20181
|
})));
|
|
19979
20182
|
const instance = response.Instances?.[0];
|
|
19980
20183
|
if (!instance?.InstanceId) throw new Error("No instance ID returned from RunInstances");
|
|
19981
20184
|
const instanceId = instance.InstanceId;
|
|
19982
20185
|
reportCreatedResource(logicalId, resourceType, instanceId);
|
|
19983
20186
|
try {
|
|
19984
|
-
if (!tagsApplied) await this.applyTags(instanceId, desiredTags, logicalId, maskerOrIdentity(context?.maskSecrets));
|
|
20187
|
+
if (!tagsApplied) await this.applyTags(instanceId, desiredTags, logicalId, maskerOrIdentity(context?.maskSecrets), (call) => this.whileLaunchedInstanceNotVisible(logicalId, instanceId, call));
|
|
19985
20188
|
if (process.env["CDKD_NO_WAIT"] !== "true") {
|
|
19986
20189
|
this.logger.debug(`Waiting for instance ${instanceId} to be running...`);
|
|
19987
20190
|
await waitUntilInstanceRunning({
|
|
@@ -19998,7 +20201,16 @@ var EC2Provider = class {
|
|
|
19998
20201
|
this.logger.warn(`Skipped the IAM instance profile association check for ${logicalId} (${instanceId}) because --no-wait leaves the instance in 'pending', where AssociateIamInstanceProfile is rejected. RunInstances associates the profile asynchronously and can complete with NO profile attached when the profile was created moments earlier. Verify with: ${aws`aws ec2 describe-iam-instance-profile-associations --filters Name=instance-id,Values=${instanceId}`.render()} — and if it is missing, re-associate with: ` + (profileRef.includes(",") ? WITHHELD_AWS_COMMAND : aws`aws ec2 associate-iam-instance-profile --instance-id ${instanceId} --iam-instance-profile ${iamInstanceProfile.arn ? aws`Arn=${profileRef}` : aws`Name=${profileRef}`}`.render()));
|
|
19999
20202
|
} else await this.ensureIamInstanceProfileAssociated(instanceId, iamInstanceProfile.arn, iamInstanceProfile.name, logicalId);
|
|
20000
20203
|
}
|
|
20001
|
-
|
|
20204
|
+
if (coerceCfnBoolean(properties["SourceDestCheck"]) === false) await this.whileLaunchedInstanceNotVisible(logicalId, instanceId, () => this.ec2Client.send(new ModifyInstanceAttributeCommand({
|
|
20205
|
+
InstanceId: instanceId,
|
|
20206
|
+
SourceDestCheck: { Value: false }
|
|
20207
|
+
})));
|
|
20208
|
+
const runningInstance = (await this.whileLaunchedInstanceNotVisible(logicalId, instanceId, () => this.ec2Client.send(new DescribeInstancesCommand({ InstanceIds: [instanceId] })))).Reservations?.[0]?.Instances?.[0];
|
|
20209
|
+
if (propagateToVolumes && !tagsApplied && desiredTags.length > 0) {
|
|
20210
|
+
const volumeIds = (runningInstance?.BlockDeviceMappings ?? []).map((m) => m.Ebs?.VolumeId).filter((id) => typeof id === "string" && id !== "");
|
|
20211
|
+
if (volumeIds.length === 0) this.logger.warn(safeMsg`${logicalId}: PropagateTagsToVolumeOnCreation is set, but the launch went out without tags (the tagged RunInstances was refused) and DescribeInstances reported no attached volume for ${instanceId} yet (under --no-wait the instance may still be pending), so its volumes were not tagged. Tag them with ec2:CreateTags once they are attached.`);
|
|
20212
|
+
for (const volumeId of volumeIds) await this.applyTags(volumeId, desiredTags, logicalId, maskerOrIdentity(context?.maskSecrets));
|
|
20213
|
+
}
|
|
20002
20214
|
const attributes = describedInstanceAttributes(instanceId, runningInstance);
|
|
20003
20215
|
this.logger.debug(`Successfully created EC2 Instance ${logicalId}: ${instanceId}`);
|
|
20004
20216
|
runInstancesToken.release();
|
|
@@ -20188,6 +20400,40 @@ var EC2Provider = class {
|
|
|
20188
20400
|
else throw refusedBeforeApplying(new ProvisioningError(safeMsg`${logicalId} (${resourceType}): InstanceType was removed from the template, and CloudFormation fails that update for an existing instance. Keep it declared (set it to the instance's current type to leave it unchanged). The instance was not updated.`, resourceType, logicalId, physicalId));
|
|
20189
20401
|
} else if (!standInSkips("InstanceType")) plan.instanceType = requireConfigString(properties["InstanceType"], "", "AWS::EC2::Instance InstanceType");
|
|
20190
20402
|
}
|
|
20403
|
+
const createOnlyChanged = INSTANCE_CREATE_ONLY_SENT.filter((key) => changed(key, (a, b) => sameCreateOnlySent(key, a, b)));
|
|
20404
|
+
if (createOnlyChanged.length > 0) throw refusedBeforeApplying(new ResourceUpdateNotSupportedError(resourceType, logicalId, `replace the instance (cdkd deploy --replace). ${createOnlyChanged.join(", ")} can be set only when the instance is launched, and CloudFormation creates a new instance for this change`));
|
|
20405
|
+
if (changed("Tenancy", (a, b) => a === b) && !standInSkips("Tenancy")) {
|
|
20406
|
+
const before = previousProperties["Tenancy"];
|
|
20407
|
+
const after = properties["Tenancy"];
|
|
20408
|
+
const refusal = configStringRefusal(properties, "Tenancy", "", resourceType);
|
|
20409
|
+
if (refusal !== void 0) throw refusedBeforeApplying(new ProvisioningError(`${refusal}. The instance ${logicalId} was not updated.`, resourceType, logicalId, physicalId));
|
|
20410
|
+
if (before == null && typeof after === "string") plan.tenancyAddition = {
|
|
20411
|
+
value: after,
|
|
20412
|
+
replaying: context?.replayingState === true
|
|
20413
|
+
};
|
|
20414
|
+
else if (typeof before === "string" && typeof after === "string" && before !== "default" && after !== "default") {
|
|
20415
|
+
if (context?.replayingState === true) this.logger.warn(safeMsg`${logicalId} (${resourceType}): the rollback would change Tenancy ${before} -> ${after}, which cdkd does not apply; the instance keeps its current tenancy.`);
|
|
20416
|
+
else throw refusedBeforeApplying(new ResourceUpdateNotSupportedError(resourceType, logicalId, safeMsg`cdkd does not change Tenancy ${before} -> ${after}. How CloudFormation applies a change between two non-default tenancies has not been measured (it may stop the instance and move it rather than replace it), so cdkd neither replaces the instance nor applies the change. Keep the current tenancy, or replace the instance explicitly with cdkd deploy --replace`));
|
|
20417
|
+
} else if (context?.replayingState === true) this.logger.warn(safeMsg`${logicalId} (${resourceType}): the rollback would change Tenancy (${before === void 0 ? "unset" : before} -> ${after === void 0 ? "unset" : after}), which needs a new instance; the instance keeps its current tenancy.`);
|
|
20418
|
+
else throw refusedBeforeApplying(new ResourceUpdateNotSupportedError(resourceType, logicalId, "replace the instance (cdkd deploy --replace). CloudFormation creates a new instance for a Tenancy change to or from default"));
|
|
20419
|
+
}
|
|
20420
|
+
if (changed("InstanceInitiatedShutdownBehavior", (a, b) => a === b)) {
|
|
20421
|
+
if (properties["InstanceInitiatedShutdownBehavior"] === void 0) {
|
|
20422
|
+
if (context?.replayingState === true) this.logger.warn(safeMsg`${logicalId} (${resourceType}): the state being restored does not declare InstanceInitiatedShutdownBehavior; the rollback leaves it at its current AWS value.`);
|
|
20423
|
+
else throw refusedBeforeApplying(new ProvisioningError(safeMsg`${logicalId} (${resourceType}): InstanceInitiatedShutdownBehavior was removed from the template, and CloudFormation fails that update for an existing instance. Keep it declared (set it to stop, the default, to leave the behavior at AWS's default). The instance was not updated.`, resourceType, logicalId, physicalId));
|
|
20424
|
+
} else if (!standInSkips("InstanceInitiatedShutdownBehavior")) plan.shutdownBehavior = requireConfigString(properties["InstanceInitiatedShutdownBehavior"], "", "AWS::EC2::Instance InstanceInitiatedShutdownBehavior");
|
|
20425
|
+
}
|
|
20426
|
+
const sourceDestCheckOf = (v) => v === void 0 ? true : coerceCfnBoolean(v);
|
|
20427
|
+
if (changed("SourceDestCheck", (a, b) => sourceDestCheckOf(a) === sourceDestCheckOf(b)) && !standInSkips("SourceDestCheck")) {
|
|
20428
|
+
const raw = properties["SourceDestCheck"];
|
|
20429
|
+
const want = raw === void 0 ? true : coerceCfnBoolean(raw);
|
|
20430
|
+
if (want === void 0) {
|
|
20431
|
+
const refusal = configBooleanRefusal(properties, "SourceDestCheck", resourceType);
|
|
20432
|
+
if (context?.replayingState === true || context?.desiredFromAwsReadback === true) this.logger.warn(safeMsg`${logicalId} (${resourceType}): ${refusal ?? "SourceDestCheck is not a boolean"}; it is left at its current AWS value.`);
|
|
20433
|
+
else throw refusedBeforeApplying(new ProvisioningError(`${refusal ?? `${resourceType}.SourceDestCheck must be a boolean`}. The instance ${logicalId} was not updated.`, resourceType, logicalId, physicalId));
|
|
20434
|
+
} else plan.sourceDestCheck = want;
|
|
20435
|
+
}
|
|
20436
|
+
this.planPrivateDnsNameOptions(logicalId, physicalId, resourceType, properties, previousProperties, context, plan, changed, standInSkips);
|
|
20191
20437
|
if (changed("UserData", (a, b) => a === b)) {
|
|
20192
20438
|
const userData = properties["UserData"];
|
|
20193
20439
|
if (userData === void 0) plan.userData = /* @__PURE__ */ new Uint8Array(0);
|
|
@@ -20240,14 +20486,64 @@ var EC2Provider = class {
|
|
|
20240
20486
|
}
|
|
20241
20487
|
return plan;
|
|
20242
20488
|
}
|
|
20489
|
+
planPrivateDnsNameOptions(logicalId, physicalId, resourceType, properties, previousProperties, context, plan, changed, standInSkips) {
|
|
20490
|
+
const KEY = "PrivateDnsNameOptions";
|
|
20491
|
+
const readable = (v) => v != null && privateDnsNameOptionsRefusal(v, resourceType) === void 0 ? privateDnsNameOptionsRequest(v) ?? {} : {};
|
|
20492
|
+
const sameOptions = (a, b) => a != null && b != null && privateDnsNameOptionsRefusal(a, resourceType) === void 0 && privateDnsNameOptionsRefusal(b, resourceType) === void 0 && isDeepStrictEqual(readable(a), readable(b));
|
|
20493
|
+
if (!changed(KEY, sameOptions)) return;
|
|
20494
|
+
const replaying = context?.replayingState === true;
|
|
20495
|
+
const after = properties[KEY];
|
|
20496
|
+
if (after === void 0 || after === null) {
|
|
20497
|
+
if (replaying) {
|
|
20498
|
+
this.logger.warn(safeMsg`${logicalId} (${resourceType}): the state being restored does not declare PrivateDnsNameOptions, which needs a new instance; the rollback leaves the instance's hostname options as they are.`);
|
|
20499
|
+
return;
|
|
20500
|
+
}
|
|
20501
|
+
throw refusedBeforeApplying(new ResourceUpdateNotSupportedError(resourceType, logicalId, "replace the instance (cdkd deploy --replace). CloudFormation creates a new instance when PrivateDnsNameOptions is removed"));
|
|
20502
|
+
}
|
|
20503
|
+
if (standInSkips(KEY)) return;
|
|
20504
|
+
const refusal = privateDnsNameOptionsRefusal(after, resourceType);
|
|
20505
|
+
if (refusal !== void 0) {
|
|
20506
|
+
if (replaying || context?.desiredFromAwsReadback === true) {
|
|
20507
|
+
this.logger.warn(safeMsg`${logicalId} (${resourceType}): ${refusal}; the hostname options are left at their current AWS value.`);
|
|
20508
|
+
return;
|
|
20509
|
+
}
|
|
20510
|
+
throw refusedBeforeApplying(new ProvisioningError(`${refusal}. The instance ${logicalId} was not updated.`, resourceType, logicalId, physicalId));
|
|
20511
|
+
}
|
|
20512
|
+
const want = readable(after);
|
|
20513
|
+
const had = readable(previousProperties[KEY]);
|
|
20514
|
+
const request = {};
|
|
20515
|
+
if (want.HostnameType !== void 0 && want.HostnameType !== had.HostnameType) request.PrivateDnsHostnameType = want.HostnameType;
|
|
20516
|
+
for (const member of ["EnableResourceNameDnsARecord", "EnableResourceNameDnsAAAARecord"]) if (want[member] !== void 0 && want[member] !== had[member]) request[member] = want[member];
|
|
20517
|
+
const removedMembers = context?.desiredFromAwsReadback === true ? "" : Object.keys(had).filter((m) => want[m] === void 0).join(", ");
|
|
20518
|
+
if (removedMembers !== "") {
|
|
20519
|
+
if (!replaying) throw refusedBeforeApplying(new ProvisioningError(safeMsg`${logicalId} (${resourceType}): PrivateDnsNameOptions ${removedMembers} was removed from the template, and CloudFormation fails that update ("No valid attributes specified"). Keep it declared (set it to the value the instance has to leave it unchanged), or remove the whole PrivateDnsNameOptions block, which replaces the instance. The instance was not updated.`, resourceType, logicalId, physicalId));
|
|
20520
|
+
this.logger.warn(safeMsg`${logicalId} (${resourceType}): the state being restored does not declare PrivateDnsNameOptions ${removedMembers}; the rollback leaves it at its current AWS value.`);
|
|
20521
|
+
}
|
|
20522
|
+
if (Object.keys(request).length > 0) plan.privateDnsNameOptions = request;
|
|
20523
|
+
}
|
|
20243
20524
|
async prepareInstanceMemberUpdates(logicalId, physicalId, resourceType, plan) {
|
|
20244
|
-
const needsStop = plan.instanceType !== void 0 || plan.userData !== void 0;
|
|
20245
20525
|
const needsDefaultGroup = plan.securityGroups?.kind === "vpc-default";
|
|
20246
|
-
|
|
20526
|
+
const tenancy = plan.tenancyAddition;
|
|
20527
|
+
if (instanceStopMembers(plan).length === 0 && !needsDefaultGroup && tenancy === void 0) return;
|
|
20247
20528
|
const instance = (await this.ec2Client.send(new DescribeInstancesCommand({ InstanceIds: [physicalId] }))).Reservations?.[0]?.Instances?.[0];
|
|
20529
|
+
const dns = plan.privateDnsNameOptions;
|
|
20530
|
+
if (dns?.PrivateDnsHostnameType !== void 0 && instance?.PrivateDnsNameOptions?.HostnameType === dns.PrivateDnsHostnameType) {
|
|
20531
|
+
const { PrivateDnsHostnameType: _sameAsLive, ...rest } = dns;
|
|
20532
|
+
if (Object.keys(rest).length > 0) plan.privateDnsNameOptions = rest;
|
|
20533
|
+
else delete plan.privateDnsNameOptions;
|
|
20534
|
+
}
|
|
20535
|
+
const stopMembers = instanceStopMembers(plan);
|
|
20536
|
+
const needsStop = stopMembers.length > 0;
|
|
20537
|
+
if (tenancy !== void 0) {
|
|
20538
|
+
const live = instance?.Placement?.Tenancy;
|
|
20539
|
+
if (live !== tenancy.value) {
|
|
20540
|
+
if (tenancy.replaying) this.logger.warn(safeMsg`${logicalId} (${resourceType}): the state being restored declares Tenancy ${tenancy.value}, but the instance has ${live ?? "an unreadable tenancy"}; the rollback leaves it as it is.`);
|
|
20541
|
+
else throw markRefusedBeforeApplying(new ResourceUpdateNotSupportedError(resourceType, logicalId, safeMsg`the template declares Tenancy ${tenancy.value}, the instance has ${live ?? "a tenancy DescribeInstances did not report"}, and the state record does not say which tenancy it was launched with. Changing it needs a new instance: replace it with cdkd deploy --replace, or declare Tenancy ${live ?? "as the instance has it"}`));
|
|
20542
|
+
}
|
|
20543
|
+
}
|
|
20248
20544
|
if (needsStop) {
|
|
20249
|
-
const members =
|
|
20250
|
-
if (instance?.RootDeviceType === "instance-store") throw markRefusedBeforeApplying(new ResourceUpdateNotSupportedError(resourceType, logicalId, `${members} can change only on a stopped instance, and an instance-store-backed instance cannot be stopped; CloudFormation replaces it. Re-deploy with cdkd deploy --replace.`));
|
|
20545
|
+
const members = stopMembers.join(" and ");
|
|
20546
|
+
if (instance?.RootDeviceType === "instance-store") throw markRefusedBeforeApplying(new ResourceUpdateNotSupportedError(resourceType, logicalId, `${members} can change only on a stopped instance, and an instance-store-backed instance cannot be stopped; ${plan.instanceType !== void 0 || plan.userData !== void 0 ? "CloudFormation replaces it" : "it needs a new instance"}. Re-deploy with cdkd deploy --replace.`));
|
|
20251
20547
|
const state = instance?.State?.Name;
|
|
20252
20548
|
if (!STOPPABLE_INSTANCE_STATES.has(state ?? "")) throw refusedBeforeApplying(new ProvisioningError(`${logicalId} (${resourceType}): instance ${physicalId} is ${state ?? "not returned by DescribeInstances"}, so its ${members} cannot be changed. The instance was not updated.`, resourceType, logicalId, physicalId));
|
|
20253
20549
|
}
|
|
@@ -20279,7 +20575,31 @@ var EC2Provider = class {
|
|
|
20279
20575
|
}));
|
|
20280
20576
|
applied.push("the new DeleteOnTermination");
|
|
20281
20577
|
}
|
|
20282
|
-
if (plan.
|
|
20578
|
+
if (plan.shutdownBehavior !== void 0) {
|
|
20579
|
+
await this.ec2Client.send(new ModifyInstanceAttributeCommand({
|
|
20580
|
+
InstanceId: physicalId,
|
|
20581
|
+
InstanceInitiatedShutdownBehavior: { Value: plan.shutdownBehavior }
|
|
20582
|
+
}));
|
|
20583
|
+
applied.push("the new InstanceInitiatedShutdownBehavior");
|
|
20584
|
+
}
|
|
20585
|
+
if (plan.sourceDestCheck !== void 0) {
|
|
20586
|
+
await this.ec2Client.send(new ModifyInstanceAttributeCommand({
|
|
20587
|
+
InstanceId: physicalId,
|
|
20588
|
+
SourceDestCheck: { Value: plan.sourceDestCheck }
|
|
20589
|
+
}));
|
|
20590
|
+
applied.push("the new SourceDestCheck");
|
|
20591
|
+
}
|
|
20592
|
+
const dns = plan.privateDnsNameOptions;
|
|
20593
|
+
if (dns !== void 0 && dns.PrivateDnsHostnameType === void 0) {
|
|
20594
|
+
await this.ec2Client.send(new ModifyPrivateDnsNameOptionsCommand({
|
|
20595
|
+
InstanceId: physicalId,
|
|
20596
|
+
...dns
|
|
20597
|
+
}));
|
|
20598
|
+
applied.push("the new PrivateDnsNameOptions");
|
|
20599
|
+
}
|
|
20600
|
+
const stopMembers = instanceStopMembers(plan);
|
|
20601
|
+
const stopWhat = stopMembers.join(" / ");
|
|
20602
|
+
if (stopMembers.length === 0) {
|
|
20283
20603
|
if (instancesLeftStoppedByCdkd.has(physicalId)) {
|
|
20284
20604
|
let state = await this.readInstanceState(physicalId);
|
|
20285
20605
|
if (state === "stopping") state = await this.waitForInstanceState(logicalId, physicalId, resourceType, "stopped");
|
|
@@ -20291,13 +20611,13 @@ var EC2Provider = class {
|
|
|
20291
20611
|
let state = await this.readInstanceState(physicalId);
|
|
20292
20612
|
if (state === "pending") state = await this.waitForInstanceState(logicalId, physicalId, resourceType, "running");
|
|
20293
20613
|
else if (state === "stopping") state = await this.waitForInstanceState(logicalId, physicalId, resourceType, "stopped");
|
|
20294
|
-
if (state !== "stopped" && state !== "running") throw markNonRetryable(new ProvisioningError(`${logicalId} (${resourceType}): instance ${physicalId} became ${state ?? "not returned by DescribeInstances"} during the update, so its
|
|
20614
|
+
if (state !== "stopped" && state !== "running") throw markNonRetryable(new ProvisioningError(`${logicalId} (${resourceType}): instance ${physicalId} became ${state ?? "not returned by DescribeInstances"} during the update, so its ${stopWhat} were not changed`, resourceType, logicalId, physicalId));
|
|
20295
20615
|
const startAfter = state === "running" || instancesLeftStoppedByCdkd.has(physicalId);
|
|
20296
20616
|
let phase = "stop";
|
|
20297
20617
|
let stopIssued = false;
|
|
20298
20618
|
try {
|
|
20299
20619
|
if (state === "running") {
|
|
20300
|
-
this.logger.info(safeMsg`Stopping EC2 Instance ${logicalId} (${physicalId}) to change its ${
|
|
20620
|
+
this.logger.info(safeMsg`Stopping EC2 Instance ${logicalId} (${physicalId}) to change its ${stopMembers.join(" and ")}; it is started again afterwards`);
|
|
20301
20621
|
await this.ec2Client.send(new StopInstancesCommand({ InstanceIds: [physicalId] }));
|
|
20302
20622
|
stopIssued = true;
|
|
20303
20623
|
await this.waitForInstanceState(logicalId, physicalId, resourceType, "stopped");
|
|
@@ -20317,6 +20637,13 @@ var EC2Provider = class {
|
|
|
20317
20637
|
}));
|
|
20318
20638
|
applied.push("the new UserData");
|
|
20319
20639
|
}
|
|
20640
|
+
if (dns?.PrivateDnsHostnameType !== void 0) {
|
|
20641
|
+
await this.ec2Client.send(new ModifyPrivateDnsNameOptionsCommand({
|
|
20642
|
+
InstanceId: physicalId,
|
|
20643
|
+
...dns
|
|
20644
|
+
}));
|
|
20645
|
+
applied.push("the new PrivateDnsNameOptions");
|
|
20646
|
+
}
|
|
20320
20647
|
if (!startAfter) return;
|
|
20321
20648
|
phase = "start";
|
|
20322
20649
|
await this.ec2Client.send(new StartInstancesCommand({ InstanceIds: [physicalId] }));
|
|
@@ -20348,15 +20675,15 @@ var EC2Provider = class {
|
|
|
20348
20675
|
}
|
|
20349
20676
|
if (startFailure === void 0) {
|
|
20350
20677
|
instancesLeftStoppedByCdkd.delete(physicalId);
|
|
20351
|
-
this.logger.warn(safeMsg`${logicalId}: the
|
|
20678
|
+
this.logger.warn(safeMsg`${logicalId}: the ${stopWhat} change failed after instance ${physicalId} was stopped; cdkd started it again, with ${carries}.`);
|
|
20352
20679
|
} else {
|
|
20353
20680
|
instancesLeftStoppedByCdkd.add(physicalId);
|
|
20354
|
-
this.logger.warn(safeMsg`${logicalId}: instance ${physicalId} was stopped for
|
|
20681
|
+
this.logger.warn(safeMsg`${logicalId}: instance ${physicalId} was stopped for a ${stopWhat} change that failed, and starting it again failed too (${describeAwsFailure(startFailure).summary}); it is stopped, with ${carries}. Start it with: ${startCommand}`);
|
|
20355
20682
|
}
|
|
20356
20683
|
throw error;
|
|
20357
20684
|
}
|
|
20358
20685
|
instancesLeftStoppedByCdkd.add(physicalId);
|
|
20359
|
-
this.logger.warn(phase === "stop" ? safeMsg`${logicalId}: instance ${physicalId} was being stopped for
|
|
20686
|
+
this.logger.warn(phase === "stop" ? safeMsg`${logicalId}: instance ${physicalId} was being stopped for a ${stopWhat} change that did not finish. Once it is stopped, start it with: ${startCommand}` : safeMsg`${logicalId}: instance ${physicalId} is stopped, with ${carries}; cdkd did not start it again. Start it with: ${startCommand}`);
|
|
20360
20687
|
throw error;
|
|
20361
20688
|
}
|
|
20362
20689
|
}
|
|
@@ -20570,9 +20897,14 @@ var EC2Provider = class {
|
|
|
20570
20897
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
20571
20898
|
}
|
|
20572
20899
|
buildPlacement(properties) {
|
|
20900
|
+
const out = {};
|
|
20573
20901
|
const az = properties["AvailabilityZone"];
|
|
20574
|
-
if (typeof az
|
|
20575
|
-
|
|
20902
|
+
if (typeof az === "string" && az !== "") out.AvailabilityZone = az;
|
|
20903
|
+
const tenancy = properties["Tenancy"];
|
|
20904
|
+
if (typeof tenancy === "string" && tenancy !== "") out.Tenancy = tenancy;
|
|
20905
|
+
const group = properties["PlacementGroupName"];
|
|
20906
|
+
if (typeof group === "string" && group !== "") out.GroupName = group;
|
|
20907
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
20576
20908
|
}
|
|
20577
20909
|
buildNetworkInterfaces(properties) {
|
|
20578
20910
|
const raw = properties["NetworkInterfaces"];
|
|
@@ -20630,6 +20962,39 @@ var EC2Provider = class {
|
|
|
20630
20962
|
const raw = obj["CPUCredits"] ?? obj["CpuCredits"];
|
|
20631
20963
|
return typeof raw === "string" ? raw : void 0;
|
|
20632
20964
|
}
|
|
20965
|
+
buildLaunchOnlyInstanceOptions(properties, resourceType, logicalId) {
|
|
20966
|
+
const cpu = properties["CpuOptions"];
|
|
20967
|
+
const hibernation = properties["HibernationOptions"];
|
|
20968
|
+
const refusal = configIntegerRefusal(cpu, "CoreCount", `${resourceType} CpuOptions`, 1) ?? configIntegerRefusal(cpu, "ThreadsPerCore", `${resourceType} CpuOptions`, 1) ?? configBooleanRefusal(hibernation, "Configured", `${resourceType} HibernationOptions`) ?? configStringRefusal(properties, "InstanceInitiatedShutdownBehavior", "", resourceType) ?? configStringRefusal(properties, "Tenancy", "", resourceType) ?? configStringRefusal(properties, "PlacementGroupName", "", resourceType) ?? configStringRefusal(properties, "PrivateIpAddress", "", resourceType) ?? configBooleanRefusal(properties, "SourceDestCheck", resourceType) ?? configBooleanRefusal(properties, "PropagateTagsToVolumeOnCreation", resourceType) ?? configStringRefusal(properties, "AdditionalInfo", "", resourceType) ?? configIntegerRefusal(properties, "Ipv6AddressCount", resourceType, 0) ?? instanceIpv6AddressesRefusal(properties["Ipv6Addresses"], resourceType) ?? privateDnsNameOptionsRefusal(properties["PrivateDnsNameOptions"], resourceType);
|
|
20969
|
+
if (refusal !== void 0) throw markNonRetryable(new ProvisioningError(`${refusal}. The instance ${logicalId} was not launched.`, resourceType, logicalId));
|
|
20970
|
+
const out = {};
|
|
20971
|
+
if (cpu !== void 0 && cpu !== null) {
|
|
20972
|
+
const block = cpu;
|
|
20973
|
+
const coreCount = coerceCfnInteger(block["CoreCount"]);
|
|
20974
|
+
const threadsPerCore = coerceCfnInteger(block["ThreadsPerCore"]);
|
|
20975
|
+
out.CpuOptions = {
|
|
20976
|
+
...coreCount !== void 0 && { CoreCount: coreCount },
|
|
20977
|
+
...threadsPerCore !== void 0 && { ThreadsPerCore: threadsPerCore }
|
|
20978
|
+
};
|
|
20979
|
+
}
|
|
20980
|
+
if (hibernation !== void 0 && hibernation !== null) {
|
|
20981
|
+
const configured = coerceCfnBoolean(hibernation["Configured"]);
|
|
20982
|
+
out.HibernationOptions = configured === void 0 ? {} : { Configured: configured };
|
|
20983
|
+
}
|
|
20984
|
+
const shutdown = properties["InstanceInitiatedShutdownBehavior"];
|
|
20985
|
+
if (typeof shutdown === "string" && shutdown !== "") out.InstanceInitiatedShutdownBehavior = shutdown;
|
|
20986
|
+
const privateIp = properties["PrivateIpAddress"];
|
|
20987
|
+
if (typeof privateIp === "string" && privateIp !== "") out.PrivateIpAddress = privateIp;
|
|
20988
|
+
const additionalInfo = properties["AdditionalInfo"];
|
|
20989
|
+
if (typeof additionalInfo === "string" && additionalInfo !== "") out.AdditionalInfo = additionalInfo;
|
|
20990
|
+
const ipv6Count = coerceCfnInteger(properties["Ipv6AddressCount"]);
|
|
20991
|
+
if (ipv6Count !== void 0) out.Ipv6AddressCount = ipv6Count;
|
|
20992
|
+
const ipv6Addresses = properties["Ipv6Addresses"];
|
|
20993
|
+
if (Array.isArray(ipv6Addresses)) out.Ipv6Addresses = ipv6Addresses.map((a) => ({ Ipv6Address: a["Ipv6Address"] }));
|
|
20994
|
+
const dnsOptions = privateDnsNameOptionsRequest(properties["PrivateDnsNameOptions"]);
|
|
20995
|
+
if (dnsOptions !== void 0) out.PrivateDnsNameOptions = dnsOptions;
|
|
20996
|
+
return out;
|
|
20997
|
+
}
|
|
20633
20998
|
buildIpPermission(properties, direction = "ingress", inline = false) {
|
|
20634
20999
|
const ipProtocol = properties["IpProtocol"] ?? "-1";
|
|
20635
21000
|
const fromPort = properties["FromPort"];
|
|
@@ -20958,15 +21323,15 @@ var EC2Provider = class {
|
|
|
20958
21323
|
}
|
|
20959
21324
|
}
|
|
20960
21325
|
}
|
|
20961
|
-
async applyTags(resourceId, tags, logicalId, mask) {
|
|
21326
|
+
async applyTags(resourceId, tags, logicalId, mask, wrapSend = (call) => call()) {
|
|
20962
21327
|
if (tags.length > 0) try {
|
|
20963
|
-
await this.ec2Client.send(new CreateTagsCommand({
|
|
21328
|
+
await wrapSend(() => this.ec2Client.send(new CreateTagsCommand({
|
|
20964
21329
|
Resources: [resourceId],
|
|
20965
21330
|
Tags: tags.map((t) => ({
|
|
20966
21331
|
Key: t.Key,
|
|
20967
21332
|
Value: t.Value
|
|
20968
21333
|
}))
|
|
20969
|
-
}));
|
|
21334
|
+
})));
|
|
20970
21335
|
this.logger.debug(`Applied ${tags.length} tag(s) to ${logicalId}`);
|
|
20971
21336
|
} catch (error) {
|
|
20972
21337
|
const tagHead = `Failed to apply tags to ${logicalId}: `;
|
|
@@ -21060,6 +21425,15 @@ var EC2Provider = class {
|
|
|
21060
21425
|
if (code === "IncorrectInstanceState" || name === "IncorrectInstanceState") return true;
|
|
21061
21426
|
return error.message.includes("IncorrectInstanceState");
|
|
21062
21427
|
}
|
|
21428
|
+
async whileLaunchedInstanceNotVisible(logicalId, instanceId, call) {
|
|
21429
|
+
for (let attempt = 1;; attempt++) try {
|
|
21430
|
+
return await call();
|
|
21431
|
+
} catch (error) {
|
|
21432
|
+
if (attempt >= LAUNCHED_INSTANCE_VISIBILITY_ATTEMPTS || !isNamedError(error, INSTANCE_NOT_FOUND_NAMES)) throw error;
|
|
21433
|
+
this.logger.debug(safeMsg`EC2 Instance ${logicalId} (${instanceId}) is not visible yet after launch (attempt ${String(attempt)}); retrying`);
|
|
21434
|
+
await this.sleep(Math.min(1e3 * 2 ** (attempt - 1), 8e3));
|
|
21435
|
+
}
|
|
21436
|
+
}
|
|
21063
21437
|
sleep(ms) {
|
|
21064
21438
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
21065
21439
|
}
|
|
@@ -21084,13 +21458,13 @@ var EC2Provider = class {
|
|
|
21084
21458
|
async readCurrentStateOnce(physicalId, logicalId, resourceType, properties, context) {
|
|
21085
21459
|
try {
|
|
21086
21460
|
switch (resourceType) {
|
|
21087
|
-
case "AWS::EC2::VPC": return await this.readVpcCurrentState(physicalId);
|
|
21461
|
+
case "AWS::EC2::VPC": return await this.readVpcCurrentState(physicalId, properties);
|
|
21088
21462
|
case "AWS::EC2::Subnet": return await this.readSubnetCurrentState(physicalId);
|
|
21089
21463
|
case "AWS::EC2::InternetGateway": return await this.readInternetGatewayCurrentState(physicalId);
|
|
21090
21464
|
case "AWS::EC2::NatGateway": return await this.readNatGatewayCurrentState(physicalId, properties);
|
|
21091
21465
|
case "AWS::EC2::RouteTable": return await this.readRouteTableCurrentState(physicalId);
|
|
21092
21466
|
case "AWS::EC2::SecurityGroup": return await this.readSecurityGroupCurrentState(physicalId, properties);
|
|
21093
|
-
case "AWS::EC2::Instance": return await this.readInstanceCurrentState(physicalId);
|
|
21467
|
+
case "AWS::EC2::Instance": return await this.readInstanceCurrentState(physicalId, properties);
|
|
21094
21468
|
case "AWS::EC2::NetworkAcl": return await this.readNetworkAclCurrentState(physicalId);
|
|
21095
21469
|
case "AWS::EC2::EIP": return await this.readEipCurrentState(physicalId, properties, context?.afterOwnWrite === true);
|
|
21096
21470
|
case "AWS::EC2::VPCGatewayAttachment": return await this.readVpcGatewayAttachmentCurrentState(physicalId, properties);
|
|
@@ -21109,9 +21483,19 @@ var EC2Provider = class {
|
|
|
21109
21483
|
throw err;
|
|
21110
21484
|
}
|
|
21111
21485
|
}
|
|
21112
|
-
getDriftUnknownPaths(resourceType) {
|
|
21486
|
+
getDriftUnknownPaths(resourceType, properties) {
|
|
21113
21487
|
switch (resourceType) {
|
|
21114
|
-
case "AWS::EC2::Instance": return [
|
|
21488
|
+
case "AWS::EC2::Instance": return [
|
|
21489
|
+
"NetworkInterfaces",
|
|
21490
|
+
"PropagateTagsToVolumeOnCreation",
|
|
21491
|
+
"AdditionalInfo",
|
|
21492
|
+
"Ipv6AddressCount",
|
|
21493
|
+
"Ipv6Addresses"
|
|
21494
|
+
];
|
|
21495
|
+
case "AWS::EC2::VPC": {
|
|
21496
|
+
const control = properties?.["VpcEncryptionControl"];
|
|
21497
|
+
return ["Ipv4IpamPoolId", ...control !== null && typeof control === "object" && control["Mode"] === "monitor" ? VPC_ENCRYPTION_CONTROL_EXCLUSIONS.map((key) => `VpcEncryptionControl.${key}`) : []];
|
|
21498
|
+
}
|
|
21115
21499
|
case "AWS::EC2::Route":
|
|
21116
21500
|
case "AWS::EC2::VPCGatewayAttachment":
|
|
21117
21501
|
case "AWS::EC2::SubnetRouteTableAssociation":
|
|
@@ -21131,12 +21515,27 @@ var EC2Provider = class {
|
|
|
21131
21515
|
const { declared, narrowed } = narrowRouteDestinations(properties);
|
|
21132
21516
|
return declared.length > 1 ? narrowed : properties;
|
|
21133
21517
|
}
|
|
21134
|
-
async readVpcCurrentState(physicalId) {
|
|
21518
|
+
async readVpcCurrentState(physicalId, properties) {
|
|
21135
21519
|
const vpc = (await this.ec2Client.send(new DescribeVpcsCommand({ VpcIds: [physicalId] }))).Vpcs?.[0];
|
|
21136
21520
|
if (!vpc) return RESOURCE_NOT_FOUND;
|
|
21137
21521
|
const result = {};
|
|
21138
|
-
if (vpc.CidrBlock !== void 0)
|
|
21522
|
+
if (vpc.CidrBlock !== void 0) {
|
|
21523
|
+
result["CidrBlock"] = vpc.CidrBlock;
|
|
21524
|
+
const prefix = /\/(\d+)$/.exec(vpc.CidrBlock)?.[1];
|
|
21525
|
+
if (prefix !== void 0 && properties?.["Ipv4NetmaskLength"] !== void 0) result["Ipv4NetmaskLength"] = Number(prefix);
|
|
21526
|
+
}
|
|
21139
21527
|
if (vpc.InstanceTenancy !== void 0) result["InstanceTenancy"] = vpc.InstanceTenancy;
|
|
21528
|
+
const control = vpc.EncryptionControl;
|
|
21529
|
+
if (control?.Mode !== void 0) {
|
|
21530
|
+
const out = { Mode: control.Mode };
|
|
21531
|
+
const exclusions = control.ResourceExclusions;
|
|
21532
|
+
for (const key of VPC_ENCRYPTION_CONTROL_EXCLUSIONS) {
|
|
21533
|
+
const state = exclusions?.[key.slice(0, -9)]?.State;
|
|
21534
|
+
if (state === "enabled" || state === "enabling") out[key] = "enable";
|
|
21535
|
+
else if (state === "disabled" || state === "disabling") out[key] = "disable";
|
|
21536
|
+
}
|
|
21537
|
+
result["VpcEncryptionControl"] = out;
|
|
21538
|
+
}
|
|
21140
21539
|
try {
|
|
21141
21540
|
const dnsHost = await this.ec2Client.send(new DescribeVpcAttributeCommand({
|
|
21142
21541
|
VpcId: physicalId,
|
|
@@ -21229,7 +21628,7 @@ var EC2Provider = class {
|
|
|
21229
21628
|
result["SecurityGroupEgress"] = reconcileSgRules(egressRules, stateEgress, "egress");
|
|
21230
21629
|
return result;
|
|
21231
21630
|
}
|
|
21232
|
-
async readInstanceCurrentState(physicalId) {
|
|
21631
|
+
async readInstanceCurrentState(physicalId, properties) {
|
|
21233
21632
|
const instance = (await this.ec2Client.send(new DescribeInstancesCommand({ InstanceIds: [physicalId] }))).Reservations?.[0]?.Instances?.[0];
|
|
21234
21633
|
if (!instance || instance.State?.Name === "terminated" || instance.State?.Name === "shutting-down") return RESOURCE_NOT_FOUND;
|
|
21235
21634
|
const result = {};
|
|
@@ -21254,7 +21653,23 @@ var EC2Provider = class {
|
|
|
21254
21653
|
if (md.InstanceMetadataTags !== void 0) out["InstanceMetadataTags"] = md.InstanceMetadataTags;
|
|
21255
21654
|
if (Object.keys(out).length > 0) result["MetadataOptions"] = out;
|
|
21256
21655
|
}
|
|
21656
|
+
if (instance.CpuOptions !== void 0) {
|
|
21657
|
+
const cpu = {};
|
|
21658
|
+
if (instance.CpuOptions.CoreCount !== void 0) cpu["CoreCount"] = instance.CpuOptions.CoreCount;
|
|
21659
|
+
if (instance.CpuOptions.ThreadsPerCore !== void 0) cpu["ThreadsPerCore"] = instance.CpuOptions.ThreadsPerCore;
|
|
21660
|
+
if (Object.keys(cpu).length > 0) result["CpuOptions"] = cpu;
|
|
21661
|
+
}
|
|
21662
|
+
if (instance.HibernationOptions?.Configured !== void 0) result["HibernationOptions"] = { Configured: instance.HibernationOptions.Configured };
|
|
21663
|
+
const dnsOptions = instance.PrivateDnsNameOptions;
|
|
21664
|
+
if (dnsOptions !== void 0) {
|
|
21665
|
+
const dns = {};
|
|
21666
|
+
if (dnsOptions.HostnameType !== void 0) dns["HostnameType"] = dnsOptions.HostnameType;
|
|
21667
|
+
if (dnsOptions.EnableResourceNameDnsARecord !== void 0) dns["EnableResourceNameDnsARecord"] = dnsOptions.EnableResourceNameDnsARecord;
|
|
21668
|
+
if (dnsOptions.EnableResourceNameDnsAAAARecord !== void 0) dns["EnableResourceNameDnsAAAARecord"] = dnsOptions.EnableResourceNameDnsAAAARecord;
|
|
21669
|
+
if (Object.keys(dns).length > 0) result["PrivateDnsNameOptions"] = dns;
|
|
21670
|
+
}
|
|
21257
21671
|
if (instance.Placement?.Tenancy !== void 0) result["Tenancy"] = instance.Placement.Tenancy;
|
|
21672
|
+
if (typeof instance.Placement?.GroupName === "string" && instance.Placement.GroupName !== "") result["PlacementGroupName"] = instance.Placement.GroupName;
|
|
21258
21673
|
if (instance.IamInstanceProfile?.Arn !== void 0) result["IamInstanceProfile"] = instance.IamInstanceProfile.Arn;
|
|
21259
21674
|
else if (process.env["CDKD_NO_WAIT"] === "true" && instance.State?.Name === "pending") try {
|
|
21260
21675
|
const live = (await this.ec2Client.send(new DescribeIamInstanceProfileAssociationsCommand({ Filters: [{
|
|
@@ -21307,6 +21722,15 @@ var EC2Provider = class {
|
|
|
21307
21722
|
} catch (err) {
|
|
21308
21723
|
this.logger.debug(`DescribeInstanceAttribute(disableApiTermination, ${physicalId}) failed: ${describeAwsFailure(err).detail}`);
|
|
21309
21724
|
}
|
|
21725
|
+
if (properties?.["InstanceInitiatedShutdownBehavior"] !== void 0) try {
|
|
21726
|
+
const attrResp = await this.ec2Client.send(new DescribeInstanceAttributeCommand({
|
|
21727
|
+
InstanceId: physicalId,
|
|
21728
|
+
Attribute: "instanceInitiatedShutdownBehavior"
|
|
21729
|
+
}));
|
|
21730
|
+
if (attrResp.InstanceInitiatedShutdownBehavior?.Value !== void 0) result["InstanceInitiatedShutdownBehavior"] = attrResp.InstanceInitiatedShutdownBehavior.Value;
|
|
21731
|
+
} catch (err) {
|
|
21732
|
+
this.logger.debug(safeMsg`DescribeInstanceAttribute(instanceInitiatedShutdownBehavior, ${physicalId}) failed: ${describeAwsFailure(err).detail}`);
|
|
21733
|
+
}
|
|
21310
21734
|
try {
|
|
21311
21735
|
const cpuCredits = (await this.ec2Client.send(new DescribeInstanceCreditSpecificationsCommand({ InstanceIds: [physicalId] }))).InstanceCreditSpecifications?.[0]?.CpuCredits;
|
|
21312
21736
|
if (cpuCredits !== void 0) result["CreditSpecification"] = { CPUCredits: cpuCredits };
|
|
@@ -21521,10 +21945,16 @@ var EC2Provider = class {
|
|
|
21521
21945
|
async verifyExplicit(logicalId, resourceType, physicalId, properties) {
|
|
21522
21946
|
try {
|
|
21523
21947
|
switch (resourceType) {
|
|
21524
|
-
case "AWS::EC2::VPC":
|
|
21525
|
-
physicalId
|
|
21526
|
-
|
|
21527
|
-
|
|
21948
|
+
case "AWS::EC2::VPC": {
|
|
21949
|
+
const vpc = (await this.ec2Client.send(new DescribeVpcsCommand({ VpcIds: [physicalId] }))).Vpcs?.[0];
|
|
21950
|
+
return vpc ? {
|
|
21951
|
+
physicalId,
|
|
21952
|
+
attributes: definedAttributes({
|
|
21953
|
+
VpcId: physicalId,
|
|
21954
|
+
CidrBlock: vpc.CidrBlock
|
|
21955
|
+
})
|
|
21956
|
+
} : null;
|
|
21957
|
+
}
|
|
21528
21958
|
case "AWS::EC2::Subnet": {
|
|
21529
21959
|
const subnet = (await this.ec2Client.send(new DescribeSubnetsCommand({ SubnetIds: [physicalId] }))).Subnets?.[0];
|
|
21530
21960
|
return subnet ? {
|
|
@@ -26728,6 +27158,7 @@ var StepFunctionsProvider = class {
|
|
|
26728
27158
|
getS3Client() {
|
|
26729
27159
|
if (!this.s3Client) this.s3Client = new S3Client({
|
|
26730
27160
|
...ambientClientDefaults(),
|
|
27161
|
+
...s3ClientDefaults(),
|
|
26731
27162
|
...this.providerRegion ? { region: this.providerRegion } : {}
|
|
26732
27163
|
});
|
|
26733
27164
|
return this.s3Client;
|
|
@@ -30411,14 +30842,14 @@ var RDSDBProxyProvider = class {
|
|
|
30411
30842
|
vpcId = proxy?.VpcId;
|
|
30412
30843
|
break;
|
|
30413
30844
|
}
|
|
30414
|
-
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(`DBProxy ${dbProxyName} entered terminal failure state: ${status}
|
|
30845
|
+
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(mask(`DBProxy ${dbProxyName} entered terminal failure state: ${status}`), resourceType, logicalId, dbProxyName);
|
|
30415
30846
|
} catch (error) {
|
|
30416
30847
|
if (error instanceof DBProxyNotFoundFault) {} else if (error instanceof ProvisioningError) throw error;
|
|
30417
30848
|
else throw this.wrapCaughtError(error, "CREATE (poll)", resourceType, logicalId, dbProxyName, mask);
|
|
30418
30849
|
}
|
|
30419
30850
|
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS$1));
|
|
30420
30851
|
}
|
|
30421
|
-
if (!endpoint || !dbProxyArn) throw new ProvisioningError(`Timed out waiting for DBProxy ${dbProxyName} to become available (last status: ${status ?? "unknown"})
|
|
30852
|
+
if (!endpoint || !dbProxyArn) throw new ProvisioningError(mask(`Timed out waiting for DBProxy ${dbProxyName} to become available (last status: ${status ?? "unknown"})`), resourceType, logicalId, dbProxyName);
|
|
30422
30853
|
} catch (error) {
|
|
30423
30854
|
markCreatedBeforeFailure(error, logicalId, resourceType, dbProxyName);
|
|
30424
30855
|
throw error;
|
|
@@ -30477,6 +30908,7 @@ var RDSDBProxyProvider = class {
|
|
|
30477
30908
|
} catch (error) {
|
|
30478
30909
|
throw this.wrapCaughtError(error, "UPDATE", resourceType, logicalId, physicalId, mask);
|
|
30479
30910
|
}
|
|
30911
|
+
await this.waitForAvailableAfterModify(physicalId, resourceType, logicalId, mask);
|
|
30480
30912
|
}
|
|
30481
30913
|
this.invalidateAttributeCache(physicalId);
|
|
30482
30914
|
await this.applyTagDiff(physicalId, previousProperties["Tags"], properties["Tags"], resourceType, logicalId, mask);
|
|
@@ -30486,6 +30918,25 @@ var RDSDBProxyProvider = class {
|
|
|
30486
30918
|
wasReplaced: false
|
|
30487
30919
|
};
|
|
30488
30920
|
}
|
|
30921
|
+
async waitForAvailableAfterModify(physicalId, resourceType, logicalId, mask) {
|
|
30922
|
+
const client = this.getClient();
|
|
30923
|
+
const deadline = Date.now() + POLL_TIMEOUT_MS$1;
|
|
30924
|
+
let status;
|
|
30925
|
+
while (Date.now() < deadline) {
|
|
30926
|
+
try {
|
|
30927
|
+
const proxy = (await client.send(new DescribeDBProxiesCommand({ DBProxyName: physicalId }))).DBProxies?.[0];
|
|
30928
|
+
if (!proxy) throw new ProvisioningError(mask(`DBProxy ${physicalId} was not found while waiting for it after modify`), resourceType, logicalId, physicalId);
|
|
30929
|
+
status = proxy.Status;
|
|
30930
|
+
} catch (error) {
|
|
30931
|
+
if (error instanceof ProvisioningError) throw error;
|
|
30932
|
+
throw this.wrapCaughtError(error, "UPDATE (poll)", resourceType, logicalId, physicalId, mask);
|
|
30933
|
+
}
|
|
30934
|
+
if (status === "available") return;
|
|
30935
|
+
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(mask(`DBProxy ${physicalId} entered terminal failure state after modify: ${status}`), resourceType, logicalId, physicalId);
|
|
30936
|
+
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS$1));
|
|
30937
|
+
}
|
|
30938
|
+
throw new ProvisioningError(mask(`Timed out waiting for DBProxy ${physicalId} to become available after modify (last status: ${status ?? "unknown"})`), resourceType, logicalId, physicalId);
|
|
30939
|
+
}
|
|
30489
30940
|
warnOnRetainedRemovals(logicalId, resourceType, properties, previousProperties, context) {
|
|
30490
30941
|
const retained = this.removedRetained(properties, previousProperties, context);
|
|
30491
30942
|
if (retained.length === 0) return;
|
|
@@ -30578,12 +31029,12 @@ var RDSDBProxyProvider = class {
|
|
|
30578
31029
|
IdleClientTimeout: p.IdleClientTimeout,
|
|
30579
31030
|
DebugLogging: p.DebugLogging ?? false,
|
|
30580
31031
|
Auth: (p.Auth ?? []).map((a) => ({
|
|
30581
|
-
Description: a.Description,
|
|
30582
|
-
UserName: a.UserName,
|
|
30583
|
-
AuthScheme: a.AuthScheme,
|
|
30584
|
-
SecretArn: a.SecretArn,
|
|
30585
|
-
IAMAuth: a.IAMAuth,
|
|
30586
|
-
ClientPasswordAuthType: a.ClientPasswordAuthType
|
|
31032
|
+
...a.Description !== void 0 && { Description: a.Description },
|
|
31033
|
+
...a.UserName !== void 0 && { UserName: a.UserName },
|
|
31034
|
+
...a.AuthScheme !== void 0 && { AuthScheme: a.AuthScheme },
|
|
31035
|
+
...a.SecretArn !== void 0 && { SecretArn: a.SecretArn },
|
|
31036
|
+
...a.IAMAuth !== void 0 && { IAMAuth: a.IAMAuth },
|
|
31037
|
+
...a.ClientPasswordAuthType !== void 0 && { ClientPasswordAuthType: a.ClientPasswordAuthType }
|
|
30587
31038
|
})),
|
|
30588
31039
|
...p.DefaultAuthScheme !== void 0 && { DefaultAuthScheme: p.DefaultAuthScheme },
|
|
30589
31040
|
...p.EndpointNetworkType !== void 0 && { EndpointNetworkType: p.EndpointNetworkType },
|
|
@@ -37693,6 +38144,7 @@ var AppSyncProvider = class {
|
|
|
37693
38144
|
getS3Client() {
|
|
37694
38145
|
if (!this.s3Client) this.s3Client = new S3Client({
|
|
37695
38146
|
...ambientClientDefaults(),
|
|
38147
|
+
...s3ClientDefaults(),
|
|
37696
38148
|
...this.providerRegion ? { region: this.providerRegion } : {}
|
|
37697
38149
|
});
|
|
37698
38150
|
return this.s3Client;
|
|
@@ -51225,6 +51677,7 @@ var CodeCommitRepositoryProvider = class {
|
|
|
51225
51677
|
getS3Client() {
|
|
51226
51678
|
if (!this.s3Client) this.s3Client = new S3Client({
|
|
51227
51679
|
...ambientClientDefaults(),
|
|
51680
|
+
...s3ClientDefaults(),
|
|
51228
51681
|
...this.providerRegion ? { region: this.providerRegion } : {}
|
|
51229
51682
|
});
|
|
51230
51683
|
return this.s3Client;
|
|
@@ -52594,6 +53047,7 @@ var S3DirectoryBucketProvider = class {
|
|
|
52594
53047
|
getCreateClient() {
|
|
52595
53048
|
this.createClient ??= this.s3Client.config.region().then((region) => withoutServerErrorRetries(new S3Client({
|
|
52596
53049
|
...clientDefaultsFor(this.credentialConfig),
|
|
53050
|
+
...s3ClientDefaults(),
|
|
52597
53051
|
region
|
|
52598
53052
|
})), (error) => {
|
|
52599
53053
|
this.createClient = void 0;
|
|
@@ -55299,4 +55753,4 @@ var ACMCertificateProvider = class {
|
|
|
55299
55753
|
};
|
|
55300
55754
|
|
|
55301
55755
|
export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, AppSyncProvider, BudgetsBudgetProvider, CloudFrontDistributionProvider, CloudFrontOACProvider, CloudFrontOAIProvider, CloudTrailProvider, CloudWatchAlarmProvider, CloudWatchAnomalyDetectorProvider, CodeBuildProvider, CodeCommitRepositoryProvider, CognitoUserPoolProvider, DLMLifecyclePolicyProvider, DocDBProvider, DocDBSubnetGroupProvider, DynamoDBGlobalTableProvider, DynamoDBTableProvider, EC2Provider, ECRProvider, ECSProvider, EFSProvider, ELBv2Provider, EMRClusterProvider, EMRInstanceFleetConfigProvider, EMRInstanceGroupConfigProvider, ElastiCacheProvider, EventBridgeBusProvider, EventBridgeRuleProvider, FSxFileSystemProvider, FirehoseProvider, GlueConnectionProvider, GlueCrawlerProvider, GlueJobProvider, GlueProvider, GlueSecurityConfigurationProvider, GlueTriggerProvider, GlueWorkflowProvider, IAMAccessKeyProvider, IAMInstanceProfileProvider, IAMManagedPolicyProvider, IAMPolicyProvider, IAMRoleProvider, IAMUserGroupProvider, KMSProvider, KinesisStreamConsumerProvider, KinesisStreamProvider, LambdaEventInvokeConfigProvider, LambdaEventSourceMappingProvider, LambdaFunctionProvider, LambdaLayerVersionProvider, LambdaMicrovmImageProvider, LambdaNetworkConnectorProvider, LambdaPermissionProvider, LambdaUrlProvider, LambdaWebFunctionEndpointProvider, LambdaWebFunctionRevisionProvider, LogsLogGroupProvider, NeptuneProvider, NestedStackProvider, PipesPipeProvider, RDSDBProxyEndpointProvider, RDSDBProxyProvider, RDSDBProxyTargetGroupProvider, RDSProvider, Route53Provider, S3BucketPolicyProvider, S3BucketProvider, S3DirectoryBucketProvider, S3TablesProvider, S3VectorsProvider, SNSSubscriptionProvider, SNSTopicPolicyProvider, SNSTopicProvider, SQSQueuePolicyProvider, SQSQueueProvider, SSMParameterProvider, SchedulerScheduleProvider, SecretsManagerSecretProvider, ServiceDiscoveryProvider, StepFunctionsProvider, WAFv2WebACLProvider, WaitConditionHandleProvider };
|
|
55302
|
-
//# sourceMappingURL=provider-classes-
|
|
55756
|
+
//# sourceMappingURL=provider-classes-D60y4umw.js.map
|