@go-to-k/cdkd 0.296.14 → 0.296.16

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.
@@ -2,12 +2,12 @@ import { r as getAwsClients } from "./aws-clients-CnmtbrxD.js";
2
2
  import { F as displayStackName, I as isPasteableIdent, N as displayIdent, O as SECRET_REF_MAX_CODE_POINTS, P as displaySafe, R as plainIdentOr, a as getLogger, b as generateResourceNameWithFallback, n as isAwsAuthoredFailure, r as safeStringify, t as describeAwsFailure, y as generateResourceName, z as safeMsg } from "./aws-failure-text-BaWeCWRz.js";
3
3
  import { $ as protectedReplacementAdvice, $t as AccountIdUnavailableError, A as isQuotableImportValue, An as commandHole, B as isTerminalDeleteFailure, C as setBounded, D as VALUE_NOT_SHOWN, E as assertRegionMatch, F as resolveExplicitPhysicalId, Fn as plainOrDescribed, H as observeThenDisableProtection, Jn as markNameCollision, Jt as withPasteableAwsProfile, L as ProtectionFlipRegistry, M as quotedRemedyLogicalId, Mn as isInertUnquoted, Mt as markCreatedBeforeFailure, N as refusalTypeShown, Nn as pasteableCommand, O as isPlainImportJson, P as remedyLogicalId, Q as pasteableAwsCommand, Qn as isAmbiguousOutcomeError, Qt as credentialFingerprint, Rn as shellQuote, S as replayedSendWindow, St as withDerivedNameMasks, T as RESOURCE_NOT_FOUND, Tt as clearCreatedBeforeFailure, U as protectionFlipKey, Ut as injectiveKey, V as logGroupProtectionSite, W as rdsFamilyProtectionSite, Wt as injectiveKeyPrefix, X as WITHHELD_AWS_COMMAND, Xt as ambientCredentialConfig, Y as UNNAMEABLE_ID_CLAUSE, Yn as markReplayMayCollide, Yt as ambientClientDefaults, Z as isAwsCliLiteral, Zt as clientDefaultsFor, _ as RecentIdSet, _n as ResourceUpdateNotSupportedError, _t as createMaskedLogSinks, a as onlySecretDerived, ar as isThrottlingError, at as startInterruptWatch, b as isInsideWindow, bt as maskDeep, c as recordedPrincipalsRepair, cr as wrapMaskedAwsError, ct as canonicalizeRoute53QueryName, dt as compositeIdSkipResult, er as isRetryableTransientError, et as renderDisableCommand, ft as logicalIdShown, g as AmbiguousCreateLatch, gt as stateOrphanRecordRemedy, h as AMBIGUOUS_LATCH_TTL_MS, hn as ProvisioningError, ht as segmentAfterAnchor, i as holdsSecretDerivedEntry, ir as isMarkedNonRetryable, it as isInterruptedWaitError, j as normalizeAwsTagsToCfn, jn as hasClauseBreak, jt as markAuxiliaryFailure, k as isPlainImportValue, lt as compositeIdFormatMessage, o as readPrincipalLists, or as markNonRetryable, ot as ElapsedBudgetRegistry, p as withRemovalDefaults, pt as packCompositeId, q as userPoolProtectionSite, r as SECRET_DERIVED_READ_LIVE, rr as THROTTLING_ERROR_NAMES, sr as markRedactedCause, tn as CdkdError, tr as isTransientServerError, u as clearOnUpdateRemoval, ut as compositeIdSeparatorRefusal, v as ambiguousAttemptLead, vt as createMaskedRetryLogger, w as withoutServerErrorRetries, x as replayFollowedAmbiguousAttempt, xt as maskerOrIdentity, y as createAttemptKey, yt as isSecretDerivedValue, z as deleteWithProtectionCompensation, zn as withheldTargetClause } from "./iam-policy-targets-BoZuWtxK.js";
4
4
  import { s as ambientRegion } from "./aws-client-defaults-D0q0z4dG.js";
