@cdkd/cli 0.342.0 → 0.343.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ambient-client-defaults-3MwNEdTT.js → ambient-client-defaults-CPmXchp0.js} +2 -2
- package/dist/{ambient-client-defaults-3MwNEdTT.js.map → ambient-client-defaults-CPmXchp0.js.map} +1 -1
- package/dist/{asg-provider-ApHZ6Mae.js → asg-provider-CWB0lHRb.js} +4 -4
- package/dist/{asg-provider-ApHZ6Mae.js.map → asg-provider-CWB0lHRb.js.map} +1 -1
- package/dist/{aws-clients-pNIHPxUe.js → aws-clients-C8p6sQfr.js} +37 -5
- package/dist/aws-clients-C8p6sQfr.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{db-instance-modify-retry-vrjXpAjl.js → db-instance-modify-retry-sToRRDYL.js} +3 -3
- package/dist/{db-instance-modify-retry-vrjXpAjl.js.map → db-instance-modify-retry-sToRRDYL.js.map} +1 -1
- package/dist/{deploy-engine-B9WzTRxL.js → deploy-engine-CJ363Jh0.js} +64 -13
- package/dist/deploy-engine-CJ363Jh0.js.map +1 -0
- package/dist/{ecr-uri-CLSVFzAB.js → ecr-uri-BUjy2DZJ.js} +3 -3
- package/dist/{ecr-uri-CLSVFzAB.js.map → ecr-uri-BUjy2DZJ.js.map} +1 -1
- package/dist/{iam-role-provider-qyUDKsou.js → iam-role-provider-DXZrowSp.js} +5 -5
- package/dist/{iam-role-provider-qyUDKsou.js.map → iam-role-provider-DXZrowSp.js.map} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/{neptune-provider-CZNhWtyQ.js → neptune-provider-BaG6dNvC.js} +5 -5
- package/dist/{neptune-provider-CZNhWtyQ.js.map → neptune-provider-BaG6dNvC.js.map} +1 -1
- package/dist/{program-CWnbFCjg.js → program-DvCw1Vlz.js} +207 -59
- package/dist/program-DvCw1Vlz.js.map +1 -0
- package/dist/{provider-classes-9YIXh-it.js → provider-classes-XzlF2NN6.js} +565 -18
- package/dist/provider-classes-XzlF2NN6.js.map +1 -0
- package/dist/{rds-provider-CvaAoT1c.js → rds-provider-B9nEPi0J.js} +6 -6
- package/dist/{rds-provider-CvaAoT1c.js.map → rds-provider-B9nEPi0J.js.map} +1 -1
- package/dist/{read-replica-BA5570ms.js → read-replica-CuWA09yj.js} +3 -3
- package/dist/{read-replica-BA5570ms.js.map → read-replica-CuWA09yj.js.map} +1 -1
- package/dist/{update-removal-DLbbpOoJ.js → update-removal-Bp0Y4QQ2.js} +2 -2
- package/dist/{update-removal-DLbbpOoJ.js.map → update-removal-Bp0Y4QQ2.js.map} +1 -1
- package/dist/{version-LNRY1BhV.js → version-sV00MIFa.js} +2 -2
- package/dist/{version-LNRY1BhV.js.map → version-sV00MIFa.js.map} +1 -1
- package/package.json +2 -2
- package/dist/aws-clients-pNIHPxUe.js.map +0 -1
- package/dist/deploy-engine-B9WzTRxL.js.map +0 -1
- package/dist/program-CWnbFCjg.js.map +0 -1
- package/dist/provider-classes-9YIXh-it.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-
|
|
1
|
+
import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-DXZrowSp.js";
|
|
2
2
|
import { A as requireConfigString, C as configBooleanRefusal, D as replayWarn, E as readConfigString, F as generateResourceName, H as getCurrentStackInstanceId, I as generateResourceNameWithFallback, O as requireConfigArray, R as recordedGeneratedNameKept, S as coerceCfnInteger, T as configStringRefusal, U as getCurrentStackName, W as isBeforeStateRead, Z as SECRET_REF_MAX_CODE_POINTS, a as safeStringify, at as displayStackName, ct as plainIdentOr, et as asIsMessage, i as isAwsAuthoredFailure, it as displaySafe, k as requireConfigObject, lt as safeMsg, n as describeAwsFailure, ot as isPasteableIdent, r as describeAwsStatusReason, rt as displayIdent, s as getLogger, t as VERBOSE_POINTER, w as configIntegerRefusal, x as coerceCfnBoolean, y as generatedNameFor } from "./aws-failure-text-zxW2CTmF.js";
|
|
3
|
-
import { d as withApiGatewayPacing, l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-
|
|
4
|
-
import { $ as CdkdError, D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markRedactedCause, H as isMarkedNonRetryable, I as isExplicitDenyError, K as wrapMaskedAwsError, M as explicitDenyPolicyKind, O as relayedNameCollision, R as isRetryableTransientError, St as withheldTargetClause, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, Z as AccountIdUnavailableError, _ as ResourceUpdateNotSupportedError, gt as pasteableCommand, ht as isInertUnquoted, i as credentialFingerprint, it as ProvisioningError, mt as hasClauseBreak, n as ambientCredentialConfig, pt as commandHole, r as clientDefaultsFor, t as ambientClientDefaults, vt as plainOrDescribed, xt as shellQuote, z as isTransientServerError } from "./ambient-client-defaults-
|
|
5
|
-
import { $ as deleteAfterProtectionFlipWithFinalSnapshot, A as setBounded, At as segmentAfterAnchor, B as resolveExplicitPhysicalId, Bt as clearCreatedBeforeFailure, C as AmbiguousCreateLatch, Ct as canonicalizeRoute53QueryName, D as isInsideWindow, Dt as logicalIdShown, E as createAttemptKey, Et as compositeIdSkipResult, F as isQuotableImportValue, Ft as maskDeep, H as assertRegionMatch, I as normalizeAwsTagsToCfn, It as maskerOrIdentity, J as observeThenDisableProtection, Jt as markSupersedesEarlierCreate, K as deleteWithProtectionCompensation, Kt as markAuxiliaryFailure, L as quotedRemedyLogicalId, Lt as withDerivedNameMasks, M as VALUE_NOT_SHOWN, Mt as createMaskedLogSinks, N as isPlainImportJson, Nt as createMaskedRetryLogger, O as replayFollowedAmbiguousAttempt, Ot as packCompositeId, P as isPlainImportValue, Pt as isSecretDerivedValue, Q as PROTECTION_FLIP_RETRY_WAIT_MS, R as refusalTypeShown, S as AMBIGUOUS_LATCH_TTL_MS, St as startInterruptWatch, T as ambiguousAttemptLead, Tt as compositeIdSeparatorRefusal, V as RESOURCE_NOT_FOUND, W as markNotGone, Wt as isAuxiliaryFailure, Y as rdsFamilyProtectionSite, Z as userPoolProtectionSite, _ as onlySecretDerived, _t as renderDisableCommand, a as withRemovalDefaults, at as isTerminalDeleteFailure, b as recordedPrincipalsRepair, cn as injectiveKeyPrefix, ct as ElapsedBudget, f as retractCreatedResource, fn as withPasteableAwsProfile, ft as UNNAMEABLE_ID_CLAUSE, g as holdsSecretDerivedEntry, gt as protectedReplacementAdvice, h as SECRET_DERIVED_READ_LIVE, ht as pasteableAwsCommand, i as removedTemplateKeys, it as ProtectionFlipRegistry, j as withoutServerErrorRetries, jt as stateOrphanRecordRemedy, k as replayedSendWindow, lt as ElapsedBudgetRegistry, mt as isAwsCliLiteral, nt as isTerminalDbWaitStatus, ot as protectionFlipKey, pt as WITHHELD_AWS_COMMAND, q as logGroupProtectionSite, qt as markCreatedBeforeFailure, sn as injectiveKey, t as clearOnUpdateRemoval, tt as isProceedDbStatus, u as reportCreatedResource, v as readPrincipalLists, w as RecentIdSet, wt as compositeIdFormatMessage, xt as isInterruptedWaitError, z as remedyLogicalId } from "./update-removal-
|
|
6
|
-
import { $ as vectorIndexesForCreate, $c as markSameGenerationBag, $o as isWarmThroughputDecrease, At as enclosingDeadlineExpired, B as reverseMapStreamPolicy, Ba as reDisableInstanceApiTermination, Bi as APPSYNC_APIKEY_ARN_RESOURCE_PATH, Ct as maskedLogger, Da as resolvedResourceTimeoutMs, Dd as canonicalizeRegion, Dl as recoverMaskedOutput, Dt as S3_AUTO_DELETE_OBJECTS_TAG, Ea as waitForGoneAfterDelete, Ec as withoutSdkUnwiredProperties, Eo as parseWebACLArn, Et as ECR_AUTO_DELETE_IMAGES_TAG, F as STREAM_POLICY_KEY, Fa as withIndeterminateGuard, Fc as sameLambdaFunctionAddress, Fi as secretNamedAttributeNamesOf, G as streamTagsMatchDeclared, Gd as resolveAssemblyPath, Gt as markRefusedBeforeApplying, H as streamDeclaresTags, Ha as onlySecretReferencesDiffer, Hd as describeFileReadFailure, I as STREAM_TAGS_KEY, J as planTimeToLive, Jt as isAccessDeniedError, K as isTtlAlreadyDisabled, L as declaredStreamPolicyMember, La as ec2InstanceProtectionSite, Mc as emrClusterInstancesReplaced, Mr as getCurrentProducerRegions, Nc as canonicalLambdaFunctionName, Nl as carriesSecretMask, Od as derivePartitionAndUrlSuffix, Ol as physicalNameCopiesOf, Oo as outputReferenceProvenanceOf, Ot as hasCdkAutoDeleteTag, P as DynamoDBGlobalTableProvider, Pa as deleteSkipReason, Pc as lambdaFunctionNameForMask, Q as readbackVectorIndexes, Qo as coerceWarmThroughput$1, R as declaredStreamTagsMember, Ra as isTerminationProtectionPropagationError, Sa as getCurrentResourceSecrets, St as deleteTableWithIndexBusyRetry, Tt as waitForIndexesSettled, Tu as rewriteTemplateAssetReferences, U as streamMemberRefusals, Ua as unchangedBehindSecretReference, Ud as displayAssemblyPath, V as streamDeclaresPolicy, Va as reEnableInstanceApiTermination, Vi as maskedSecretSegment, W as streamPolicyMatchesDeclared, Wd as renderAssemblyPathEscape, Wt as getPriorAttempts, X as sendTtlWaitingOutRateLimit, Xt as withApiLimit, Y as readTtlSpec, Ya as isSettledInstanceState, Yt as lookupEachName, Z as planVectorIndexUpdates, Zo as WARM_THROUGHPUT_MEMBERS, _ as listNestedTemplateRows, _o as s3BucketWebsiteUrl, _t as resolveDynamoDbDeleteBudgetClock, aa as readTagList, al as hasMaskableValues, ar as acquireIdempotencyToken, as as withRetry, at as planContributorInsightsOp, br as redactedDeleteAddressFields, bt as INDEX_SETTLE_POLL_INTERVAL_MS, bu as stringifyValue, ca as tagPlanWarning, ct as reverseMapIndexContributorInsights, cu as timePhase, dn as withNestedStackContext, dt as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, ea as definedAttributes, ec as refuseMalformedNestedChildOutputs, el as redactForState, es as toCfnInteger, et as vectorIndexesSettled, ft as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, g as isAbsoluteAssetPath, gc as withheldAccountClause, go as s3BucketRegionalDomainName, gt as deleteBudgetKey, h as findNestedTemplateTreeDefect, hc as accountArgs, hi as refuseRestoreFromItself, ho as s3BucketDualStackDomainName, ht as compensateRemovedDeletionProtection, ia as planTagDiff, ii as getStackRecords, it as indexDeclaresContributorInsights, jc as ecsServiceLaunchTypeSetOrChanged, jo as getAccountInfo, jt as enclosingDeadlineRemainingMs, ka as slowCcOperationTimeoutMs, kc as blockDeviceMappingsDifferOnlyInDeleteOnTermination, kl as recordAttributeIdCopy, kt as isTruthyCfnBoolean, la as isRefusedByName, lt as reverseMapTableContributorInsights, mo as s3BucketDomainName, mt as beginDeleteWait, na as DBPROXY_TAGS_WHAT, ni as awaitInFlightSibling, nl as snapshotPassProvenance, nt as CONTRIBUTOR_INSIGHTS_KEY, oa as refuseMalformedDesiredTags, oi as replacedDeleteFailureVerdict, on as revertNestedChildFromJournal, ot as planIndexContributorInsightsOps, po as s3BucketArn, pt as DYNAMODB_DELETE_POLL_COST_MS, q as isTtlRateLimited, qc as passedNoEchoParametersOf, qt as chunks, ra as DBPROXY_TAG_OPTIONS, rn as getNestedRevertRun, rr as reserveStackCreateToken, rt as contributorInsightsRefusals, sa as tagMapAsList, ss as passedParameterClassesOf, st as readContributorInsightsSpec, t as DeployEngine, ta as stringifyIfAssigned, tl as recordReferenceProvenanceEntry, tr as earliestDefined, ts as toFiniteNumber, tt as vectorIndexesShapeDetail, ua as markDeleteStarted, uc as refuseMalformedResourcesForDestroy, un as getCurrentNestedStackContext, ut as stripIndexContributorInsights, v as renderNestedTemplateTreeDefect, vr as REDACTED_DELETE_ADDRESS_SKIP_REASON, vt as resolveDynamoDbDeleteBudgetMs, wa as waitForLambdaFunctionActive, wc as findSdkUnwiredProperties, wd as decodeListingKey, wt as relayedIndexBusyDelete, xl as dynamicReferenceTokens, xr as redactedDeleteAddressSkip, xt as TABLE_INDEX_NOUN, yl as withoutPhysicalNameCopies, yr as isRedactedRecordedValue, yt as DELETE_INDEX_WAIT_PROCEED_NOTE, z as planStreamMemberOps, za as observeThenDisableInstanceApiTermination, zo as isUsableAttemptedName } from "./deploy-engine-
|
|
7
|
-
import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-
|
|
3
|
+
import { d as withApiGatewayPacing, l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-C8p6sQfr.js";
|
|
4
|
+
import { $ as CdkdError, D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markRedactedCause, H as isMarkedNonRetryable, I as isExplicitDenyError, K as wrapMaskedAwsError, M as explicitDenyPolicyKind, O as relayedNameCollision, R as isRetryableTransientError, St as withheldTargetClause, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, Z as AccountIdUnavailableError, _ as ResourceUpdateNotSupportedError, gt as pasteableCommand, ht as isInertUnquoted, i as credentialFingerprint, it as ProvisioningError, mt as hasClauseBreak, n as ambientCredentialConfig, pt as commandHole, r as clientDefaultsFor, t as ambientClientDefaults, vt as plainOrDescribed, xt as shellQuote, z as isTransientServerError } from "./ambient-client-defaults-CPmXchp0.js";
|
|
5
|
+
import { $ as deleteAfterProtectionFlipWithFinalSnapshot, A as setBounded, At as segmentAfterAnchor, B as resolveExplicitPhysicalId, Bt as clearCreatedBeforeFailure, C as AmbiguousCreateLatch, Ct as canonicalizeRoute53QueryName, D as isInsideWindow, Dt as logicalIdShown, E as createAttemptKey, Et as compositeIdSkipResult, F as isQuotableImportValue, Ft as maskDeep, H as assertRegionMatch, I as normalizeAwsTagsToCfn, It as maskerOrIdentity, J as observeThenDisableProtection, Jt as markSupersedesEarlierCreate, K as deleteWithProtectionCompensation, Kt as markAuxiliaryFailure, L as quotedRemedyLogicalId, Lt as withDerivedNameMasks, M as VALUE_NOT_SHOWN, Mt as createMaskedLogSinks, N as isPlainImportJson, Nt as createMaskedRetryLogger, O as replayFollowedAmbiguousAttempt, Ot as packCompositeId, P as isPlainImportValue, Pt as isSecretDerivedValue, Q as PROTECTION_FLIP_RETRY_WAIT_MS, R as refusalTypeShown, S as AMBIGUOUS_LATCH_TTL_MS, St as startInterruptWatch, T as ambiguousAttemptLead, Tt as compositeIdSeparatorRefusal, V as RESOURCE_NOT_FOUND, W as markNotGone, Wt as isAuxiliaryFailure, Y as rdsFamilyProtectionSite, Z as userPoolProtectionSite, _ as onlySecretDerived, _t as renderDisableCommand, a as withRemovalDefaults, at as isTerminalDeleteFailure, b as recordedPrincipalsRepair, cn as injectiveKeyPrefix, ct as ElapsedBudget, f as retractCreatedResource, fn as withPasteableAwsProfile, ft as UNNAMEABLE_ID_CLAUSE, g as holdsSecretDerivedEntry, gt as protectedReplacementAdvice, h as SECRET_DERIVED_READ_LIVE, ht as pasteableAwsCommand, i as removedTemplateKeys, it as ProtectionFlipRegistry, j as withoutServerErrorRetries, jt as stateOrphanRecordRemedy, k as replayedSendWindow, lt as ElapsedBudgetRegistry, mt as isAwsCliLiteral, nt as isTerminalDbWaitStatus, ot as protectionFlipKey, pt as WITHHELD_AWS_COMMAND, q as logGroupProtectionSite, qt as markCreatedBeforeFailure, sn as injectiveKey, t as clearOnUpdateRemoval, tt as isProceedDbStatus, u as reportCreatedResource, v as readPrincipalLists, w as RecentIdSet, wt as compositeIdFormatMessage, xt as isInterruptedWaitError, z as remedyLogicalId } from "./update-removal-Bp0Y4QQ2.js";
|
|
6
|
+
import { $ as vectorIndexesForCreate, $c as markSameGenerationBag, $o as isWarmThroughputDecrease, At as enclosingDeadlineExpired, B as reverseMapStreamPolicy, Ba as reDisableInstanceApiTermination, Bi as APPSYNC_APIKEY_ARN_RESOURCE_PATH, Ct as maskedLogger, Da as resolvedResourceTimeoutMs, Dd as canonicalizeRegion, Dl as recoverMaskedOutput, Dt as S3_AUTO_DELETE_OBJECTS_TAG, Ea as waitForGoneAfterDelete, Ec as withoutSdkUnwiredProperties, Eo as parseWebACLArn, Et as ECR_AUTO_DELETE_IMAGES_TAG, F as STREAM_POLICY_KEY, Fa as withIndeterminateGuard, Fc as sameLambdaFunctionAddress, Fi as secretNamedAttributeNamesOf, G as streamTagsMatchDeclared, Gd as resolveAssemblyPath, Gt as markRefusedBeforeApplying, H as streamDeclaresTags, Ha as onlySecretReferencesDiffer, Hd as describeFileReadFailure, I as STREAM_TAGS_KEY, J as planTimeToLive, Jt as isAccessDeniedError, K as isTtlAlreadyDisabled, L as declaredStreamPolicyMember, La as ec2InstanceProtectionSite, Mc as emrClusterInstancesReplaced, Mr as getCurrentProducerRegions, Nc as canonicalLambdaFunctionName, Nl as carriesSecretMask, Od as derivePartitionAndUrlSuffix, Ol as physicalNameCopiesOf, Oo as outputReferenceProvenanceOf, Ot as hasCdkAutoDeleteTag, P as DynamoDBGlobalTableProvider, Pa as deleteSkipReason, Pc as lambdaFunctionNameForMask, Q as readbackVectorIndexes, Qo as coerceWarmThroughput$1, R as declaredStreamTagsMember, Ra as isTerminationProtectionPropagationError, Sa as getCurrentResourceSecrets, St as deleteTableWithIndexBusyRetry, Tt as waitForIndexesSettled, Tu as rewriteTemplateAssetReferences, U as streamMemberRefusals, Ua as unchangedBehindSecretReference, Ud as displayAssemblyPath, V as streamDeclaresPolicy, Va as reEnableInstanceApiTermination, Vi as maskedSecretSegment, W as streamPolicyMatchesDeclared, Wd as renderAssemblyPathEscape, Wt as getPriorAttempts, X as sendTtlWaitingOutRateLimit, Xt as withApiLimit, Y as readTtlSpec, Ya as isSettledInstanceState, Yt as lookupEachName, Z as planVectorIndexUpdates, Zo as WARM_THROUGHPUT_MEMBERS, _ as listNestedTemplateRows, _o as s3BucketWebsiteUrl, _t as resolveDynamoDbDeleteBudgetClock, aa as readTagList, al as hasMaskableValues, ar as acquireIdempotencyToken, as as withRetry, at as planContributorInsightsOp, br as redactedDeleteAddressFields, bt as INDEX_SETTLE_POLL_INTERVAL_MS, bu as stringifyValue, ca as tagPlanWarning, ct as reverseMapIndexContributorInsights, cu as timePhase, dn as withNestedStackContext, dt as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, ea as definedAttributes, ec as refuseMalformedNestedChildOutputs, el as redactForState, es as toCfnInteger, et as vectorIndexesSettled, ft as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, g as isAbsoluteAssetPath, gc as withheldAccountClause, go as s3BucketRegionalDomainName, gt as deleteBudgetKey, h as findNestedTemplateTreeDefect, hc as accountArgs, hi as refuseRestoreFromItself, ho as s3BucketDualStackDomainName, ht as compensateRemovedDeletionProtection, ia as planTagDiff, ii as getStackRecords, it as indexDeclaresContributorInsights, jc as ecsServiceLaunchTypeSetOrChanged, jo as getAccountInfo, jt as enclosingDeadlineRemainingMs, ka as slowCcOperationTimeoutMs, kc as blockDeviceMappingsDifferOnlyInDeleteOnTermination, kl as recordAttributeIdCopy, kt as isTruthyCfnBoolean, la as isRefusedByName, lt as reverseMapTableContributorInsights, mo as s3BucketDomainName, mt as beginDeleteWait, na as DBPROXY_TAGS_WHAT, ni as awaitInFlightSibling, nl as snapshotPassProvenance, nt as CONTRIBUTOR_INSIGHTS_KEY, oa as refuseMalformedDesiredTags, oi as replacedDeleteFailureVerdict, on as revertNestedChildFromJournal, ot as planIndexContributorInsightsOps, po as s3BucketArn, pt as DYNAMODB_DELETE_POLL_COST_MS, q as isTtlRateLimited, qc as passedNoEchoParametersOf, qt as chunks, ra as DBPROXY_TAG_OPTIONS, rn as getNestedRevertRun, rr as reserveStackCreateToken, rt as contributorInsightsRefusals, sa as tagMapAsList, ss as passedParameterClassesOf, st as readContributorInsightsSpec, t as DeployEngine, ta as stringifyIfAssigned, tl as recordReferenceProvenanceEntry, tr as earliestDefined, ts as toFiniteNumber, tt as vectorIndexesShapeDetail, ua as markDeleteStarted, uc as refuseMalformedResourcesForDestroy, un as getCurrentNestedStackContext, ut as stripIndexContributorInsights, v as renderNestedTemplateTreeDefect, vr as REDACTED_DELETE_ADDRESS_SKIP_REASON, vt as resolveDynamoDbDeleteBudgetMs, wa as waitForLambdaFunctionActive, wc as findSdkUnwiredProperties, wd as decodeListingKey, wt as relayedIndexBusyDelete, xl as dynamicReferenceTokens, xr as redactedDeleteAddressSkip, xt as TABLE_INDEX_NOUN, yl as withoutPhysicalNameCopies, yr as isRedactedRecordedValue, yt as DELETE_INDEX_WAIT_PROCEED_NOTE, z as planStreamMemberOps, za as observeThenDisableInstanceApiTermination, zo as isUsableAttemptedName } from "./deploy-engine-CJ363Jh0.js";
|
|
7
|
+
import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-DvCw1Vlz.js";
|
|
8
8
|
import { u as ambientRegion } from "./aws-client-defaults-BayGUTJ4.js";
|
|
9
|
-
import { RDSProvider } from "./rds-provider-
|
|
10
|
-
import { n as modifyDbInstanceWhenAvailable, t as isModifyNotAvailableRefusal } from "./db-instance-modify-retry-
|
|
11
|
-
import { NeptuneProvider } from "./neptune-provider-
|
|
12
|
-
import { ASGProvider } from "./asg-provider-
|
|
9
|
+
import { RDSProvider } from "./rds-provider-B9nEPi0J.js";
|
|
10
|
+
import { n as modifyDbInstanceWhenAvailable, t as isModifyNotAvailableRefusal } from "./db-instance-modify-retry-sToRRDYL.js";
|
|
11
|
+
import { NeptuneProvider } from "./neptune-provider-BaG6dNvC.js";
|
|
12
|
+
import { ASGProvider } from "./asg-provider-CWB0lHRb.js";
|
|
13
13
|
import { createHash, randomUUID } from "node:crypto";
|
|
14
14
|
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";
|
|
15
15
|
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";
|
|
@@ -19,7 +19,7 @@ import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCo
|
|
|
19
19
|
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
20
20
|
import { AllocateAddressCommand, AssociateAddressCommand, AssociateIamInstanceProfileCommand, AssociateNatGatewayAddressCommand, AssociateRouteTableCommand, AssociateSubnetCidrBlockCommand, AttachInternetGatewayCommand, AttachVolumeCommand, AttachVpnGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAddressesCommand, DescribeAvailabilityZonesCommand, DescribeIamInstanceProfileAssociationsCommand, DescribeInstanceAttributeCommand, DescribeInstanceCreditSpecificationsCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupRulesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DescribeVpnGatewaysCommand, DetachInternetGatewayCommand, DetachVolumeCommand, DetachVpnGatewayCommand, DisassociateAddressCommand, DisassociateIamInstanceProfileCommand, DisassociateNatGatewayAddressCommand, DisassociateRouteTableCommand, DisassociateSubnetCidrBlockCommand, EC2Client, GetIpamPoolAllocationsCommand, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifyInstancePlacementCommand, ModifyPrivateDnsNameOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ModifyVpcTenancyCommand, MonitorInstancesCommand, ReleaseAddressCommand, ReplaceIamInstanceProfileAssociationCommand, ReplaceNetworkAclAssociationCommand, ReplaceNetworkAclEntryCommand, ReplaceRouteCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, StartInstancesCommand, StopInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
|
|
21
21
|
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";
|
|
22
|
-
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
|
+
import { APIGatewayClient, CreateAuthorizerCommand, CreateDeploymentCommand, CreateResourceCommand, CreateRestApiCommand, CreateStageCommand, DeleteAuthorizerCommand, DeleteDeploymentCommand, DeleteIntegrationCommand, DeleteIntegrationResponseCommand, DeleteMethodCommand, DeleteMethodResponseCommand, DeleteResourceCommand, DeleteRestApiCommand, DeleteStageCommand, GetAccountCommand, GetAuthorizerCommand, GetAuthorizersCommand, GetDeploymentCommand, GetDeploymentsCommand, GetMethodCommand, GetResourceCommand, GetRestApiCommand, GetRestApisCommand, GetStageCommand, ImportRestApiCommand, NotFoundException as NotFoundException$1, PutIntegrationCommand, PutIntegrationResponseCommand, PutMethodCommand, PutMethodResponseCommand, PutRestApiCommand, TagResourceCommand as TagResourceCommand$3, UntagResourceCommand as UntagResourceCommand$3, UpdateAccountCommand, UpdateAuthorizerCommand, UpdateDeploymentCommand, UpdateMethodCommand, UpdateRestApiCommand, UpdateStageCommand } from "@aws-sdk/client-api-gateway";
|
|
23
23
|
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";
|
|
24
24
|
import { CreateSecretCommand, DeleteSecretCommand, DescribeSecretCommand, RemoveRegionsFromReplicationCommand, ReplicateSecretToRegionsCommand, ResourceNotFoundException as ResourceNotFoundException$3, SecretsManagerClient, TagResourceCommand as TagResourceCommand$5, UntagResourceCommand as UntagResourceCommand$5, UpdateSecretCommand } from "@aws-sdk/client-secrets-manager";
|
|
25
25
|
import { AddTagsToResourceCommand, CreateAssociationCommand, DeleteAssociationCommand, DeleteParameterCommand, DescribeAssociationCommand, DescribeParametersCommand, GetParameterCommand, ListAssociationsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$2, ParameterNotFound, PutParameterCommand, RemoveTagsFromResourceCommand, SSMClient } from "@aws-sdk/client-ssm";
|
|
@@ -5779,7 +5779,7 @@ function canonicalizeDesiredProperties$3(resourceType, properties) {
|
|
|
5779
5779
|
function getDriftAbsentMeansDefaultKeys(_resourceType, properties) {
|
|
5780
5780
|
return [...abacStatusOf(properties) === "Disabled" ? ["AbacStatus"] : [], ...properties["MetadataConfiguration"] === void 0 ? ["MetadataConfiguration"] : []];
|
|
5781
5781
|
}
|
|
5782
|
-
function getDriftUnknownPaths$
|
|
5782
|
+
function getDriftUnknownPaths$12() {
|
|
5783
5783
|
return [
|
|
5784
5784
|
"BucketNamePrefix",
|
|
5785
5785
|
"BucketNamespace",
|
|
@@ -6605,7 +6605,7 @@ var S3BucketProvider = class {
|
|
|
6605
6605
|
return getDriftAbsentMeansDefaultKeys.call(this, _resourceType, properties);
|
|
6606
6606
|
}
|
|
6607
6607
|
getDriftUnknownPaths() {
|
|
6608
|
-
return getDriftUnknownPaths$
|
|
6608
|
+
return getDriftUnknownPaths$12.call(this);
|
|
6609
6609
|
}
|
|
6610
6610
|
readVersioning(bucket) {
|
|
6611
6611
|
return readVersioning.call(this, bucket);
|
|
@@ -14107,7 +14107,7 @@ function getDriftUnorderedPaths$7(resourceType) {
|
|
|
14107
14107
|
"VectorIndexes"
|
|
14108
14108
|
];
|
|
14109
14109
|
}
|
|
14110
|
-
function getDriftUnknownPaths$
|
|
14110
|
+
function getDriftUnknownPaths$11(resourceType, properties) {
|
|
14111
14111
|
if (resourceType !== "AWS::DynamoDB::Table") return [];
|
|
14112
14112
|
const paths = [];
|
|
14113
14113
|
if (!declaresWarmThroughput(properties)) paths.push("WarmThroughput");
|
|
@@ -15835,7 +15835,7 @@ var DynamoDBTableProvider = class {
|
|
|
15835
15835
|
return getDriftUnorderedPaths$7.call(this, resourceType);
|
|
15836
15836
|
}
|
|
15837
15837
|
getDriftUnknownPaths(resourceType, properties) {
|
|
15838
|
-
return getDriftUnknownPaths$
|
|
15838
|
+
return getDriftUnknownPaths$11.call(this, resourceType, properties);
|
|
15839
15839
|
}
|
|
15840
15840
|
canonicalizeDriftProperties(resourceType, properties) {
|
|
15841
15841
|
return canonicalizeDriftProperties$3.call(this, resourceType, properties);
|
|
@@ -24039,7 +24039,7 @@ async function readCurrentStateOnce(physicalId, logicalId, resourceType, propert
|
|
|
24039
24039
|
throw err;
|
|
24040
24040
|
}
|
|
24041
24041
|
}
|
|
24042
|
-
function getDriftUnknownPaths$
|
|
24042
|
+
function getDriftUnknownPaths$10(resourceType, properties) {
|
|
24043
24043
|
switch (resourceType) {
|
|
24044
24044
|
case "AWS::EC2::Instance": return [
|
|
24045
24045
|
"NetworkInterfaces",
|
|
@@ -24126,7 +24126,7 @@ const driftMethods = {
|
|
|
24126
24126
|
canonicalizeUnsettledProperties: canonicalizeUnsettledProperties$1,
|
|
24127
24127
|
readCurrentState: readCurrentState$29,
|
|
24128
24128
|
readCurrentStateOnce,
|
|
24129
|
-
getDriftUnknownPaths: getDriftUnknownPaths$
|
|
24129
|
+
getDriftUnknownPaths: getDriftUnknownPaths$10,
|
|
24130
24130
|
canonicalizeDesiredProperties: canonicalizeDesiredProperties$2
|
|
24131
24131
|
};
|
|
24132
24132
|
|
|
@@ -25168,8 +25168,10 @@ for (const methods of [
|
|
|
25168
25168
|
// src/provisioning/providers/apigateway/shared.ts
|
|
25169
25169
|
const createAuthorizerLatch$1 = new AmbiguousCreateLatch("apigateway:CreateAuthorizer");
|
|
25170
25170
|
const createDeploymentLatch = new AmbiguousCreateLatch("apigateway:CreateDeployment");
|
|
25171
|
+
const createRestApiLatch = new AmbiguousCreateLatch("apigateway:CreateRestApi");
|
|
25171
25172
|
const authorizersCreatedByThisProcess$1 = new RecentIdSet();
|
|
25172
25173
|
const deploymentsCreatedByThisProcess = new RecentIdSet();
|
|
25174
|
+
const restApisCreatedByThisProcess = new RecentIdSet();
|
|
25173
25175
|
const APIGW_METHOD_ID_FORMAT = {
|
|
25174
25176
|
label: "API Gateway Method",
|
|
25175
25177
|
segments: [
|
|
@@ -25512,6 +25514,7 @@ async function create$29(logicalId, resourceType, properties, context) {
|
|
|
25512
25514
|
case "AWS::ApiGateway::Deployment": return this.createDeployment(logicalId, resourceType, properties, log);
|
|
25513
25515
|
case "AWS::ApiGateway::Stage": return this.createStage(logicalId, resourceType, properties, stageSinks$1(this.logger, context, [[properties["StageName"], properties["StageName"]]]));
|
|
25514
25516
|
case "AWS::ApiGateway::Method": return this.createMethod(logicalId, resourceType, properties, log, context);
|
|
25517
|
+
case "AWS::ApiGateway::RestApi": return this.createRestApi(logicalId, resourceType, properties, log);
|
|
25515
25518
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId);
|
|
25516
25519
|
}
|
|
25517
25520
|
}
|
|
@@ -25526,6 +25529,7 @@ async function update$30(logicalId, physicalId, resourceType, properties, previo
|
|
|
25526
25529
|
case "AWS::ApiGateway::Deployment": return this.updateDeployment(logicalId, physicalId, resourceType, properties, previousProperties, log);
|
|
25527
25530
|
case "AWS::ApiGateway::Stage": return this.updateStage(logicalId, physicalId, resourceType, properties, previousProperties, stageSinks$1(this.logger, context, [[properties["StageName"], physicalId], [previousProperties["StageName"], physicalId]]));
|
|
25528
25531
|
case "AWS::ApiGateway::Method": return this.updateMethod(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
|
|
25532
|
+
case "AWS::ApiGateway::RestApi": return this.updateRestApi(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.changedProperties, context?.noEchoOnlyChangedProperties);
|
|
25529
25533
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
|
|
25530
25534
|
}
|
|
25531
25535
|
}
|
|
@@ -25541,6 +25545,7 @@ async function deleteImpl$29(logicalId, physicalId, resourceType, properties, co
|
|
|
25541
25545
|
case "AWS::ApiGateway::Deployment": return this.deleteDeployment(logicalId, physicalId, resourceType, properties, context);
|
|
25542
25546
|
case "AWS::ApiGateway::Stage": return this.deleteStage(logicalId, physicalId, resourceType, properties, context);
|
|
25543
25547
|
case "AWS::ApiGateway::Method": return this.deleteMethod(logicalId, physicalId, resourceType, context);
|
|
25548
|
+
case "AWS::ApiGateway::RestApi": return this.deleteRestApi(logicalId, physicalId, resourceType, context);
|
|
25544
25549
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
|
|
25545
25550
|
}
|
|
25546
25551
|
}
|
|
@@ -25552,6 +25557,7 @@ async function getAttribute$12(physicalId, resourceType, attributeName) {
|
|
|
25552
25557
|
case "AWS::ApiGateway::Deployment": return this.getDeploymentAttribute(physicalId, attributeName);
|
|
25553
25558
|
case "AWS::ApiGateway::Stage": return this.getStageAttribute(physicalId, attributeName);
|
|
25554
25559
|
case "AWS::ApiGateway::Method": return this.getMethodAttribute(physicalId, attributeName);
|
|
25560
|
+
case "AWS::ApiGateway::RestApi": return this.getRestApiAttribute(physicalId, attributeName);
|
|
25555
25561
|
default: return;
|
|
25556
25562
|
}
|
|
25557
25563
|
}
|
|
@@ -26526,8 +26532,502 @@ function getMethodAttribute(physicalId, attributeName) {
|
|
|
26526
26532
|
return Promise.resolve(void 0);
|
|
26527
26533
|
}
|
|
26528
26534
|
|
|
26535
|
+
// src/provisioning/providers/apigateway/rest-api.ts
|
|
26536
|
+
const BODY_KEYS = [
|
|
26537
|
+
"Body",
|
|
26538
|
+
"BodyS3Location",
|
|
26539
|
+
"Mode",
|
|
26540
|
+
"FailOnWarnings",
|
|
26541
|
+
"Parameters"
|
|
26542
|
+
];
|
|
26543
|
+
const SCALAR_FIELDS = [
|
|
26544
|
+
{
|
|
26545
|
+
key: "Name",
|
|
26546
|
+
path: "/name"
|
|
26547
|
+
},
|
|
26548
|
+
{
|
|
26549
|
+
key: "Description",
|
|
26550
|
+
path: "/description"
|
|
26551
|
+
},
|
|
26552
|
+
{
|
|
26553
|
+
key: "Version",
|
|
26554
|
+
path: "/version"
|
|
26555
|
+
},
|
|
26556
|
+
{
|
|
26557
|
+
key: "MinimumCompressionSize",
|
|
26558
|
+
path: "/minimumCompressionSize"
|
|
26559
|
+
},
|
|
26560
|
+
{
|
|
26561
|
+
key: "ApiKeySourceType",
|
|
26562
|
+
path: "/apiKeySource"
|
|
26563
|
+
},
|
|
26564
|
+
{
|
|
26565
|
+
key: "DisableExecuteApiEndpoint",
|
|
26566
|
+
path: "/disableExecuteApiEndpoint"
|
|
26567
|
+
},
|
|
26568
|
+
{
|
|
26569
|
+
key: "SecurityPolicy",
|
|
26570
|
+
path: "/securityPolicy"
|
|
26571
|
+
},
|
|
26572
|
+
{
|
|
26573
|
+
key: "EndpointAccessMode",
|
|
26574
|
+
path: "/endpointAccessMode"
|
|
26575
|
+
}
|
|
26576
|
+
];
|
|
26577
|
+
function pointerSegment(value) {
|
|
26578
|
+
return value.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
26579
|
+
}
|
|
26580
|
+
function stringList(value) {
|
|
26581
|
+
if (!Array.isArray(value)) return void 0;
|
|
26582
|
+
return value.filter((v) => typeof v === "string");
|
|
26583
|
+
}
|
|
26584
|
+
function asRecord$2(value) {
|
|
26585
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
26586
|
+
}
|
|
26587
|
+
function restApiPolicyString(policy) {
|
|
26588
|
+
if (policy === void 0 || policy === null) return void 0;
|
|
26589
|
+
return typeof policy === "string" ? policy : JSON.stringify(policy);
|
|
26590
|
+
}
|
|
26591
|
+
function parseRestApiPolicy(raw, restApiId, recorded) {
|
|
26592
|
+
if (raw === void 0 || raw === "") return void 0;
|
|
26593
|
+
let text = raw;
|
|
26594
|
+
let parsed;
|
|
26595
|
+
try {
|
|
26596
|
+
parsed = JSON.parse(text);
|
|
26597
|
+
} catch {
|
|
26598
|
+
text = raw.replace(/\\(["\\/])/g, "$1");
|
|
26599
|
+
try {
|
|
26600
|
+
parsed = JSON.parse(text);
|
|
26601
|
+
} catch {
|
|
26602
|
+
return raw;
|
|
26603
|
+
}
|
|
26604
|
+
}
|
|
26605
|
+
const recordedText = restApiPolicyString(recorded);
|
|
26606
|
+
if (recordedText !== void 0 && recordedText.includes("execute-api:/")) {
|
|
26607
|
+
const expanded = new RegExp(`arn:[a-z-]+:execute-api:[a-z0-9-]+:\\d{12}:${restApiId}/`, "g");
|
|
26608
|
+
parsed = JSON.parse(JSON.stringify(parsed).replace(expanded, "execute-api:/"));
|
|
26609
|
+
}
|
|
26610
|
+
return parsed;
|
|
26611
|
+
}
|
|
26612
|
+
function restApiAsCfn(api, recordedPolicy) {
|
|
26613
|
+
const out = {};
|
|
26614
|
+
if (api.name !== void 0) out["Name"] = api.name;
|
|
26615
|
+
if (api.description !== void 0) out["Description"] = api.description;
|
|
26616
|
+
if (api.version !== void 0) out["Version"] = api.version;
|
|
26617
|
+
out["BinaryMediaTypes"] = api.binaryMediaTypes ? [...api.binaryMediaTypes] : [];
|
|
26618
|
+
if (api.minimumCompressionSize !== void 0) out["MinimumCompressionSize"] = api.minimumCompressionSize;
|
|
26619
|
+
if (api.apiKeySource !== void 0) out["ApiKeySourceType"] = api.apiKeySource;
|
|
26620
|
+
if (api.disableExecuteApiEndpoint !== void 0) out["DisableExecuteApiEndpoint"] = api.disableExecuteApiEndpoint;
|
|
26621
|
+
const policy = parseRestApiPolicy(api.policy, api.id ?? "", recordedPolicy);
|
|
26622
|
+
if (policy !== void 0) out["Policy"] = policy;
|
|
26623
|
+
if (api.endpointConfiguration !== void 0) {
|
|
26624
|
+
const ec = {};
|
|
26625
|
+
if (api.endpointConfiguration.types !== void 0) ec["Types"] = [...api.endpointConfiguration.types];
|
|
26626
|
+
if (api.endpointConfiguration.vpcEndpointIds !== void 0) ec["VpcEndpointIds"] = [...api.endpointConfiguration.vpcEndpointIds];
|
|
26627
|
+
if (api.endpointConfiguration.ipAddressType !== void 0) ec["IpAddressType"] = api.endpointConfiguration.ipAddressType;
|
|
26628
|
+
out["EndpointConfiguration"] = ec;
|
|
26629
|
+
}
|
|
26630
|
+
if (api.securityPolicy !== void 0) out["SecurityPolicy"] = api.securityPolicy;
|
|
26631
|
+
if (api.endpointAccessMode !== void 0) out["EndpointAccessMode"] = api.endpointAccessMode;
|
|
26632
|
+
return out;
|
|
26633
|
+
}
|
|
26634
|
+
function definitionBinaryMediaTypes(body) {
|
|
26635
|
+
let definition = body;
|
|
26636
|
+
if (typeof body === "string") try {
|
|
26637
|
+
definition = JSON.parse(body);
|
|
26638
|
+
} catch {
|
|
26639
|
+
return /* @__PURE__ */ new Set();
|
|
26640
|
+
}
|
|
26641
|
+
return new Set(stringList(asRecord$2(definition)?.["x-amazon-apigateway-binary-media-types"]) ?? []);
|
|
26642
|
+
}
|
|
26643
|
+
function isJsonText(text) {
|
|
26644
|
+
try {
|
|
26645
|
+
JSON.parse(text);
|
|
26646
|
+
return true;
|
|
26647
|
+
} catch {
|
|
26648
|
+
return false;
|
|
26649
|
+
}
|
|
26650
|
+
}
|
|
26651
|
+
function endpointType(config) {
|
|
26652
|
+
return stringList(asRecord$2(config)?.["Types"])?.[0];
|
|
26653
|
+
}
|
|
26654
|
+
function restApiPatchOperations(desired, current, previous, bodyPutMode) {
|
|
26655
|
+
const ops = [];
|
|
26656
|
+
for (const { key, path } of SCALAR_FIELDS) {
|
|
26657
|
+
const next = desired[key];
|
|
26658
|
+
if (next === void 0 || next === null) continue;
|
|
26659
|
+
const value = stringifyValue(next);
|
|
26660
|
+
if (value !== (current[key] == null ? "" : stringifyValue(current[key]))) ops.push({
|
|
26661
|
+
op: "replace",
|
|
26662
|
+
path,
|
|
26663
|
+
value
|
|
26664
|
+
});
|
|
26665
|
+
}
|
|
26666
|
+
const nextPolicy = restApiPolicyString(desired["Policy"]);
|
|
26667
|
+
if (nextPolicy !== void 0 && nextPolicy !== restApiPolicyString(current["Policy"])) ops.push({
|
|
26668
|
+
op: "replace",
|
|
26669
|
+
path: "/policy",
|
|
26670
|
+
value: nextPolicy
|
|
26671
|
+
});
|
|
26672
|
+
const targetTypes = stringList(desired["BinaryMediaTypes"]) ?? (previous["BinaryMediaTypes"] !== void 0 ? [] : void 0);
|
|
26673
|
+
if (targetTypes !== void 0) {
|
|
26674
|
+
const live = new Set(stringList(current["BinaryMediaTypes"]) ?? []);
|
|
26675
|
+
const target = new Set(targetTypes);
|
|
26676
|
+
const fromDefinition = definitionBinaryMediaTypes(desired["Body"]);
|
|
26677
|
+
const dropped = bodyPutMode === "overwrite" ? [] : stringList(previous["BinaryMediaTypes"]) ?? [];
|
|
26678
|
+
for (const t of new Set(dropped)) if (live.has(t) && !target.has(t) && !fromDefinition.has(t)) ops.push({
|
|
26679
|
+
op: "remove",
|
|
26680
|
+
path: `/binaryMediaTypes/${pointerSegment(t)}`
|
|
26681
|
+
});
|
|
26682
|
+
for (const t of target) if (!live.has(t)) ops.push({
|
|
26683
|
+
op: "add",
|
|
26684
|
+
path: `/binaryMediaTypes/${pointerSegment(t)}`
|
|
26685
|
+
});
|
|
26686
|
+
}
|
|
26687
|
+
const desiredEc = asRecord$2(desired["EndpointConfiguration"]);
|
|
26688
|
+
const currentEc = asRecord$2(current["EndpointConfiguration"]);
|
|
26689
|
+
const targetType = endpointType(desiredEc) ?? (previous["EndpointConfiguration"] !== void 0 ? "EDGE" : void 0);
|
|
26690
|
+
const currentType = endpointType(currentEc) ?? "EDGE";
|
|
26691
|
+
if (targetType !== void 0 && targetType !== currentType) ops.push({
|
|
26692
|
+
op: "replace",
|
|
26693
|
+
path: `/endpointConfiguration/types/${currentType}`,
|
|
26694
|
+
value: targetType
|
|
26695
|
+
});
|
|
26696
|
+
if (desiredEc !== void 0) {
|
|
26697
|
+
const nextIds = stringList(desiredEc["VpcEndpointIds"]);
|
|
26698
|
+
if (nextIds !== void 0 || targetType === "PRIVATE") {
|
|
26699
|
+
const live = new Set(stringList(currentEc?.["VpcEndpointIds"]) ?? []);
|
|
26700
|
+
const target = new Set(nextIds ?? []);
|
|
26701
|
+
for (const id of target) if (!live.has(id)) ops.push({
|
|
26702
|
+
op: "add",
|
|
26703
|
+
path: "/endpointConfiguration/vpcEndpointIds",
|
|
26704
|
+
value: id
|
|
26705
|
+
});
|
|
26706
|
+
for (const id of live) if (!target.has(id)) ops.push({
|
|
26707
|
+
op: "remove",
|
|
26708
|
+
path: "/endpointConfiguration/vpcEndpointIds",
|
|
26709
|
+
value: id
|
|
26710
|
+
});
|
|
26711
|
+
}
|
|
26712
|
+
const ipType = desiredEc["IpAddressType"];
|
|
26713
|
+
if (typeof ipType === "string" && ipType !== currentEc?.["IpAddressType"]) ops.push({
|
|
26714
|
+
op: "replace",
|
|
26715
|
+
path: "/endpointConfiguration/ipAddressType",
|
|
26716
|
+
value: ipType
|
|
26717
|
+
});
|
|
26718
|
+
}
|
|
26719
|
+
return ops;
|
|
26720
|
+
}
|
|
26721
|
+
function declaresBody(properties) {
|
|
26722
|
+
return properties["Body"] != null || properties["BodyS3Location"] != null;
|
|
26723
|
+
}
|
|
26724
|
+
function restApiBodyChanged(desired, previous, maskSecrets) {
|
|
26725
|
+
if (!declaresBody(desired)) return false;
|
|
26726
|
+
return BODY_KEYS.some((key) => !isDeepStrictEqual(desired[key], previous[key]) && !onlySecretReferencesDiffer(desired[key], previous[key], maskSecrets));
|
|
26727
|
+
}
|
|
26728
|
+
function definitionTitle(body) {
|
|
26729
|
+
try {
|
|
26730
|
+
const info = asRecord$2(asRecord$2(JSON.parse(new TextDecoder().decode(body)))?.["info"]);
|
|
26731
|
+
return typeof info?.["title"] === "string" ? info["title"] : void 0;
|
|
26732
|
+
} catch {
|
|
26733
|
+
return;
|
|
26734
|
+
}
|
|
26735
|
+
}
|
|
26736
|
+
function bodyParameters(value) {
|
|
26737
|
+
const record = asRecord$2(value);
|
|
26738
|
+
if (record === void 0) return void 0;
|
|
26739
|
+
return Object.fromEntries(Object.entries(record).map(([k, v]) => [k, String(v)]));
|
|
26740
|
+
}
|
|
26741
|
+
async function resolveRestApiBody(logicalId, resourceType, properties, mask, physicalId) {
|
|
26742
|
+
const body = properties["Body"];
|
|
26743
|
+
if (body !== void 0 && body !== null) {
|
|
26744
|
+
if (typeof body === "string") return new TextEncoder().encode(body);
|
|
26745
|
+
if (typeof body === "object") return new TextEncoder().encode(JSON.stringify(body));
|
|
26746
|
+
throw new ProvisioningError(`Body of ${resourceType} ${logicalId} must be an OpenAPI definition object or string`, resourceType, logicalId, physicalId);
|
|
26747
|
+
}
|
|
26748
|
+
const location = asRecord$2(properties["BodyS3Location"]);
|
|
26749
|
+
if (properties["BodyS3Location"] == null) return void 0;
|
|
26750
|
+
const bucket = location?.["Bucket"];
|
|
26751
|
+
const key = location?.["Key"];
|
|
26752
|
+
if (typeof bucket !== "string" || typeof key !== "string" || !bucket || !key) throw new ProvisioningError(`BodyS3Location of ${resourceType} ${logicalId} must name a Bucket and a Key`, resourceType, logicalId, physicalId);
|
|
26753
|
+
const version = location?.["Version"];
|
|
26754
|
+
const etag = location?.["ETag"];
|
|
26755
|
+
const resp = await getAwsClients().s3.send(new GetObjectCommand({
|
|
26756
|
+
Bucket: bucket,
|
|
26757
|
+
Key: key,
|
|
26758
|
+
...typeof version === "string" && version && { VersionId: version },
|
|
26759
|
+
...typeof etag === "string" && etag && { IfMatch: etag }
|
|
26760
|
+
}));
|
|
26761
|
+
const bytes = resp.Body ? await resp.Body.transformToByteArray() : void 0;
|
|
26762
|
+
if (!bytes || bytes.length === 0) throw new ProvisioningError(`BodyS3Location of ${resourceType} ${logicalId} (s3://${mask(bucket)}/${mask(key)}) holds no definition`, resourceType, logicalId, physicalId);
|
|
26763
|
+
return bytes;
|
|
26764
|
+
}
|
|
26765
|
+
async function restApiArn(restApiId) {
|
|
26766
|
+
const region = await this.apiGatewayClient.config.region();
|
|
26767
|
+
const { partition } = derivePartitionAndUrlSuffix(region);
|
|
26768
|
+
return `arn:${partition}:apigateway:${region}::/restapis/${restApiId}`;
|
|
26769
|
+
}
|
|
26770
|
+
async function createRestApi(logicalId, resourceType, properties, log) {
|
|
26771
|
+
log.debug(safeMsg`Creating API Gateway RestApi ${logicalId}`);
|
|
26772
|
+
const name = typeof properties["Name"] === "string" ? properties["Name"] : void 0;
|
|
26773
|
+
const cloneFrom = typeof properties["CloneFrom"] === "string" ? properties["CloneFrom"] : void 0;
|
|
26774
|
+
const hasBody = declaresBody(properties);
|
|
26775
|
+
if (!name && (!hasBody || cloneFrom)) throw new ProvisioningError(`Name is required for API Gateway RestApi ${logicalId} unless Body or BodyS3Location defines the API`, resourceType, logicalId);
|
|
26776
|
+
const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
|
|
26777
|
+
let restApiId;
|
|
26778
|
+
try {
|
|
26779
|
+
const body = await resolveRestApiBody.call(this, logicalId, resourceType, properties, log.value);
|
|
26780
|
+
const createdName = body && !cloneFrom ? definitionTitle(body) : name;
|
|
26781
|
+
const desiredEc = asRecord$2(properties["EndpointConfiguration"]);
|
|
26782
|
+
const reportOrphans = async (lookupWindow) => {
|
|
26783
|
+
const aws = pasteableAwsCommand(log.mask);
|
|
26784
|
+
const regionArg = await this.orphanCommandRegionArg(aws);
|
|
26785
|
+
await reportPossibleOrphans(logicalId, lookupWindow, log, {
|
|
26786
|
+
action: body && !cloneFrom ? "ImportRestApi" : "CreateRestApi",
|
|
26787
|
+
listAction: "GetRestApis",
|
|
26788
|
+
subject: createdName ? `a REST API named ${log.value(createdName)}` : "a REST API",
|
|
26789
|
+
noun: "REST API(s)",
|
|
26790
|
+
...createdName === void 0 && { afterward: "The definition is not JSON, so its title could not be read: every REST API created in that window is listed, which can include another deploy or process. Creating a new one now." },
|
|
26791
|
+
list: () => collectOrphanIds(async (position) => {
|
|
26792
|
+
const page = await this.apiGatewayClient.send(new GetRestApisCommand({
|
|
26793
|
+
limit: 500,
|
|
26794
|
+
...position && { position }
|
|
26795
|
+
}));
|
|
26796
|
+
return {
|
|
26797
|
+
items: page.items ?? [],
|
|
26798
|
+
next: page.position
|
|
26799
|
+
};
|
|
26800
|
+
}, (a) => a.id && (createdName === void 0 || a.name === createdName) && isInsideWindow(a.createdDate, lookupWindow) && !restApisCreatedByThisProcess.has(a.id) ? a.id : void 0),
|
|
26801
|
+
inspect: (id) => aws`aws apigateway get-rest-api --rest-api-id ${id}${regionArg}`.render(),
|
|
26802
|
+
remove: (id) => aws`aws apigateway delete-rest-api --rest-api-id ${id}${regionArg}`.render()
|
|
26803
|
+
});
|
|
26804
|
+
};
|
|
26805
|
+
const orphanWindow = createRestApiLatch.take(logicalId);
|
|
26806
|
+
if (orphanWindow !== void 0) await reportOrphans(orphanWindow);
|
|
26807
|
+
const createClient = await this.getCreateClient();
|
|
26808
|
+
const attemptStartMs = Date.now();
|
|
26809
|
+
let response;
|
|
26810
|
+
try {
|
|
26811
|
+
if (body && !cloneFrom) {
|
|
26812
|
+
const parameters = bodyParameters(properties["Parameters"]) ?? {};
|
|
26813
|
+
const type = endpointType(desiredEc);
|
|
26814
|
+
if (type !== void 0 && parameters["endpointConfigurationTypes"] === void 0) parameters["endpointConfigurationTypes"] = type;
|
|
26815
|
+
response = await createClient.send(new ImportRestApiCommand({
|
|
26816
|
+
body,
|
|
26817
|
+
failOnWarnings: properties["FailOnWarnings"] === true,
|
|
26818
|
+
...Object.keys(parameters).length > 0 && { parameters }
|
|
26819
|
+
}));
|
|
26820
|
+
} else response = await createClient.send(new CreateRestApiCommand({
|
|
26821
|
+
name,
|
|
26822
|
+
description: properties["Description"],
|
|
26823
|
+
version: properties["Version"],
|
|
26824
|
+
cloneFrom,
|
|
26825
|
+
binaryMediaTypes: stringList(properties["BinaryMediaTypes"]),
|
|
26826
|
+
minimumCompressionSize: properties["MinimumCompressionSize"],
|
|
26827
|
+
apiKeySource: properties["ApiKeySourceType"],
|
|
26828
|
+
endpointConfiguration: desiredEc ? {
|
|
26829
|
+
types: stringList(desiredEc["Types"]),
|
|
26830
|
+
vpcEndpointIds: stringList(desiredEc["VpcEndpointIds"]),
|
|
26831
|
+
ipAddressType: desiredEc["IpAddressType"]
|
|
26832
|
+
} : void 0,
|
|
26833
|
+
policy: restApiPolicyString(properties["Policy"]),
|
|
26834
|
+
tags: tags.length > 0 ? Object.fromEntries(tags.map((t) => [t.Key, t.Value])) : void 0,
|
|
26835
|
+
disableExecuteApiEndpoint: properties["DisableExecuteApiEndpoint"],
|
|
26836
|
+
securityPolicy: properties["SecurityPolicy"],
|
|
26837
|
+
endpointAccessMode: properties["EndpointAccessMode"]
|
|
26838
|
+
}));
|
|
26839
|
+
} catch (error) {
|
|
26840
|
+
createRestApiLatch.noteFailure(logicalId, error, attemptStartMs, orphanWindow);
|
|
26841
|
+
throw error;
|
|
26842
|
+
}
|
|
26843
|
+
if (!response.id) throw new ProvisioningError(`API Gateway answered no id for RestApi ${logicalId}`, resourceType, logicalId);
|
|
26844
|
+
restApiId = response.id;
|
|
26845
|
+
restApisCreatedByThisProcess.add(restApiId);
|
|
26846
|
+
const replayWindow = replayedSendWindow(response, attemptStartMs);
|
|
26847
|
+
if (replayWindow !== void 0) await reportOrphans(replayWindow);
|
|
26848
|
+
let rootResourceId = response.rootResourceId;
|
|
26849
|
+
if (body) {
|
|
26850
|
+
let live = restApiAsCfn(response, properties["Policy"]);
|
|
26851
|
+
if (cloneFrom) {
|
|
26852
|
+
const put = await this.apiGatewayClient.send(new PutRestApiCommand({
|
|
26853
|
+
restApiId,
|
|
26854
|
+
mode: properties["Mode"] ?? "overwrite",
|
|
26855
|
+
failOnWarnings: properties["FailOnWarnings"] === true,
|
|
26856
|
+
parameters: bodyParameters(properties["Parameters"]),
|
|
26857
|
+
body
|
|
26858
|
+
}));
|
|
26859
|
+
live = restApiAsCfn(put, properties["Policy"]);
|
|
26860
|
+
rootResourceId = put.rootResourceId ?? rootResourceId;
|
|
26861
|
+
}
|
|
26862
|
+
const patchOperations = restApiPatchOperations(properties, live, {}, cloneFrom ? properties["Mode"] ?? "overwrite" : "overwrite");
|
|
26863
|
+
if (patchOperations.length > 0) await this.apiGatewayClient.send(new UpdateRestApiCommand({
|
|
26864
|
+
restApiId,
|
|
26865
|
+
patchOperations
|
|
26866
|
+
}));
|
|
26867
|
+
if (tags.length > 0 && !cloneFrom) await this.apiGatewayClient.send(new TagResourceCommand$3({
|
|
26868
|
+
resourceArn: await restApiArn.call(this, restApiId),
|
|
26869
|
+
tags: Object.fromEntries(tags.map((t) => [t.Key, t.Value]))
|
|
26870
|
+
}));
|
|
26871
|
+
}
|
|
26872
|
+
if (rootResourceId === void 0) rootResourceId = (await this.apiGatewayClient.send(new GetRestApiCommand({ restApiId }))).rootResourceId;
|
|
26873
|
+
log.debug(safeMsg`Successfully created API Gateway RestApi ${logicalId}: ${restApiId}`);
|
|
26874
|
+
return {
|
|
26875
|
+
physicalId: restApiId,
|
|
26876
|
+
attributes: {
|
|
26877
|
+
RestApiId: restApiId,
|
|
26878
|
+
...rootResourceId !== void 0 ? { RootResourceId: rootResourceId } : {}
|
|
26879
|
+
}
|
|
26880
|
+
};
|
|
26881
|
+
} catch (error) {
|
|
26882
|
+
if (error instanceof CdkdError && restApiId === void 0) throw error;
|
|
26883
|
+
const cause = error instanceof Error ? error : void 0;
|
|
26884
|
+
const survivor = restApiId === void 0 ? "" : await retireFailedRestApi.call(this, restApiId, log);
|
|
26885
|
+
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to create API Gateway RestApi ${logicalId}: ${text}${survivor}`, resourceType, logicalId, void 0, cause));
|
|
26886
|
+
}
|
|
26887
|
+
}
|
|
26888
|
+
async function retireFailedRestApi(restApiId, log) {
|
|
26889
|
+
try {
|
|
26890
|
+
await this.apiGatewayClient.send(new DeleteRestApiCommand({ restApiId }));
|
|
26891
|
+
log.debug(safeMsg`Deleted REST API ${restApiId} left by the failed create`);
|
|
26892
|
+
return "";
|
|
26893
|
+
} catch (cleanupError) {
|
|
26894
|
+
if (cleanupError instanceof NotFoundException$1) return "";
|
|
26895
|
+
const aws = pasteableAwsCommand(log.mask);
|
|
26896
|
+
const regionArg = await this.orphanCommandRegionArg(aws);
|
|
26897
|
+
return ` The REST API ${restApiId} it created could not be deleted (${describeAwsFailure(cleanupError).summary}); delete it with: ` + aws`aws apigateway delete-rest-api --rest-api-id ${restApiId}${regionArg}`.render();
|
|
26898
|
+
}
|
|
26899
|
+
}
|
|
26900
|
+
async function updateRestApi(logicalId, physicalId, resourceType, properties, previousProperties, log, changedProperties, noEchoOnlyChanged) {
|
|
26901
|
+
refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
|
|
26902
|
+
try {
|
|
26903
|
+
let current = previousProperties;
|
|
26904
|
+
let bodyPutMode;
|
|
26905
|
+
let rootResourceId;
|
|
26906
|
+
let bodyChanged = changedProperties !== void 0 ? declaresBody(properties) && BODY_KEYS.some((key) => changedProperties.has(key)) : restApiBodyChanged(properties, previousProperties, log.mask);
|
|
26907
|
+
if (bodyChanged && changedProperties !== void 0 && noEchoOnlyChanged !== void 0) {
|
|
26908
|
+
const named = BODY_KEYS.filter((key) => changedProperties.has(key));
|
|
26909
|
+
if (named.length > 0 && named.every((key) => noEchoOnlyChanged.has(key))) {
|
|
26910
|
+
bodyChanged = false;
|
|
26911
|
+
log.warn(safeMsg`${logicalId} (${resourceType}): its Body embeds a NoEcho parameter value, which cdkd records only as *** and cannot compare, so the OpenAPI definition is not put again. A change to that value alone is NOT applied. To apply one, change a part of the Body that is not masked (its description or a version field, for example) in the same deploy.`);
|
|
26912
|
+
}
|
|
26913
|
+
}
|
|
26914
|
+
if (bodyChanged) {
|
|
26915
|
+
const body = await resolveRestApiBody.call(this, logicalId, resourceType, properties, log.value, physicalId);
|
|
26916
|
+
const put = await this.apiGatewayClient.send(new PutRestApiCommand({
|
|
26917
|
+
restApiId: physicalId,
|
|
26918
|
+
mode: properties["Mode"] ?? "overwrite",
|
|
26919
|
+
failOnWarnings: properties["FailOnWarnings"] === true,
|
|
26920
|
+
parameters: bodyParameters(properties["Parameters"]),
|
|
26921
|
+
body
|
|
26922
|
+
}));
|
|
26923
|
+
log.debug(safeMsg`Put the OpenAPI definition of API Gateway RestApi ${logicalId}: ${physicalId}`);
|
|
26924
|
+
current = restApiAsCfn(put, properties["Policy"]);
|
|
26925
|
+
bodyPutMode = properties["Mode"] ?? "overwrite";
|
|
26926
|
+
rootResourceId = put.rootResourceId;
|
|
26927
|
+
}
|
|
26928
|
+
const patchOperations = restApiPatchOperations(properties, current, previousProperties, bodyPutMode);
|
|
26929
|
+
if (patchOperations.length > 0) {
|
|
26930
|
+
await this.apiGatewayClient.send(new UpdateRestApiCommand({
|
|
26931
|
+
restApiId: physicalId,
|
|
26932
|
+
patchOperations
|
|
26933
|
+
}));
|
|
26934
|
+
log.debug(safeMsg`Updated API Gateway RestApi ${logicalId} (${patchOperations.length} patch ops)`);
|
|
26935
|
+
}
|
|
26936
|
+
const arn = await restApiArn.call(this, physicalId);
|
|
26937
|
+
await this.applyTagDiff(arn, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], log, arn);
|
|
26938
|
+
return {
|
|
26939
|
+
physicalId,
|
|
26940
|
+
wasReplaced: false,
|
|
26941
|
+
...rootResourceId !== void 0 ? { attributes: {
|
|
26942
|
+
RestApiId: physicalId,
|
|
26943
|
+
RootResourceId: rootResourceId
|
|
26944
|
+
} } : {}
|
|
26945
|
+
};
|
|
26946
|
+
} catch (error) {
|
|
26947
|
+
if (error instanceof CdkdError) throw error;
|
|
26948
|
+
const cause = error instanceof Error ? error : void 0;
|
|
26949
|
+
throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to update API Gateway RestApi ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
26950
|
+
}
|
|
26951
|
+
}
|
|
26952
|
+
async function deleteRestApi(logicalId, physicalId, resourceType, context) {
|
|
26953
|
+
this.logger.debug(safeMsg`Deleting API Gateway RestApi ${logicalId}: ${physicalId}`);
|
|
26954
|
+
try {
|
|
26955
|
+
await this.apiGatewayClient.send(new DeleteRestApiCommand({ restApiId: physicalId }));
|
|
26956
|
+
this.logger.debug(safeMsg`Successfully deleted API Gateway RestApi ${logicalId}`);
|
|
26957
|
+
} catch (error) {
|
|
26958
|
+
if (error instanceof NotFoundException$1) {
|
|
26959
|
+
const clientRegion = await this.apiGatewayClient.config.region();
|
|
26960
|
+
assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
26961
|
+
this.logger.debug(safeMsg`API Gateway RestApi ${physicalId} does not exist, skipping deletion`);
|
|
26962
|
+
return;
|
|
26963
|
+
}
|
|
26964
|
+
const cause = error instanceof Error ? error : void 0;
|
|
26965
|
+
const thrown = this.wrapMaskedError(context?.maskSecrets ?? ((text) => text), error, (text) => new ProvisioningError(`Failed to delete API Gateway RestApi ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
26966
|
+
throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
|
|
26967
|
+
}
|
|
26968
|
+
}
|
|
26969
|
+
async function getRestApiAttribute(physicalId, attributeName) {
|
|
26970
|
+
if (attributeName === "RestApiId") return physicalId;
|
|
26971
|
+
if (attributeName === "RootResourceId") return (await this.apiGatewayClient.send(new GetRestApiCommand({ restApiId: physicalId }))).rootResourceId;
|
|
26972
|
+
}
|
|
26973
|
+
async function readCurrentStateRestApi(physicalId, properties) {
|
|
26974
|
+
try {
|
|
26975
|
+
const resp = await this.apiGatewayClient.send(new GetRestApiCommand({ restApiId: physicalId }));
|
|
26976
|
+
const result = restApiAsCfn(resp, properties?.["Policy"]);
|
|
26977
|
+
const fromDefinition = definitionBinaryMediaTypes(properties?.["Body"]);
|
|
26978
|
+
const declared = new Set(stringList(properties?.["BinaryMediaTypes"]) ?? []);
|
|
26979
|
+
const unreadable = properties?.["BodyS3Location"] != null || typeof properties?.["Body"] === "string" && !isJsonText(properties["Body"]);
|
|
26980
|
+
result["BinaryMediaTypes"] = result["BinaryMediaTypes"].filter((t) => unreadable ? declared.has(t) : !fromDefinition.has(t) || declared.has(t));
|
|
26981
|
+
result["Tags"] = Object.entries(resp.tags ?? {}).filter(([key]) => !key.startsWith("aws:")).map(([Key, Value]) => ({
|
|
26982
|
+
Key,
|
|
26983
|
+
Value
|
|
26984
|
+
}));
|
|
26985
|
+
return result;
|
|
26986
|
+
} catch (err) {
|
|
26987
|
+
if (err instanceof NotFoundException$1) return RESOURCE_NOT_FOUND;
|
|
26988
|
+
throw err;
|
|
26989
|
+
}
|
|
26990
|
+
}
|
|
26991
|
+
const REST_API_WRITE_ONLY_PATHS = [
|
|
26992
|
+
"Body",
|
|
26993
|
+
"BodyS3Location",
|
|
26994
|
+
"CloneFrom",
|
|
26995
|
+
"FailOnWarnings",
|
|
26996
|
+
"Mode",
|
|
26997
|
+
"Parameters"
|
|
26998
|
+
];
|
|
26999
|
+
async function importRestApi(input) {
|
|
27000
|
+
if (!input.knownPhysicalId) return null;
|
|
27001
|
+
try {
|
|
27002
|
+
const resp = await this.apiGatewayClient.send(new GetRestApiCommand({ restApiId: input.knownPhysicalId }));
|
|
27003
|
+
return {
|
|
27004
|
+
physicalId: input.knownPhysicalId,
|
|
27005
|
+
attributes: {
|
|
27006
|
+
RestApiId: input.knownPhysicalId,
|
|
27007
|
+
...resp.rootResourceId !== void 0 ? { RootResourceId: resp.rootResourceId } : {}
|
|
27008
|
+
}
|
|
27009
|
+
};
|
|
27010
|
+
} catch (err) {
|
|
27011
|
+
if (err instanceof NotFoundException$1) return null;
|
|
27012
|
+
throw err;
|
|
27013
|
+
}
|
|
27014
|
+
}
|
|
27015
|
+
|
|
26529
27016
|
// src/provisioning/providers/apigateway/read-state.ts
|
|
26530
27017
|
function canonicalizeDriftProperties$2(resourceType, properties) {
|
|
27018
|
+
if (resourceType === "AWS::ApiGateway::RestApi") {
|
|
27019
|
+
const key = "Policy";
|
|
27020
|
+
const policy = properties[key];
|
|
27021
|
+
if (typeof policy !== "string") return properties;
|
|
27022
|
+
try {
|
|
27023
|
+
return {
|
|
27024
|
+
...properties,
|
|
27025
|
+
[key]: JSON.parse(policy)
|
|
27026
|
+
};
|
|
27027
|
+
} catch {
|
|
27028
|
+
return properties;
|
|
27029
|
+
}
|
|
27030
|
+
}
|
|
26531
27031
|
if (resourceType !== "AWS::ApiGateway::Method") return properties;
|
|
26532
27032
|
const scopes = properties["AuthorizationScopes"];
|
|
26533
27033
|
if (!Array.isArray(scopes) || new Set(scopes).size === scopes.length) return properties;
|
|
@@ -26536,9 +27036,13 @@ function canonicalizeDriftProperties$2(resourceType, properties) {
|
|
|
26536
27036
|
AuthorizationScopes: [...new Set(scopes)]
|
|
26537
27037
|
};
|
|
26538
27038
|
}
|
|
27039
|
+
function getDriftUnknownPaths$9(resourceType) {
|
|
27040
|
+
return resourceType === "AWS::ApiGateway::RestApi" ? [...REST_API_WRITE_ONLY_PATHS] : [];
|
|
27041
|
+
}
|
|
26539
27042
|
function getDriftUnorderedPaths$6(resourceType) {
|
|
26540
27043
|
if (resourceType === "AWS::ApiGateway::Authorizer") return ["ProviderARNs"];
|
|
26541
27044
|
if (resourceType === "AWS::ApiGateway::Method") return ["AuthorizationScopes"];
|
|
27045
|
+
if (resourceType === "AWS::ApiGateway::RestApi") return ["BinaryMediaTypes"];
|
|
26542
27046
|
return [];
|
|
26543
27047
|
}
|
|
26544
27048
|
async function readCurrentState$28(physicalId, _logicalId, resourceType, properties) {
|
|
@@ -26549,6 +27053,7 @@ async function readCurrentState$28(physicalId, _logicalId, resourceType, propert
|
|
|
26549
27053
|
case "AWS::ApiGateway::Resource": return this.readCurrentStateResource(physicalId, properties);
|
|
26550
27054
|
case "AWS::ApiGateway::Deployment": return this.readCurrentStateDeployment(physicalId, properties);
|
|
26551
27055
|
case "AWS::ApiGateway::Stage": return this.readCurrentStateStage(physicalId, properties);
|
|
27056
|
+
case "AWS::ApiGateway::RestApi": return this.readCurrentStateRestApi(physicalId, properties);
|
|
26552
27057
|
default: return;
|
|
26553
27058
|
}
|
|
26554
27059
|
}
|
|
@@ -26694,6 +27199,7 @@ async function readCurrentStateMethod(physicalId) {
|
|
|
26694
27199
|
}
|
|
26695
27200
|
}
|
|
26696
27201
|
async function importImpl$30(input) {
|
|
27202
|
+
if (input.resourceType === "AWS::ApiGateway::RestApi") return await this.importRestApi(input);
|
|
26697
27203
|
if (input.knownPhysicalId) {
|
|
26698
27204
|
if (input.resourceType === "AWS::ApiGateway::Resource" && input.knownPhysicalId.includes("|")) {
|
|
26699
27205
|
this.logger.warn(`AWS::ApiGateway::Resource ${input.logicalId}: '${input.knownPhysicalId}' looks like a composite, but cdkd stores a BARE resourceId for this type (the parent RestApiId comes from the template). Adopting it would send the whole string to the API as a resource id, and the delete path would then report success on the NotFound. Pass just the resourceId.`);
|
|
@@ -26761,6 +27267,26 @@ var ApiGatewayProvider = class {
|
|
|
26761
27267
|
"AuthorizationScopes",
|
|
26762
27268
|
"Integration",
|
|
26763
27269
|
"MethodResponses"
|
|
27270
|
+
])],
|
|
27271
|
+
["AWS::ApiGateway::RestApi", /* @__PURE__ */ new Set([
|
|
27272
|
+
"Name",
|
|
27273
|
+
"Description",
|
|
27274
|
+
"Version",
|
|
27275
|
+
"Body",
|
|
27276
|
+
"BodyS3Location",
|
|
27277
|
+
"Mode",
|
|
27278
|
+
"FailOnWarnings",
|
|
27279
|
+
"Parameters",
|
|
27280
|
+
"CloneFrom",
|
|
27281
|
+
"Policy",
|
|
27282
|
+
"EndpointConfiguration",
|
|
27283
|
+
"BinaryMediaTypes",
|
|
27284
|
+
"MinimumCompressionSize",
|
|
27285
|
+
"ApiKeySourceType",
|
|
27286
|
+
"DisableExecuteApiEndpoint",
|
|
27287
|
+
"SecurityPolicy",
|
|
27288
|
+
"EndpointAccessMode",
|
|
27289
|
+
"Tags"
|
|
26764
27290
|
])]
|
|
26765
27291
|
]);
|
|
26766
27292
|
unhandledByDesign = /* @__PURE__ */ new Map([["AWS::ApiGateway::Deployment", /* @__PURE__ */ new Map([
|
|
@@ -26872,6 +27398,24 @@ var ApiGatewayProvider = class {
|
|
|
26872
27398
|
getMethodAttribute(physicalId, attributeName) {
|
|
26873
27399
|
return getMethodAttribute.call(this, physicalId, attributeName);
|
|
26874
27400
|
}
|
|
27401
|
+
createRestApi(logicalId, resourceType, properties, log) {
|
|
27402
|
+
return createRestApi.call(this, logicalId, resourceType, properties, log);
|
|
27403
|
+
}
|
|
27404
|
+
updateRestApi(logicalId, physicalId, resourceType, properties, previousProperties, log, changedProperties, noEchoOnlyChanged) {
|
|
27405
|
+
return updateRestApi.call(this, logicalId, physicalId, resourceType, properties, previousProperties, log, changedProperties, noEchoOnlyChanged);
|
|
27406
|
+
}
|
|
27407
|
+
deleteRestApi(logicalId, physicalId, resourceType, context) {
|
|
27408
|
+
return deleteRestApi.call(this, logicalId, physicalId, resourceType, context);
|
|
27409
|
+
}
|
|
27410
|
+
getRestApiAttribute(physicalId, attributeName) {
|
|
27411
|
+
return getRestApiAttribute.call(this, physicalId, attributeName);
|
|
27412
|
+
}
|
|
27413
|
+
readCurrentStateRestApi(physicalId, properties) {
|
|
27414
|
+
return readCurrentStateRestApi.call(this, physicalId, properties);
|
|
27415
|
+
}
|
|
27416
|
+
importRestApi(input) {
|
|
27417
|
+
return importRestApi.call(this, input);
|
|
27418
|
+
}
|
|
26875
27419
|
buildStageArn(restApiId, stageName) {
|
|
26876
27420
|
return buildStageArn.call(this, restApiId, stageName);
|
|
26877
27421
|
}
|
|
@@ -26884,6 +27428,9 @@ var ApiGatewayProvider = class {
|
|
|
26884
27428
|
canonicalizeDriftProperties(resourceType, properties) {
|
|
26885
27429
|
return canonicalizeDriftProperties$2.call(this, resourceType, properties);
|
|
26886
27430
|
}
|
|
27431
|
+
getDriftUnknownPaths(resourceType) {
|
|
27432
|
+
return getDriftUnknownPaths$9.call(this, resourceType);
|
|
27433
|
+
}
|
|
26887
27434
|
getDriftUnorderedPaths(resourceType) {
|
|
26888
27435
|
return getDriftUnorderedPaths$6.call(this, resourceType);
|
|
26889
27436
|
}
|
|
@@ -62317,4 +62864,4 @@ var ACMCertificateProvider = class {
|
|
|
62317
62864
|
};
|
|
62318
62865
|
|
|
62319
62866
|
export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, AppConfigEnvironmentProvider, AppSyncProvider, BudgetsBudgetProvider, CloudFrontDistributionProvider, CloudFrontOACProvider, CloudFrontOAIProvider, CloudTrailProvider, CloudWatchAlarmProvider, CloudWatchAnomalyDetectorProvider, CodeBuildProvider, CodeCommitRepositoryProvider, CognitoUserPoolProvider, DLMLifecyclePolicyProvider, DocDBProvider, DocDBSubnetGroupProvider, DynamoDBGlobalTableProvider, DynamoDBTableProvider, EC2Provider, ECRProvider, ECSProvider, EFSProvider, ELBv2Provider, EMRClusterProvider, EMRInstanceFleetConfigProvider, EMRInstanceGroupConfigProvider, ElastiCacheProvider, EventBridgeBusProvider, EventBridgeRuleProvider, FSxFileSystemProvider, FirehoseProvider, GlueConnectionProvider, GlueCrawlerProvider, GlueJobProvider, GlueProvider, GlueSecurityConfigurationProvider, GlueTriggerProvider, GlueWorkflowProvider, IAMAccessKeyProvider, IAMInstanceProfileProvider, IAMManagedPolicyProvider, IAMPolicyProvider, IAMRoleProvider, IAMUserGroupProvider, KMSProvider, KinesisStreamConsumerProvider, KinesisStreamProvider, LambdaEventInvokeConfigProvider, LambdaEventSourceMappingProvider, LambdaFunctionProvider, LambdaLayerVersionProvider, LambdaMicrovmImageProvider, LambdaNetworkConnectorProvider, LambdaPermissionProvider, LambdaUrlProvider, LambdaWebFunctionEndpointProvider, LambdaWebFunctionRevisionProvider, LogsLogGroupProvider, NeptuneProvider, NestedStackProvider, PipesPipeProvider, RDSDBProxyEndpointProvider, RDSDBProxyProvider, RDSDBProxyTargetGroupProvider, RDSProvider, Route53Provider, S3BucketPolicyProvider, S3BucketProvider, S3DirectoryBucketProvider, S3TablesProvider, S3VectorsProvider, SNSSubscriptionProvider, SNSTopicPolicyProvider, SNSTopicProvider, SQSQueuePolicyProvider, SQSQueueProvider, SSMParameterProvider, SchedulerScheduleProvider, SecretsManagerSecretProvider, ServiceDiscoveryProvider, StepFunctionsProvider, WAFv2WebACLProvider, WaitConditionHandleProvider };
|
|
62320
|
-
//# sourceMappingURL=provider-classes-
|
|
62867
|
+
//# sourceMappingURL=provider-classes-XzlF2NN6.js.map
|