@cdkd/cli 0.323.0 → 0.324.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-D8-GEE_f.js} +2 -2
- package/dist/{asg-provider-4rNFSmz9.js.map → asg-provider-D8-GEE_f.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/created-resource-sink-CmrPwGge.js.map +1 -1
- package/dist/{deploy-engine-dYZ0v6Kz.js → deploy-engine-B32kQ3SO.js} +22 -27
- package/dist/deploy-engine-B32kQ3SO.js.map +1 -0
- package/dist/{iam-role-provider-Bp4osNrj.js → iam-role-provider-D3th06lJ.js} +2 -2
- package/dist/{iam-role-provider-Bp4osNrj.js.map → iam-role-provider-D3th06lJ.js.map} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{neptune-provider-BqtKFZaE.js → neptune-provider-CN7ptfAK.js} +2 -2
- package/dist/{neptune-provider-BqtKFZaE.js.map → neptune-provider-CN7ptfAK.js.map} +1 -1
- package/dist/{program-BYT8z2ca.js → program-CcdJAeR0.js} +11 -4
- package/dist/program-CcdJAeR0.js.map +1 -0
- package/dist/{provider-classes-KPYbVTtY.js → provider-classes-CZnJcera.js} +291 -51
- package/dist/provider-classes-CZnJcera.js.map +1 -0
- package/dist/{rds-provider-C8enyD9d.js → rds-provider-YcTAhlgr.js} +4 -4
- package/dist/rds-provider-YcTAhlgr.js.map +1 -0
- package/dist/{version-kAoaNHQI.js → version-h1THYe6R.js} +2 -2
- package/dist/{version-kAoaNHQI.js.map → version-h1THYe6R.js.map} +1 -1
- package/package.json +1 -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
|
@@ -2,13 +2,13 @@ import { r as getAwsClients, s as withApiGatewayPacing } from "./aws-clients-DWp
|
|
|
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
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-CmrPwGge.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-
|
|
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-B32kQ3SO.js";
|
|
6
|
+
import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-D3th06lJ.js";
|
|
7
|
+
import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-CcdJAeR0.js";
|
|
8
8
|
import { n as modifyDbInstanceWhenAvailable } from "./db-instance-modify-retry-DCLA_p9I.js";
|
|
9
|
-
import { RDSProvider } from "./rds-provider-
|
|
10
|
-
import { NeptuneProvider } from "./neptune-provider-
|
|
11
|
-
import { ASGProvider } from "./asg-provider-
|
|
9
|
+
import { RDSProvider } from "./rds-provider-YcTAhlgr.js";
|
|
10
|
+
import { NeptuneProvider } from "./neptune-provider-CN7ptfAK.js";
|
|
11
|
+
import { ASGProvider } from "./asg-provider-D8-GEE_f.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, 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";
|
|
@@ -17576,6 +17576,7 @@ function readbackNatZoneAddresses(live, recorded) {
|
|
|
17576
17576
|
const EIP_ALLOCATION_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidAllocationID.NotFound"]);
|
|
17577
17577
|
const INSTANCE_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidInstanceID.NotFound"]);
|
|
17578
17578
|
const VPC_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidVpcID.NotFound"]);
|
|
17579
|
+
const IPAM_POOL_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidIpamPoolId.NotFound"]);
|
|
17579
17580
|
const SUBNET_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidSubnetID.NotFound"]);
|
|
17580
17581
|
const SECURITY_GROUP_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidGroup.NotFound"]);
|
|
17581
17582
|
const NAT_GATEWAY_ID_PATTERN = /^nat-[0-9a-f]+$/;
|
|
@@ -17597,6 +17598,47 @@ const createSubnetLatch = new AmbiguousCreateLatch("ec2:CreateSubnet");
|
|
|
17597
17598
|
const createInternetGatewayLatch = new AmbiguousCreateLatch("ec2:CreateInternetGateway");
|
|
17598
17599
|
const allocateAddressLatch = new AmbiguousCreateLatch("ec2:AllocateAddress");
|
|
17599
17600
|
const ec2IdsCreatedByThisProcess = new RecentIdSet();
|
|
17601
|
+
const vpcIpamReleaseWait = {
|
|
17602
|
+
pollIntervalMs: 1e4,
|
|
17603
|
+
maxWaitMs: 15e5
|
|
17604
|
+
};
|
|
17605
|
+
const VPC_ENCRYPTION_CONTROL_EXCLUSIONS = [
|
|
17606
|
+
"InternetGatewayExclusion",
|
|
17607
|
+
"EgressOnlyInternetGatewayExclusion",
|
|
17608
|
+
"NatGatewayExclusion",
|
|
17609
|
+
"VirtualPrivateGatewayExclusion",
|
|
17610
|
+
"VpcPeeringExclusion",
|
|
17611
|
+
"LambdaExclusion",
|
|
17612
|
+
"VpcLatticeExclusion",
|
|
17613
|
+
"ElasticFileSystemExclusion"
|
|
17614
|
+
];
|
|
17615
|
+
function replayedRecordNote(context) {
|
|
17616
|
+
return context?.replayingState === true ? " The value comes from the state record being restored." : "";
|
|
17617
|
+
}
|
|
17618
|
+
const VPC_CREATE_ONLY_SENT = [
|
|
17619
|
+
"Ipv4IpamPoolId",
|
|
17620
|
+
"Ipv4NetmaskLength",
|
|
17621
|
+
"VpcEncryptionControl"
|
|
17622
|
+
];
|
|
17623
|
+
const INSTANCE_CREATE_ONLY_SENT = ["CpuOptions", "HibernationOptions"];
|
|
17624
|
+
function foldCreateOnlySent(key, value) {
|
|
17625
|
+
const asRecord = (v) => v !== null && typeof v === "object" && !Array.isArray(v) ? v : void 0;
|
|
17626
|
+
if (key === "Ipv4NetmaskLength") return coerceCfnInteger(value) ?? value;
|
|
17627
|
+
if (key === "CpuOptions") {
|
|
17628
|
+
const cpu = asRecord(value);
|
|
17629
|
+
if (cpu === void 0) return value;
|
|
17630
|
+
return Object.fromEntries(Object.entries(cpu).map(([k, v]) => [k, coerceCfnInteger(v) ?? v]));
|
|
17631
|
+
}
|
|
17632
|
+
if (key === "HibernationOptions") {
|
|
17633
|
+
const hibernation = asRecord(value);
|
|
17634
|
+
if (hibernation === void 0) return value;
|
|
17635
|
+
return Object.fromEntries(Object.entries(hibernation).map(([k, v]) => [k, coerceCfnBoolean(v) ?? v]));
|
|
17636
|
+
}
|
|
17637
|
+
return value;
|
|
17638
|
+
}
|
|
17639
|
+
function sameCreateOnlySent(key, a, b) {
|
|
17640
|
+
return isDeepStrictEqual(foldCreateOnlySent(key, a), foldCreateOnlySent(key, b));
|
|
17641
|
+
}
|
|
17600
17642
|
const mayBeLostCreate = (tags, sent) => tags === void 0 || tags.length === 0 || sent.length > 0 && tagListsMatch(tags, sent);
|
|
17601
17643
|
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
17644
|
function isCreateTagsDenial(error) {
|
|
@@ -17624,7 +17666,10 @@ var EC2Provider = class {
|
|
|
17624
17666
|
"InstanceTenancy",
|
|
17625
17667
|
"EnableDnsHostnames",
|
|
17626
17668
|
"EnableDnsSupport",
|
|
17627
|
-
"Tags"
|
|
17669
|
+
"Tags",
|
|
17670
|
+
"Ipv4IpamPoolId",
|
|
17671
|
+
"Ipv4NetmaskLength",
|
|
17672
|
+
"VpcEncryptionControl"
|
|
17628
17673
|
])],
|
|
17629
17674
|
["AWS::EC2::Subnet", /* @__PURE__ */ new Set([
|
|
17630
17675
|
"VpcId",
|
|
@@ -17716,7 +17761,10 @@ var EC2Provider = class {
|
|
|
17716
17761
|
"MetadataOptions",
|
|
17717
17762
|
"Monitoring",
|
|
17718
17763
|
"EbsOptimized",
|
|
17719
|
-
"CreditSpecification"
|
|
17764
|
+
"CreditSpecification",
|
|
17765
|
+
"CpuOptions",
|
|
17766
|
+
"HibernationOptions",
|
|
17767
|
+
"InstanceInitiatedShutdownBehavior"
|
|
17720
17768
|
])],
|
|
17721
17769
|
["AWS::EC2::NetworkAcl", /* @__PURE__ */ new Set(["VpcId", "Tags"])],
|
|
17722
17770
|
["AWS::EC2::NetworkAclEntry", /* @__PURE__ */ new Set([
|
|
@@ -17775,27 +17823,75 @@ var EC2Provider = class {
|
|
|
17775
17823
|
inspect: (id) => lookup.inspect(aws, id, regionArg)
|
|
17776
17824
|
});
|
|
17777
17825
|
}
|
|
17778
|
-
async reportPossibleOrphanVpcs(logicalId,
|
|
17826
|
+
async reportPossibleOrphanVpcs(logicalId, match, sent, window, context) {
|
|
17779
17827
|
const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
|
|
17780
|
-
const wanted = canonicalizeIpv4Cidr(cidrBlock) ?? cidrBlock;
|
|
17828
|
+
const wanted = "cidrBlock" in match ? canonicalizeIpv4Cidr(match.cidrBlock) ?? match.cidrBlock : void 0;
|
|
17829
|
+
const listVpcs = async (inPool) => collectOrphanIds(async (token) => {
|
|
17830
|
+
const page = await this.ec2Client.send(new DescribeVpcsCommand({
|
|
17831
|
+
MaxResults: ORPHAN_LIST_PAGE_SIZE$2,
|
|
17832
|
+
NextToken: token
|
|
17833
|
+
}));
|
|
17834
|
+
return {
|
|
17835
|
+
items: page.Vpcs ?? [],
|
|
17836
|
+
next: page.NextToken
|
|
17837
|
+
};
|
|
17838
|
+
}, (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
17839
|
await this.reportPossibleEc2Orphans(logicalId, window, log, {
|
|
17782
17840
|
action: "CreateVpc",
|
|
17783
|
-
listAction: "DescribeVpcs",
|
|
17784
|
-
subject: `a VPC with CIDR ${log.value(cidrBlock)}`,
|
|
17841
|
+
listAction: "cidrBlock" in match ? "DescribeVpcs" : "GetIpamPoolAllocations + DescribeVpcs",
|
|
17842
|
+
subject: "cidrBlock" in match ? `a VPC with CIDR ${log.value(match.cidrBlock)}` : `a VPC allocated from IPAM pool ${log.value(match.ipamPoolId)}`,
|
|
17785
17843
|
noun: lostCreateNoun("VPC(s)", sent),
|
|
17786
|
-
list:
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17844
|
+
list: async () => {
|
|
17845
|
+
if ("cidrBlock" in match) return listVpcs(void 0);
|
|
17846
|
+
const allocated = await collectOrphanIds(async (token) => {
|
|
17847
|
+
const page = await this.ec2Client.send(new GetIpamPoolAllocationsCommand({
|
|
17848
|
+
IpamPoolId: match.ipamPoolId,
|
|
17849
|
+
NextToken: token
|
|
17850
|
+
}));
|
|
17851
|
+
return {
|
|
17852
|
+
items: page.IpamPoolAllocations ?? [],
|
|
17853
|
+
next: page.NextToken
|
|
17854
|
+
};
|
|
17855
|
+
}, (allocation) => allocation.ResourceType === "vpc" && allocation.ResourceId !== void 0 ? allocation.ResourceId : void 0);
|
|
17856
|
+
const vpcs = await listVpcs(new Set(allocated.ids));
|
|
17791
17857
|
return {
|
|
17792
|
-
|
|
17793
|
-
|
|
17858
|
+
ids: vpcs.ids,
|
|
17859
|
+
truncated: allocated.truncated || vpcs.truncated
|
|
17794
17860
|
};
|
|
17795
|
-
},
|
|
17861
|
+
},
|
|
17796
17862
|
inspect: (aws, id, regionArg) => aws`aws ec2 describe-vpcs --vpc-ids ${id}${regionArg}`.render()
|
|
17797
17863
|
});
|
|
17798
17864
|
}
|
|
17865
|
+
readVpcIpamAllocation(properties, resourceType, logicalId, context) {
|
|
17866
|
+
const refusal = configStringRefusal(properties, "Ipv4IpamPoolId", "", resourceType) ?? (properties["Ipv4IpamPoolId"] === "" ? `${resourceType}.Ipv4IpamPoolId must not be blank` : void 0) ?? configIntegerRefusal(properties, "Ipv4NetmaskLength", resourceType, 0, 32);
|
|
17867
|
+
if (refusal !== void 0) throw markNonRetryable(new ProvisioningError(`${refusal}. The VPC ${logicalId} was not created.${replayedRecordNote(context)}`, resourceType, logicalId));
|
|
17868
|
+
const poolId = properties["Ipv4IpamPoolId"];
|
|
17869
|
+
const netmaskLength = coerceCfnInteger(properties["Ipv4NetmaskLength"]);
|
|
17870
|
+
return {
|
|
17871
|
+
...typeof poolId === "string" && poolId !== "" && { poolId },
|
|
17872
|
+
...netmaskLength !== void 0 && { netmaskLength }
|
|
17873
|
+
};
|
|
17874
|
+
}
|
|
17875
|
+
buildVpcEncryptionControl(value, resourceType, logicalId, context) {
|
|
17876
|
+
if (value === void 0 || value === null) return void 0;
|
|
17877
|
+
const path = `${resourceType} VpcEncryptionControl`;
|
|
17878
|
+
const refuse = (reason) => {
|
|
17879
|
+
throw markNonRetryable(new ProvisioningError(`${reason}. The VPC ${logicalId} was not created.${replayedRecordNote(context)}`, resourceType, logicalId));
|
|
17880
|
+
};
|
|
17881
|
+
const containerRefusal = configStringRefusal(value, "Mode", "", path);
|
|
17882
|
+
if (containerRefusal !== void 0) return refuse(containerRefusal);
|
|
17883
|
+
const block = value;
|
|
17884
|
+
const mode = block["Mode"];
|
|
17885
|
+
if (mode === "") return refuse(`${path}.Mode must not be blank`);
|
|
17886
|
+
const config = { Mode: typeof mode === "string" ? mode : void 0 };
|
|
17887
|
+
for (const key of VPC_ENCRYPTION_CONTROL_EXCLUSIONS) {
|
|
17888
|
+
const memberRefusal = configStringRefusal(block, key, "", path);
|
|
17889
|
+
if (memberRefusal !== void 0) return refuse(memberRefusal);
|
|
17890
|
+
const member = block[key];
|
|
17891
|
+
if (typeof member === "string" && member !== "") config[key] = member;
|
|
17892
|
+
}
|
|
17893
|
+
return config;
|
|
17894
|
+
}
|
|
17799
17895
|
async reportPossibleOrphanSubnets(logicalId, vpcId, cidrBlock, sent, window, context) {
|
|
17800
17896
|
const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
|
|
17801
17897
|
const wanted = canonicalizeIpv4Cidr(cidrBlock) ?? cidrBlock;
|
|
@@ -17917,7 +18013,7 @@ var EC2Provider = class {
|
|
|
17917
18013
|
}
|
|
17918
18014
|
async delete(logicalId, physicalId, resourceType, properties, context) {
|
|
17919
18015
|
switch (resourceType) {
|
|
17920
|
-
case "AWS::EC2::VPC": return this.deleteVpc(logicalId, physicalId, resourceType, context);
|
|
18016
|
+
case "AWS::EC2::VPC": return this.deleteVpc(logicalId, physicalId, resourceType, context, properties);
|
|
17921
18017
|
case "AWS::EC2::Subnet": return this.deleteSubnet(logicalId, physicalId, resourceType, context);
|
|
17922
18018
|
case "AWS::EC2::InternetGateway": return this.deleteInternetGateway(logicalId, physicalId, resourceType, context);
|
|
17923
18019
|
case "AWS::EC2::EIP": return this.deleteEip(logicalId, physicalId, resourceType, context);
|
|
@@ -18072,18 +18168,24 @@ var EC2Provider = class {
|
|
|
18072
18168
|
this.logger.debug(`Creating VPC ${logicalId}`);
|
|
18073
18169
|
const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
|
|
18074
18170
|
const cidrBlock = properties["CidrBlock"];
|
|
18075
|
-
|
|
18171
|
+
const ipamAllocation = this.readVpcIpamAllocation(properties, resourceType, logicalId, context);
|
|
18172
|
+
if (!cidrBlock && ipamAllocation.poolId === void 0) throw new ProvisioningError(`CidrBlock or Ipv4IpamPoolId is required for VPC ${logicalId}`, resourceType, logicalId);
|
|
18173
|
+
const encryptionControl = this.buildVpcEncryptionControl(properties["VpcEncryptionControl"], resourceType, logicalId, context);
|
|
18174
|
+
const orphanMatch = cidrBlock ? { cidrBlock } : { ipamPoolId: ipamAllocation.poolId };
|
|
18076
18175
|
let leftBehindId;
|
|
18077
18176
|
try {
|
|
18078
18177
|
const createClient = await this.getCreateClient();
|
|
18079
18178
|
const orphanWindow = createVpcLatch.take(logicalId);
|
|
18080
|
-
if (orphanWindow !== void 0) await this.reportPossibleOrphanVpcs(logicalId,
|
|
18179
|
+
if (orphanWindow !== void 0) await this.reportPossibleOrphanVpcs(logicalId, orphanMatch, desiredTags, orphanWindow, context);
|
|
18081
18180
|
const attemptStartMs = Date.now();
|
|
18082
18181
|
let response;
|
|
18083
18182
|
let tagsApplied;
|
|
18084
18183
|
try {
|
|
18085
18184
|
({response, tagsApplied} = await this.sendTaggedCreate(logicalId, "vpc", desiredTags, (TagSpecifications) => createClient.send(new CreateVpcCommand({
|
|
18086
|
-
CidrBlock: cidrBlock,
|
|
18185
|
+
...cidrBlock ? { CidrBlock: cidrBlock } : {},
|
|
18186
|
+
...ipamAllocation.poolId !== void 0 && { Ipv4IpamPoolId: ipamAllocation.poolId },
|
|
18187
|
+
...ipamAllocation.netmaskLength !== void 0 && { Ipv4NetmaskLength: ipamAllocation.netmaskLength },
|
|
18188
|
+
...encryptionControl !== void 0 && { VpcEncryptionControl: encryptionControl },
|
|
18087
18189
|
InstanceTenancy: properties["InstanceTenancy"] ?? void 0,
|
|
18088
18190
|
...TagSpecifications && { TagSpecifications }
|
|
18089
18191
|
}))));
|
|
@@ -18095,7 +18197,7 @@ var EC2Provider = class {
|
|
|
18095
18197
|
ec2IdsCreatedByThisProcess.add(vpcId);
|
|
18096
18198
|
reportCreatedResource(logicalId, resourceType, vpcId);
|
|
18097
18199
|
const vpcReplayWindow = replayedSendWindow(response, attemptStartMs);
|
|
18098
|
-
if (vpcReplayWindow !== void 0) await this.reportPossibleOrphanVpcs(logicalId,
|
|
18200
|
+
if (vpcReplayWindow !== void 0) await this.reportPossibleOrphanVpcs(logicalId, orphanMatch, desiredTags, vpcReplayWindow, context);
|
|
18099
18201
|
let defaultSgId;
|
|
18100
18202
|
try {
|
|
18101
18203
|
if (properties["EnableDnsHostnames"] === true || properties["EnableDnsHostnames"] === "true") await this.ec2Client.send(new ModifyVpcAttributeCommand({
|
|
@@ -18136,7 +18238,7 @@ var EC2Provider = class {
|
|
|
18136
18238
|
physicalId: vpcId,
|
|
18137
18239
|
attributes: definedAttributes({
|
|
18138
18240
|
VpcId: vpcId,
|
|
18139
|
-
CidrBlock: cidrBlock,
|
|
18241
|
+
CidrBlock: cidrBlock || response.Vpc?.CidrBlock,
|
|
18140
18242
|
DefaultSecurityGroup: defaultSgId
|
|
18141
18243
|
})
|
|
18142
18244
|
};
|
|
@@ -18158,10 +18260,14 @@ var EC2Provider = class {
|
|
|
18158
18260
|
const newTenancy = tenancyOf(properties["InstanceTenancy"]);
|
|
18159
18261
|
const oldTenancy = tenancyOf(previousProperties["InstanceTenancy"]);
|
|
18160
18262
|
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");
|
|
18263
|
+
const createOnlyChanged = VPC_CREATE_ONLY_SENT.filter((key) => !(key === "Ipv4IpamPoolId" && (properties[key] === void 0 || previousProperties[key] === void 0)) && !sameCreateOnlySent(key, properties[key], previousProperties[key]));
|
|
18264
|
+
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
18265
|
const asBool = (v) => {
|
|
18162
18266
|
if (v === void 0) return void 0;
|
|
18163
18267
|
return v === true || v === "true";
|
|
18164
18268
|
};
|
|
18269
|
+
const declaredCidr = properties["CidrBlock"];
|
|
18270
|
+
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
18271
|
const newDnsHostnames = asBool(properties["EnableDnsHostnames"]);
|
|
18166
18272
|
const oldDnsHostnames = asBool(previousProperties["EnableDnsHostnames"]);
|
|
18167
18273
|
if (newDnsHostnames !== void 0 && newDnsHostnames !== oldDnsHostnames) await this.ec2Client.send(new ModifyVpcAttributeCommand({
|
|
@@ -18183,10 +18289,10 @@ var EC2Provider = class {
|
|
|
18183
18289
|
return {
|
|
18184
18290
|
physicalId,
|
|
18185
18291
|
wasReplaced: false,
|
|
18186
|
-
attributes: {
|
|
18292
|
+
attributes: definedAttributes({
|
|
18187
18293
|
VpcId: physicalId,
|
|
18188
|
-
CidrBlock:
|
|
18189
|
-
}
|
|
18294
|
+
CidrBlock: cidrBlock
|
|
18295
|
+
})
|
|
18190
18296
|
};
|
|
18191
18297
|
} catch (error) {
|
|
18192
18298
|
if (error instanceof CdkdError) throw error;
|
|
@@ -18194,12 +18300,13 @@ var EC2Provider = class {
|
|
|
18194
18300
|
throw this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to update VPC ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
18195
18301
|
}
|
|
18196
18302
|
}
|
|
18197
|
-
async deleteVpc(logicalId, physicalId, resourceType, context) {
|
|
18303
|
+
async deleteVpc(logicalId, physicalId, resourceType, context, properties) {
|
|
18198
18304
|
this.logger.debug(`Deleting VPC ${logicalId}: ${physicalId}`);
|
|
18199
18305
|
const maxAttempts = 10;
|
|
18200
18306
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) try {
|
|
18201
18307
|
await this.ec2Client.send(new DeleteVpcCommand({ VpcId: physicalId }));
|
|
18202
18308
|
this.logger.debug(`Successfully deleted VPC ${logicalId}`);
|
|
18309
|
+
await this.waitForVpcIpamRelease(physicalId, resourceType, properties, context);
|
|
18203
18310
|
return;
|
|
18204
18311
|
} catch (error) {
|
|
18205
18312
|
if (this.isNotFoundError(error) && (context?.failedCreateOrphan !== true || isNamedError(error, VPC_NOT_FOUND_NAMES))) {
|
|
@@ -18219,6 +18326,38 @@ var EC2Provider = class {
|
|
|
18219
18326
|
throw this.wrapDeleteError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete VPC ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
18220
18327
|
}
|
|
18221
18328
|
}
|
|
18329
|
+
async waitForVpcIpamRelease(vpcId, resourceType, properties, context) {
|
|
18330
|
+
const poolId = properties?.["Ipv4IpamPoolId"];
|
|
18331
|
+
if (typeof poolId !== "string" || !/^ipam-pool-[0-9a-z]+$/.test(poolId)) return;
|
|
18332
|
+
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`));
|
|
18333
|
+
await waitForGoneAfterDelete({
|
|
18334
|
+
what: maskerOrIdentity(context?.maskSecrets)(`the IPAM pool ${poolId} allocation of VPC ${vpcId}`),
|
|
18335
|
+
resourceType,
|
|
18336
|
+
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.",
|
|
18337
|
+
describe: async () => {
|
|
18338
|
+
try {
|
|
18339
|
+
let token;
|
|
18340
|
+
let pages = 0;
|
|
18341
|
+
do {
|
|
18342
|
+
const page = await this.ec2Client.send(new GetIpamPoolAllocationsCommand({
|
|
18343
|
+
IpamPoolId: poolId,
|
|
18344
|
+
NextToken: token
|
|
18345
|
+
}));
|
|
18346
|
+
if ((page.IpamPoolAllocations ?? []).some((a) => a.ResourceId === vpcId)) return "allocated";
|
|
18347
|
+
token = page.NextToken;
|
|
18348
|
+
pages++;
|
|
18349
|
+
} while (token && pages < 20);
|
|
18350
|
+
return token ? "unknown (allocation listing truncated)" : void 0;
|
|
18351
|
+
} catch (error) {
|
|
18352
|
+
if (isNamedError(error, IPAM_POOL_NOT_FOUND_NAMES)) return void 0;
|
|
18353
|
+
throw error;
|
|
18354
|
+
}
|
|
18355
|
+
},
|
|
18356
|
+
logger: this.logger,
|
|
18357
|
+
pollIntervalMs: vpcIpamReleaseWait.pollIntervalMs,
|
|
18358
|
+
maxWaitMs: vpcIpamReleaseWait.maxWaitMs
|
|
18359
|
+
});
|
|
18360
|
+
}
|
|
18222
18361
|
async getVpcAttribute(physicalId, attributeName) {
|
|
18223
18362
|
try {
|
|
18224
18363
|
switch (attributeName) {
|
|
@@ -19941,6 +20080,7 @@ var EC2Provider = class {
|
|
|
19941
20080
|
if (!imageId) throw new ProvisioningError(`ImageId is required for EC2 Instance ${logicalId}`, resourceType, logicalId);
|
|
19942
20081
|
const instanceType = requireConfigString(properties["InstanceType"], "t3.micro", "AWS::EC2::Instance InstanceType", replayWarn(this.logger, context));
|
|
19943
20082
|
const blockDeviceMappings = this.buildBlockDeviceMappings(properties, logicalId);
|
|
20083
|
+
const launchOnlyOptions = this.buildLaunchOnlyInstanceOptions(properties, resourceType, logicalId);
|
|
19944
20084
|
let leftBehindId;
|
|
19945
20085
|
try {
|
|
19946
20086
|
const securityGroupIds = properties["SecurityGroupIds"];
|
|
@@ -19974,7 +20114,8 @@ var EC2Provider = class {
|
|
|
19974
20114
|
Monitoring: this.buildRunInstancesMonitoring(properties),
|
|
19975
20115
|
MetadataOptions: this.buildMetadataOptions(properties),
|
|
19976
20116
|
CreditSpecification: this.buildCreditSpecification(properties),
|
|
19977
|
-
Placement: this.buildPlacement(properties)
|
|
20117
|
+
Placement: this.buildPlacement(properties),
|
|
20118
|
+
...launchOnlyOptions
|
|
19978
20119
|
})));
|
|
19979
20120
|
const instance = response.Instances?.[0];
|
|
19980
20121
|
if (!instance?.InstanceId) throw new Error("No instance ID returned from RunInstances");
|
|
@@ -20188,6 +20329,14 @@ var EC2Provider = class {
|
|
|
20188
20329
|
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
20330
|
} else if (!standInSkips("InstanceType")) plan.instanceType = requireConfigString(properties["InstanceType"], "", "AWS::EC2::Instance InstanceType");
|
|
20190
20331
|
}
|
|
20332
|
+
const createOnlyChanged = INSTANCE_CREATE_ONLY_SENT.filter((key) => changed(key, (a, b) => sameCreateOnlySent(key, a, b)));
|
|
20333
|
+
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`));
|
|
20334
|
+
if (changed("InstanceInitiatedShutdownBehavior", (a, b) => a === b)) {
|
|
20335
|
+
if (properties["InstanceInitiatedShutdownBehavior"] === void 0) {
|
|
20336
|
+
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.`);
|
|
20337
|
+
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));
|
|
20338
|
+
} else if (!standInSkips("InstanceInitiatedShutdownBehavior")) plan.shutdownBehavior = requireConfigString(properties["InstanceInitiatedShutdownBehavior"], "", "AWS::EC2::Instance InstanceInitiatedShutdownBehavior");
|
|
20339
|
+
}
|
|
20191
20340
|
if (changed("UserData", (a, b) => a === b)) {
|
|
20192
20341
|
const userData = properties["UserData"];
|
|
20193
20342
|
if (userData === void 0) plan.userData = /* @__PURE__ */ new Uint8Array(0);
|
|
@@ -20279,6 +20428,13 @@ var EC2Provider = class {
|
|
|
20279
20428
|
}));
|
|
20280
20429
|
applied.push("the new DeleteOnTermination");
|
|
20281
20430
|
}
|
|
20431
|
+
if (plan.shutdownBehavior !== void 0) {
|
|
20432
|
+
await this.ec2Client.send(new ModifyInstanceAttributeCommand({
|
|
20433
|
+
InstanceId: physicalId,
|
|
20434
|
+
InstanceInitiatedShutdownBehavior: { Value: plan.shutdownBehavior }
|
|
20435
|
+
}));
|
|
20436
|
+
applied.push("the new InstanceInitiatedShutdownBehavior");
|
|
20437
|
+
}
|
|
20282
20438
|
if (plan.instanceType === void 0 && plan.userData === void 0) {
|
|
20283
20439
|
if (instancesLeftStoppedByCdkd.has(physicalId)) {
|
|
20284
20440
|
let state = await this.readInstanceState(physicalId);
|
|
@@ -20630,6 +20786,29 @@ var EC2Provider = class {
|
|
|
20630
20786
|
const raw = obj["CPUCredits"] ?? obj["CpuCredits"];
|
|
20631
20787
|
return typeof raw === "string" ? raw : void 0;
|
|
20632
20788
|
}
|
|
20789
|
+
buildLaunchOnlyInstanceOptions(properties, resourceType, logicalId) {
|
|
20790
|
+
const cpu = properties["CpuOptions"];
|
|
20791
|
+
const hibernation = properties["HibernationOptions"];
|
|
20792
|
+
const refusal = configIntegerRefusal(cpu, "CoreCount", `${resourceType} CpuOptions`, 1) ?? configIntegerRefusal(cpu, "ThreadsPerCore", `${resourceType} CpuOptions`, 1) ?? configBooleanRefusal(hibernation, "Configured", `${resourceType} HibernationOptions`) ?? configStringRefusal(properties, "InstanceInitiatedShutdownBehavior", "", resourceType);
|
|
20793
|
+
if (refusal !== void 0) throw markNonRetryable(new ProvisioningError(`${refusal}. The instance ${logicalId} was not launched.`, resourceType, logicalId));
|
|
20794
|
+
const out = {};
|
|
20795
|
+
if (cpu !== void 0 && cpu !== null) {
|
|
20796
|
+
const block = cpu;
|
|
20797
|
+
const coreCount = coerceCfnInteger(block["CoreCount"]);
|
|
20798
|
+
const threadsPerCore = coerceCfnInteger(block["ThreadsPerCore"]);
|
|
20799
|
+
out.CpuOptions = {
|
|
20800
|
+
...coreCount !== void 0 && { CoreCount: coreCount },
|
|
20801
|
+
...threadsPerCore !== void 0 && { ThreadsPerCore: threadsPerCore }
|
|
20802
|
+
};
|
|
20803
|
+
}
|
|
20804
|
+
if (hibernation !== void 0 && hibernation !== null) {
|
|
20805
|
+
const configured = coerceCfnBoolean(hibernation["Configured"]);
|
|
20806
|
+
out.HibernationOptions = configured === void 0 ? {} : { Configured: configured };
|
|
20807
|
+
}
|
|
20808
|
+
const shutdown = properties["InstanceInitiatedShutdownBehavior"];
|
|
20809
|
+
if (typeof shutdown === "string" && shutdown !== "") out.InstanceInitiatedShutdownBehavior = shutdown;
|
|
20810
|
+
return out;
|
|
20811
|
+
}
|
|
20633
20812
|
buildIpPermission(properties, direction = "ingress", inline = false) {
|
|
20634
20813
|
const ipProtocol = properties["IpProtocol"] ?? "-1";
|
|
20635
20814
|
const fromPort = properties["FromPort"];
|
|
@@ -21084,13 +21263,13 @@ var EC2Provider = class {
|
|
|
21084
21263
|
async readCurrentStateOnce(physicalId, logicalId, resourceType, properties, context) {
|
|
21085
21264
|
try {
|
|
21086
21265
|
switch (resourceType) {
|
|
21087
|
-
case "AWS::EC2::VPC": return await this.readVpcCurrentState(physicalId);
|
|
21266
|
+
case "AWS::EC2::VPC": return await this.readVpcCurrentState(physicalId, properties);
|
|
21088
21267
|
case "AWS::EC2::Subnet": return await this.readSubnetCurrentState(physicalId);
|
|
21089
21268
|
case "AWS::EC2::InternetGateway": return await this.readInternetGatewayCurrentState(physicalId);
|
|
21090
21269
|
case "AWS::EC2::NatGateway": return await this.readNatGatewayCurrentState(physicalId, properties);
|
|
21091
21270
|
case "AWS::EC2::RouteTable": return await this.readRouteTableCurrentState(physicalId);
|
|
21092
21271
|
case "AWS::EC2::SecurityGroup": return await this.readSecurityGroupCurrentState(physicalId, properties);
|
|
21093
|
-
case "AWS::EC2::Instance": return await this.readInstanceCurrentState(physicalId);
|
|
21272
|
+
case "AWS::EC2::Instance": return await this.readInstanceCurrentState(physicalId, properties);
|
|
21094
21273
|
case "AWS::EC2::NetworkAcl": return await this.readNetworkAclCurrentState(physicalId);
|
|
21095
21274
|
case "AWS::EC2::EIP": return await this.readEipCurrentState(physicalId, properties, context?.afterOwnWrite === true);
|
|
21096
21275
|
case "AWS::EC2::VPCGatewayAttachment": return await this.readVpcGatewayAttachmentCurrentState(physicalId, properties);
|
|
@@ -21109,9 +21288,13 @@ var EC2Provider = class {
|
|
|
21109
21288
|
throw err;
|
|
21110
21289
|
}
|
|
21111
21290
|
}
|
|
21112
|
-
getDriftUnknownPaths(resourceType) {
|
|
21291
|
+
getDriftUnknownPaths(resourceType, properties) {
|
|
21113
21292
|
switch (resourceType) {
|
|
21114
21293
|
case "AWS::EC2::Instance": return ["NetworkInterfaces"];
|
|
21294
|
+
case "AWS::EC2::VPC": {
|
|
21295
|
+
const control = properties?.["VpcEncryptionControl"];
|
|
21296
|
+
return ["Ipv4IpamPoolId", ...control !== null && typeof control === "object" && control["Mode"] === "monitor" ? VPC_ENCRYPTION_CONTROL_EXCLUSIONS.map((key) => `VpcEncryptionControl.${key}`) : []];
|
|
21297
|
+
}
|
|
21115
21298
|
case "AWS::EC2::Route":
|
|
21116
21299
|
case "AWS::EC2::VPCGatewayAttachment":
|
|
21117
21300
|
case "AWS::EC2::SubnetRouteTableAssociation":
|
|
@@ -21131,12 +21314,27 @@ var EC2Provider = class {
|
|
|
21131
21314
|
const { declared, narrowed } = narrowRouteDestinations(properties);
|
|
21132
21315
|
return declared.length > 1 ? narrowed : properties;
|
|
21133
21316
|
}
|
|
21134
|
-
async readVpcCurrentState(physicalId) {
|
|
21317
|
+
async readVpcCurrentState(physicalId, properties) {
|
|
21135
21318
|
const vpc = (await this.ec2Client.send(new DescribeVpcsCommand({ VpcIds: [physicalId] }))).Vpcs?.[0];
|
|
21136
21319
|
if (!vpc) return RESOURCE_NOT_FOUND;
|
|
21137
21320
|
const result = {};
|
|
21138
|
-
if (vpc.CidrBlock !== void 0)
|
|
21321
|
+
if (vpc.CidrBlock !== void 0) {
|
|
21322
|
+
result["CidrBlock"] = vpc.CidrBlock;
|
|
21323
|
+
const prefix = /\/(\d+)$/.exec(vpc.CidrBlock)?.[1];
|
|
21324
|
+
if (prefix !== void 0 && properties?.["Ipv4NetmaskLength"] !== void 0) result["Ipv4NetmaskLength"] = Number(prefix);
|
|
21325
|
+
}
|
|
21139
21326
|
if (vpc.InstanceTenancy !== void 0) result["InstanceTenancy"] = vpc.InstanceTenancy;
|
|
21327
|
+
const control = vpc.EncryptionControl;
|
|
21328
|
+
if (control?.Mode !== void 0) {
|
|
21329
|
+
const out = { Mode: control.Mode };
|
|
21330
|
+
const exclusions = control.ResourceExclusions;
|
|
21331
|
+
for (const key of VPC_ENCRYPTION_CONTROL_EXCLUSIONS) {
|
|
21332
|
+
const state = exclusions?.[key.slice(0, -9)]?.State;
|
|
21333
|
+
if (state === "enabled" || state === "enabling") out[key] = "enable";
|
|
21334
|
+
else if (state === "disabled" || state === "disabling") out[key] = "disable";
|
|
21335
|
+
}
|
|
21336
|
+
result["VpcEncryptionControl"] = out;
|
|
21337
|
+
}
|
|
21140
21338
|
try {
|
|
21141
21339
|
const dnsHost = await this.ec2Client.send(new DescribeVpcAttributeCommand({
|
|
21142
21340
|
VpcId: physicalId,
|
|
@@ -21229,7 +21427,7 @@ var EC2Provider = class {
|
|
|
21229
21427
|
result["SecurityGroupEgress"] = reconcileSgRules(egressRules, stateEgress, "egress");
|
|
21230
21428
|
return result;
|
|
21231
21429
|
}
|
|
21232
|
-
async readInstanceCurrentState(physicalId) {
|
|
21430
|
+
async readInstanceCurrentState(physicalId, properties) {
|
|
21233
21431
|
const instance = (await this.ec2Client.send(new DescribeInstancesCommand({ InstanceIds: [physicalId] }))).Reservations?.[0]?.Instances?.[0];
|
|
21234
21432
|
if (!instance || instance.State?.Name === "terminated" || instance.State?.Name === "shutting-down") return RESOURCE_NOT_FOUND;
|
|
21235
21433
|
const result = {};
|
|
@@ -21254,6 +21452,13 @@ var EC2Provider = class {
|
|
|
21254
21452
|
if (md.InstanceMetadataTags !== void 0) out["InstanceMetadataTags"] = md.InstanceMetadataTags;
|
|
21255
21453
|
if (Object.keys(out).length > 0) result["MetadataOptions"] = out;
|
|
21256
21454
|
}
|
|
21455
|
+
if (instance.CpuOptions !== void 0) {
|
|
21456
|
+
const cpu = {};
|
|
21457
|
+
if (instance.CpuOptions.CoreCount !== void 0) cpu["CoreCount"] = instance.CpuOptions.CoreCount;
|
|
21458
|
+
if (instance.CpuOptions.ThreadsPerCore !== void 0) cpu["ThreadsPerCore"] = instance.CpuOptions.ThreadsPerCore;
|
|
21459
|
+
if (Object.keys(cpu).length > 0) result["CpuOptions"] = cpu;
|
|
21460
|
+
}
|
|
21461
|
+
if (instance.HibernationOptions?.Configured !== void 0) result["HibernationOptions"] = { Configured: instance.HibernationOptions.Configured };
|
|
21257
21462
|
if (instance.Placement?.Tenancy !== void 0) result["Tenancy"] = instance.Placement.Tenancy;
|
|
21258
21463
|
if (instance.IamInstanceProfile?.Arn !== void 0) result["IamInstanceProfile"] = instance.IamInstanceProfile.Arn;
|
|
21259
21464
|
else if (process.env["CDKD_NO_WAIT"] === "true" && instance.State?.Name === "pending") try {
|
|
@@ -21307,6 +21512,15 @@ var EC2Provider = class {
|
|
|
21307
21512
|
} catch (err) {
|
|
21308
21513
|
this.logger.debug(`DescribeInstanceAttribute(disableApiTermination, ${physicalId}) failed: ${describeAwsFailure(err).detail}`);
|
|
21309
21514
|
}
|
|
21515
|
+
if (properties?.["InstanceInitiatedShutdownBehavior"] !== void 0) try {
|
|
21516
|
+
const attrResp = await this.ec2Client.send(new DescribeInstanceAttributeCommand({
|
|
21517
|
+
InstanceId: physicalId,
|
|
21518
|
+
Attribute: "instanceInitiatedShutdownBehavior"
|
|
21519
|
+
}));
|
|
21520
|
+
if (attrResp.InstanceInitiatedShutdownBehavior?.Value !== void 0) result["InstanceInitiatedShutdownBehavior"] = attrResp.InstanceInitiatedShutdownBehavior.Value;
|
|
21521
|
+
} catch (err) {
|
|
21522
|
+
this.logger.debug(safeMsg`DescribeInstanceAttribute(instanceInitiatedShutdownBehavior, ${physicalId}) failed: ${describeAwsFailure(err).detail}`);
|
|
21523
|
+
}
|
|
21310
21524
|
try {
|
|
21311
21525
|
const cpuCredits = (await this.ec2Client.send(new DescribeInstanceCreditSpecificationsCommand({ InstanceIds: [physicalId] }))).InstanceCreditSpecifications?.[0]?.CpuCredits;
|
|
21312
21526
|
if (cpuCredits !== void 0) result["CreditSpecification"] = { CPUCredits: cpuCredits };
|
|
@@ -21521,10 +21735,16 @@ var EC2Provider = class {
|
|
|
21521
21735
|
async verifyExplicit(logicalId, resourceType, physicalId, properties) {
|
|
21522
21736
|
try {
|
|
21523
21737
|
switch (resourceType) {
|
|
21524
|
-
case "AWS::EC2::VPC":
|
|
21525
|
-
physicalId
|
|
21526
|
-
|
|
21527
|
-
|
|
21738
|
+
case "AWS::EC2::VPC": {
|
|
21739
|
+
const vpc = (await this.ec2Client.send(new DescribeVpcsCommand({ VpcIds: [physicalId] }))).Vpcs?.[0];
|
|
21740
|
+
return vpc ? {
|
|
21741
|
+
physicalId,
|
|
21742
|
+
attributes: definedAttributes({
|
|
21743
|
+
VpcId: physicalId,
|
|
21744
|
+
CidrBlock: vpc.CidrBlock
|
|
21745
|
+
})
|
|
21746
|
+
} : null;
|
|
21747
|
+
}
|
|
21528
21748
|
case "AWS::EC2::Subnet": {
|
|
21529
21749
|
const subnet = (await this.ec2Client.send(new DescribeSubnetsCommand({ SubnetIds: [physicalId] }))).Subnets?.[0];
|
|
21530
21750
|
return subnet ? {
|
|
@@ -30411,14 +30631,14 @@ var RDSDBProxyProvider = class {
|
|
|
30411
30631
|
vpcId = proxy?.VpcId;
|
|
30412
30632
|
break;
|
|
30413
30633
|
}
|
|
30414
|
-
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(`DBProxy ${dbProxyName} entered terminal failure state: ${status}
|
|
30634
|
+
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(mask(`DBProxy ${dbProxyName} entered terminal failure state: ${status}`), resourceType, logicalId, dbProxyName);
|
|
30415
30635
|
} catch (error) {
|
|
30416
30636
|
if (error instanceof DBProxyNotFoundFault) {} else if (error instanceof ProvisioningError) throw error;
|
|
30417
30637
|
else throw this.wrapCaughtError(error, "CREATE (poll)", resourceType, logicalId, dbProxyName, mask);
|
|
30418
30638
|
}
|
|
30419
30639
|
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS$1));
|
|
30420
30640
|
}
|
|
30421
|
-
if (!endpoint || !dbProxyArn) throw new ProvisioningError(`Timed out waiting for DBProxy ${dbProxyName} to become available (last status: ${status ?? "unknown"})
|
|
30641
|
+
if (!endpoint || !dbProxyArn) throw new ProvisioningError(mask(`Timed out waiting for DBProxy ${dbProxyName} to become available (last status: ${status ?? "unknown"})`), resourceType, logicalId, dbProxyName);
|
|
30422
30642
|
} catch (error) {
|
|
30423
30643
|
markCreatedBeforeFailure(error, logicalId, resourceType, dbProxyName);
|
|
30424
30644
|
throw error;
|
|
@@ -30477,6 +30697,7 @@ var RDSDBProxyProvider = class {
|
|
|
30477
30697
|
} catch (error) {
|
|
30478
30698
|
throw this.wrapCaughtError(error, "UPDATE", resourceType, logicalId, physicalId, mask);
|
|
30479
30699
|
}
|
|
30700
|
+
await this.waitForAvailableAfterModify(physicalId, resourceType, logicalId, mask);
|
|
30480
30701
|
}
|
|
30481
30702
|
this.invalidateAttributeCache(physicalId);
|
|
30482
30703
|
await this.applyTagDiff(physicalId, previousProperties["Tags"], properties["Tags"], resourceType, logicalId, mask);
|
|
@@ -30486,6 +30707,25 @@ var RDSDBProxyProvider = class {
|
|
|
30486
30707
|
wasReplaced: false
|
|
30487
30708
|
};
|
|
30488
30709
|
}
|
|
30710
|
+
async waitForAvailableAfterModify(physicalId, resourceType, logicalId, mask) {
|
|
30711
|
+
const client = this.getClient();
|
|
30712
|
+
const deadline = Date.now() + POLL_TIMEOUT_MS$1;
|
|
30713
|
+
let status;
|
|
30714
|
+
while (Date.now() < deadline) {
|
|
30715
|
+
try {
|
|
30716
|
+
const proxy = (await client.send(new DescribeDBProxiesCommand({ DBProxyName: physicalId }))).DBProxies?.[0];
|
|
30717
|
+
if (!proxy) throw new ProvisioningError(mask(`DBProxy ${physicalId} was not found while waiting for it after modify`), resourceType, logicalId, physicalId);
|
|
30718
|
+
status = proxy.Status;
|
|
30719
|
+
} catch (error) {
|
|
30720
|
+
if (error instanceof ProvisioningError) throw error;
|
|
30721
|
+
throw this.wrapCaughtError(error, "UPDATE (poll)", resourceType, logicalId, physicalId, mask);
|
|
30722
|
+
}
|
|
30723
|
+
if (status === "available") return;
|
|
30724
|
+
if (status === "incompatible-network" || status === "insufficient-resource-limits") throw new ProvisioningError(mask(`DBProxy ${physicalId} entered terminal failure state after modify: ${status}`), resourceType, logicalId, physicalId);
|
|
30725
|
+
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS$1));
|
|
30726
|
+
}
|
|
30727
|
+
throw new ProvisioningError(mask(`Timed out waiting for DBProxy ${physicalId} to become available after modify (last status: ${status ?? "unknown"})`), resourceType, logicalId, physicalId);
|
|
30728
|
+
}
|
|
30489
30729
|
warnOnRetainedRemovals(logicalId, resourceType, properties, previousProperties, context) {
|
|
30490
30730
|
const retained = this.removedRetained(properties, previousProperties, context);
|
|
30491
30731
|
if (retained.length === 0) return;
|
|
@@ -30578,12 +30818,12 @@ var RDSDBProxyProvider = class {
|
|
|
30578
30818
|
IdleClientTimeout: p.IdleClientTimeout,
|
|
30579
30819
|
DebugLogging: p.DebugLogging ?? false,
|
|
30580
30820
|
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
|
|
30821
|
+
...a.Description !== void 0 && { Description: a.Description },
|
|
30822
|
+
...a.UserName !== void 0 && { UserName: a.UserName },
|
|
30823
|
+
...a.AuthScheme !== void 0 && { AuthScheme: a.AuthScheme },
|
|
30824
|
+
...a.SecretArn !== void 0 && { SecretArn: a.SecretArn },
|
|
30825
|
+
...a.IAMAuth !== void 0 && { IAMAuth: a.IAMAuth },
|
|
30826
|
+
...a.ClientPasswordAuthType !== void 0 && { ClientPasswordAuthType: a.ClientPasswordAuthType }
|
|
30587
30827
|
})),
|
|
30588
30828
|
...p.DefaultAuthScheme !== void 0 && { DefaultAuthScheme: p.DefaultAuthScheme },
|
|
30589
30829
|
...p.EndpointNetworkType !== void 0 && { EndpointNetworkType: p.EndpointNetworkType },
|
|
@@ -55299,4 +55539,4 @@ var ACMCertificateProvider = class {
|
|
|
55299
55539
|
};
|
|
55300
55540
|
|
|
55301
55541
|
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-
|
|
55542
|
+
//# sourceMappingURL=provider-classes-CZnJcera.js.map
|