5
- import { $n as getCurrentResourceSecrets, Aa as toFiniteNumber, Ba as requireConfigString, Bn as planTagDiff, Ct as INDEX_SETTLE_POLL_INTERVAL_MS, Da as coerceWarmThroughput$1, Dc as displayAssemblyPath, Do as recoverMaskedOutput, Dt as S3_AUTO_DELETE_OBJECTS_TAG, Ea as WARM_THROUGHPUT_MEMBERS, Ec as describeFileReadFailure, Et as ECR_AUTO_DELETE_IMAGES_TAG, Fa as configStringRefusal, Fi as refuseMalformedNestedChildOutputs, Fn as reserveStackCreateToken, Fr as s3BucketDualStackDomainName, Ga as canonicalLambdaFunctionName, Gn as definedAttributes, Gt as redactedDeleteAddressFields, Hn as refuseMalformedDesiredTags, Ia as readConfigString, Ir as s3BucketRegionalDomainName, Ka as lambdaFunctionNameForMask, Kn as stringifyIfAssigned, Kt as redactedDeleteAddressSkip, La as replayWarn, Ln as acquireIdempotencyToken, Lr as s3BucketWebsiteUrl, Ma as coerceCfnInteger, Mr as isSettledInstanceState, Na as configBooleanRefusal, Nn as earliestDefined, Nr as s3BucketArn, Oa as isWarmThroughputDecrease, Oc as renderAssemblyPathEscape, Ot as hasCdkAutoDeleteTag, Pa as configIntegerRefusal, Pr as s3BucketDomainName, Ra as requireConfigArray, Rn as DBPROXY_TAGS_WHAT, So as dynamicReferenceTokens, St as DELETE_INDEX_WAIT_PROCEED_NOTE, T as markRefusedBeforeApplying, Tt as waitForIndexesSettled, Un as tagMapAsList, Ut as REDACTED_DELETE_ADDRESS_SKIP_REASON, Vn as readTagList, Vr as getAccountInfo, Vt as getCurrentProducerRegions, W as getNestedRevertRun, Wa as withRetry, Wn as tagPlanWarning, Wt as isRedactedRecordedValue, X as getCurrentNestedStackContext, Z as withNestedStackContext, Zr as parseWebACLArn, _a as withoutSilentDropProperties, _t as beginDeleteWait, a as findNestedTemplateTreeDefect, bt as resolveDynamoDbDeleteBudgetClock, c as renderNestedTemplateTreeDefect, cr as isWaitAbandonedError, dr as ec2InstanceProtectionSite, ei as passedParameterClassesOf, fc as decodeListingKey, fr as isTerminationProtectionPropagationError, fs as rewriteTemplateAssetReferences, gc as derivePartitionAndUrlSuffix, gt as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, ha as findSilentDropProperties, hc as canonicalizeRegion, hr as reEnableInstanceApiTermination, ht as DynamoDBGlobalTableProvider, ja as coerceCfnBoolean, ka as toCfnInteger, kc as resolveAssemblyPath, ko as carriesSecretMask, kt as isTruthyCfnBoolean, lr as markWaitAbandoned, lt as getStackRecords, mr as reDisableInstanceApiTermination, no as passedNoEchoParametersOf, nr as slowCcOperationTimeoutMs, o as isAbsoluteAssetPath, oi as accountArgs, or as deleteSkipReason, pa as withheldAccountClause, pr as observeThenDisableInstanceApiTermination, q as revertNestedChildFromJournal, qa as sameLambdaFunctionAddress, rr as unchangedBehindSecretReference, s as listNestedTemplateRows, so as hasMaskableValues, sr as withIndeterminateGuard, ss as stringifyValue, st as awaitInFlightSibling, t as DeployEngine, ta as refuseMalformedResourcesForDestroy, vo as markSameGenerationBag, vt as compensateRemovedDeletionProtection, w as getPriorAttempts, wt as deleteTableWithIndexBusyRetry, xt as resolveDynamoDbDeleteBudgetMs, yo as redactSecretsForState, yt as deleteBudgetKey, za as requireConfigObject, zn as DBPROXY_TAG_OPTIONS } from "./deploy-engine-Z_zHC0jz.js";
6
- import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-BTYPRrDe.js";
7
- import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-CKV6Kn8Q.js";
8
- import { RDSProvider } from "./rds-provider-6YeZRRfW.js";
9
- import { NeptuneProvider } from "./neptune-provider-ZYVwKq6K.js";
10
- import { ASGProvider } from "./asg-provider-eXsnCQh2.js";
5
+ import { Aa as coerceWarmThroughput$1, Ac as displayAssemblyPath, Ba as replayWarn, Bn as DBPROXY_TAGS_WHAT, Br as s3BucketWebsiteUrl, Ct as INDEX_SETTLE_POLL_INTERVAL_MS, Dt as S3_AUTO_DELETE_OBJECTS_TAG, Et as ECR_AUTO_DELETE_IMAGES_TAG, Fa as coerceCfnInteger, Fn as earliestDefined, Fr as isSettledInstanceState, Gn as tagMapAsList, Gt as redactedDeleteAddressFields, Ha as requireConfigObject, Hn as planTagDiff, Ia as configBooleanRefusal, Ir as s3BucketArn, Ja as canonicalLambdaFunctionName, Jn as stringifyIfAssigned, Kn as tagPlanWarning, Kt as redactedDeleteAddressSkip, La as configIntegerRefusal, Ln as reserveStackCreateToken, Lr as s3BucketDomainName, Ma as toCfnInteger, Mc as resolveAssemblyPath, Mo as carriesSecretMask, Na as toFiniteNumber, Ot as hasCdkAutoDeleteTag, Pa as coerceCfnBoolean, Ra as configStringRefusal, Ri as refuseMalformedNestedChildOutputs, Rr as s3BucketDualStackDomainName, So as redactSecretsForState, St as DELETE_INDEX_WAIT_PROCEED_NOTE, T as markRefusedBeforeApplying, To as dynamicReferenceTokens, Tt as waitForIndexesSettled, Ua as requireConfigString, Un as readTagList, Ut as REDACTED_DELETE_ADDRESS_SKIP_REASON, Va as requireConfigArray, Vn as DBPROXY_TAG_OPTIONS, Vt as getCurrentProducerRegions, W as getNestedRevertRun, Wn as refuseMalformedDesiredTags, Wr as getAccountInfo, Wt as isRedactedRecordedValue, X as getCurrentNestedStackContext, Xa as sameLambdaFunctionAddress, Ya as lambdaFunctionNameForMask, Z as withNestedStackContext, _r as reEnableInstanceApiTermination, _t as beginDeleteWait, a as findNestedTemplateTreeDefect, ao as passedNoEchoParametersOf, ar as unchangedBehindSecretReference, ba as withoutSilentDropProperties, bt as resolveDynamoDbDeleteBudgetClock, c as renderNestedTemplateTreeDefect, cr as deleteSkipReason, dr as markWaitAbandoned, ei as parseWebACLArn, ga as withheldAccountClause, gr as reDisableInstanceApiTermination, gt as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, hc as decodeListingKey, hr as observeThenDisableInstanceApiTermination, hs as rewriteTemplateAssetReferences, ht as DynamoDBGlobalTableProvider, ia as refuseMalformedResourcesForDestroy, ir as slowCcOperationTimeoutMs, ja as isWarmThroughputDecrease, jc as renderAssemblyPathEscape, jo as recoverMaskedOutput, ka as WARM_THROUGHPUT_MEMBERS, kc as describeFileReadFailure, kt as isTruthyCfnBoolean, li as accountArgs, lr as withIndeterminateGuard, lt as getStackRecords, mr as isTerminationProtectionPropagationError, o as isAbsoluteAssetPath, pr as ec2InstanceProtectionSite, q as revertNestedChildFromJournal, qa as withRetry, qn as definedAttributes, ri as passedParameterClassesOf, s as listNestedTemplateRows, st as awaitInFlightSibling, t as DeployEngine, tr as getCurrentResourceSecrets, uo as hasMaskableValues, ur as isWaitAbandonedError, us as stringifyValue, va as findSilentDropProperties, vc as canonicalizeRegion, vt as compensateRemovedDeletionProtection, w as getPriorAttempts, wt as deleteTableWithIndexBusyRetry, xo as markSameGenerationBag, xt as resolveDynamoDbDeleteBudgetMs, yc as derivePartitionAndUrlSuffix, yt as deleteBudgetKey, za as readConfigString, zn as acquireIdempotencyToken, zr as s3BucketRegionalDomainName } from "./deploy-engine-DYAAwd0u.js";
6
+ import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-B31gkUPy.js";
7
+ import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-D0Q9DbSa.js";
8
+ import { RDSProvider } from "./rds-provider-Cbeq5OY8.js";
9
+ import { NeptuneProvider } from "./neptune-provider-X5T1Zamt.js";
10
+ import { ASGProvider } from "./asg-provider-D2eHqx5L.js";
11
11
  import { createHash, randomUUID } from "node:crypto";
12
12
  import { CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client } from "@aws-sdk/client-s3";
13
13
  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, UpdateLoginProfileCommand } from "@aws-sdk/client-iam";
@@ -25678,6 +25678,9 @@ function instanceAttributes(instance) {
25678
25678
  Arn: instance?.DBInstanceArn
25679
25679
  });
25680
25680
  }
25681
+ function isDbIdentifier(id) {
25682
+ return id.length <= 63 && /^[A-Za-z](?:-?[A-Za-z0-9])*$/.test(id);
25683
+ }
25681
25684
  var DocDBProvider = class {
25682
25685
  docdbClient;
25683
25686
  createClient;
@@ -25758,6 +25761,7 @@ var DocDBProvider = class {
25758
25761
  lowercase: true
25759
25762
  });
25760
25763
  let clusterCreated = false;
25764
+ let createdResourceId;
25761
25765
  try {
25762
25766
  const response = await this.getCreateClient().send(new CreateDBClusterCommand$1({
25763
25767
  DBClusterIdentifier: dbClusterIdentifier,
@@ -25778,6 +25782,7 @@ var DocDBProvider = class {
25778
25782
  ...tags.length > 0 && { Tags: tags }
25779
25783
  }));
25780
25784
  clusterCreated = true;
25785
+ createdResourceId = response.DBCluster?.DbClusterResourceId;
25781
25786
  if (!response.DBCluster) throw new Error("CreateDBCluster did not return DBCluster");
25782
25787
  this.logger.debug(`Successfully created DocDB DBCluster ${logicalId}: ${dbClusterIdentifier}`);
25783
25788
  if (process.env["CDKD_NO_WAIT"] !== "true") await this.waitForClusterAvailable(dbClusterIdentifier);
@@ -25787,7 +25792,7 @@ var DocDBProvider = class {
25787
25792
  };
25788
25793
  } catch (error) {
25789
25794
  const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create DocDB DBCluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, dbClusterIdentifier, error instanceof Error ? error : void 0);
25790
- if (clusterCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, dbClusterIdentifier);
25795
+ if (clusterCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, dbClusterIdentifier, createdResourceId);
25791
25796
  throw thrown;
25792
25797
  }
25793
25798
  }
@@ -25889,7 +25894,8 @@ var DocDBProvider = class {
25889
25894
  if (isDocDBNotFoundError(error, "DBClusterNotFoundFault")) {
25890
25895
  const clientRegion = await this.getClient().config.region();
25891
25896
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
25892
- this.logger.debug(`DocDB DBCluster ${logicalId} does not exist, skipping deletion`);
25897
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` DocDB DB cluster ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
25898
+ else this.logger.debug(`DocDB DBCluster ${logicalId} does not exist, skipping deletion`);
25893
25899
  return;
25894
25900
  }
25895
25901
  const cause = error instanceof Error ? error : void 0;
@@ -25904,6 +25910,7 @@ var DocDBProvider = class {
25904
25910
  lowercase: true
25905
25911
  });
25906
25912
  let instanceCreated = false;
25913
+ let createdResourceId;
25907
25914
  try {
25908
25915
  const response = await this.getCreateClient().send(new CreateDBInstanceCommand$1({
25909
25916
  DBInstanceIdentifier: dbInstanceIdentifier,
@@ -25916,6 +25923,7 @@ var DocDBProvider = class {
25916
25923
  ...tags.length > 0 && { Tags: tags }
25917
25924
  }));
25918
25925
  instanceCreated = true;
25926
+ createdResourceId = response.DBInstance?.DbiResourceId;
25919
25927
  if (!response.DBInstance) throw new Error("CreateDBInstance did not return DBInstance");
25920
25928
  this.logger.debug(`Successfully created DocDB DBInstance ${logicalId}: ${dbInstanceIdentifier}`);
25921
25929
  if (process.env["CDKD_NO_WAIT"] !== "true") await this.waitForInstanceAvailable(dbInstanceIdentifier);
@@ -25925,7 +25933,7 @@ var DocDBProvider = class {
25925
25933
  };
25926
25934
  } catch (error) {
25927
25935
  const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create DocDB DBInstance ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, dbInstanceIdentifier, error instanceof Error ? error : void 0);
25928
- if (instanceCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, dbInstanceIdentifier);
25936
+ if (instanceCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, dbInstanceIdentifier, createdResourceId);
25929
25937
  throw thrown;
25930
25938
  }
25931
25939
  }
@@ -25963,7 +25971,8 @@ var DocDBProvider = class {
25963
25971
  if (isDocDBNotFoundError(error, "DBInstanceNotFoundFault")) {
25964
25972
  const clientRegion = await this.getClient().config.region();
25965
25973
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
25966
- this.logger.debug(`DocDB DBInstance ${physicalId} does not exist, skipping deletion`);
25974
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` DocDB DB instance ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
25975
+ else this.logger.debug(`DocDB DBInstance ${physicalId} does not exist, skipping deletion`);
25967
25976
  return;
25968
25977
  }
25969
25978
  const cause = error instanceof Error ? error : void 0;
@@ -25976,6 +25985,55 @@ var DocDBProvider = class {
25976
25985
  async describeDBInstance(dbInstanceIdentifier) {
25977
25986
  return (await this.getClient().send(new DescribeDBInstancesCommand$1({ DBInstanceIdentifier: dbInstanceIdentifier }))).DBInstances?.[0];
25978
25987
  }
25988
+ async isSameResource(journaledPhysicalId, record, resourceType, context) {
25989
+ if (resourceType !== "AWS::DocDB::DBCluster" && resourceType !== "AWS::DocDB::DBInstance") return "unknown";
25990
+ if (!isDbIdentifier(journaledPhysicalId) || !isDbIdentifier(record.physicalId)) return "unknown";
25991
+ if (journaledPhysicalId.toLowerCase() === record.physicalId.toLowerCase()) return "same";
25992
+ if (await this.getClient().config.region() !== context.expectedRegion) return "unknown";
25993
+ const recordResourceId = await this.readDbResourceIdIfExists(resourceType, record.physicalId);
25994
+ if (recordResourceId === void 0) return "unknown";
25995
+ const journaledResourceId = await this.readDbResourceIdIfExists(resourceType, journaledPhysicalId);
25996
+ if (journaledResourceId === void 0) return "different";
25997
+ return journaledResourceId === recordResourceId ? "same" : "different";
25998
+ }
25999
+ async resourceIdentity(physicalId, resourceType, context) {
26000
+ if (resourceType !== "AWS::DocDB::DBCluster" && resourceType !== "AWS::DocDB::DBInstance") return;
26001
+ if (!isDbIdentifier(physicalId)) return void 0;
26002
+ if (await this.getClient().config.region() !== context.expectedRegion) return void 0;
26003
+ const live = await this.readDbResourceIdIfExists(resourceType, physicalId);
26004
+ return live === void 0 ? RESOURCE_NOT_FOUND : live;
26005
+ }
26006
+ async readDbResourceIdIfExists(resourceType, identifier) {
26007
+ const isCluster = resourceType === "AWS::DocDB::DBCluster";
26008
+ let found;
26009
+ try {
26010
+ if (isCluster) {
26011
+ const cluster = await this.describeDBCluster(identifier);
26012
+ found = cluster && {
26013
+ identifier: cluster.DBClusterIdentifier,
26014
+ engine: cluster.Engine,
26015
+ resourceId: cluster.DbClusterResourceId
26016
+ };
26017
+ } else {
26018
+ const instance = await this.describeDBInstance(identifier);
26019
+ found = instance && {
26020
+ identifier: instance.DBInstanceIdentifier,
26021
+ engine: instance.Engine,
26022
+ resourceId: instance.DbiResourceId
26023
+ };
26024
+ }
26025
+ } catch (error) {
26026
+ const notFound = isCluster ? "DBClusterNotFoundFault" : "DBInstanceNotFoundFault";
26027
+ if (error?.name === notFound) return void 0;
26028
+ throw error;
26029
+ }
26030
+ if (found === void 0) return void 0;
26031
+ const api = isCluster ? "DescribeDBClusters" : "DescribeDBInstances";
26032
+ if (found.identifier?.toLowerCase() !== identifier.toLowerCase()) throw new Error(`${api} answered for another identifier`);
26033
+ if (found.engine !== "docdb") throw new Error(`${api} answered with a resource of another engine`);
26034
+ if (typeof found.resourceId !== "string" || found.resourceId === "") throw new Error(`${api} returned no resource id`);
26035
+ return found.resourceId;
26036
+ }
25979
26037
  async waitForClusterAvailable(dbClusterIdentifier, maxWaitMs = 18e5) {
25980
26038
  const startTime = Date.now();
25981
26039
  let delay = 5e3;
@@ -44284,4 +44342,4 @@ var ACMCertificateProvider = class {
44284
44342
 
44285
44343
  //#endregion
44286
44344
  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, LambdaPermissionProvider, LambdaUrlProvider, 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 };
44287
- //# sourceMappingURL=provider-classes-Dz2gVtOZ.js.map
44345
+ //# sourceMappingURL=provider-classes-Bng0RFVo.js.map