@go-to-k/cdkd 0.296.1 → 0.296.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{asg-provider-BwWy0pBH.js → asg-provider-CksS_6jO.js} +3 -3
- package/dist/{asg-provider-BwWy0pBH.js.map → asg-provider-CksS_6jO.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-xlct0Hcm.js → deploy-engine-Dre6eDNJ.js} +164 -28
- package/dist/deploy-engine-Dre6eDNJ.js.map +1 -0
- package/dist/{iam-role-provider-BRVCTUZu.js → iam-role-provider-D9wk9Bnh.js} +2 -2
- package/dist/{iam-role-provider-BRVCTUZu.js.map → iam-role-provider-D9wk9Bnh.js.map} +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{neptune-provider-Cdp4jX8S.js → neptune-provider-B1GRQ6UO.js} +2 -2
- package/dist/{neptune-provider-Cdp4jX8S.js.map → neptune-provider-B1GRQ6UO.js.map} +1 -1
- package/dist/{program-DXRavuSm.js → program-DFehMfoh.js} +286 -85
- package/dist/program-DFehMfoh.js.map +1 -0
- package/dist/{provider-classes-DNkoEEo4.js → provider-classes-Ca6o5by0.js} +269 -50
- package/dist/provider-classes-Ca6o5by0.js.map +1 -0
- package/dist/{rds-provider-McCDKyXN.js → rds-provider-Dl--9uQU.js} +3 -3
- package/dist/{rds-provider-McCDKyXN.js.map → rds-provider-Dl--9uQU.js.map} +1 -1
- package/dist/{version-Dpc_HYX0.js → version-B5LYpWJH.js} +2 -2
- package/dist/{version-Dpc_HYX0.js.map → version-B5LYpWJH.js.map} +1 -1
- package/package.json +2 -2
- package/dist/deploy-engine-xlct0Hcm.js.map +0 -1
- package/dist/program-DXRavuSm.js.map +0 -1
- package/dist/provider-classes-DNkoEEo4.js.map +0 -1
|
@@ -2,12 +2,12 @@ import { r as getAwsClients } from "./aws-clients-CnmtbrxD.js";
|
|
|
2
2
|
import { A as displaySafe, F as safeMsg, M as isPasteableIdent, P as plainIdentOr, g as generateResourceNameWithFallback, h as generateResourceName, j as displayStackName, k as displayIdent, n as getLogger, v as getCurrentStackName, w as SECRET_REF_MAX_CODE_POINTS } from "./logger-Dvc7ddKe.js";
|
|
3
3
|
import { $ as compositeIdFormatMessage, $n as markRedactedCause, A as isTerminalDeleteFailure, B as WITHHELD_AWS_COMMAND, C as refusalTypeShown, D as ProtectionFlipRegistry, Dn as shellQuote, H as pasteableAwsCommand, Ht as AccountIdUnavailableError, J as isInterruptedWaitError, Jn as safeStringify, Kn as describeAwsFailure, L as userPoolProtectionSite, Ln as markNameCollision, Lt as withPasteableAwsProfile, M as observeThenDisableProtection, Mt as injectiveKey, N as protectionFlipKey, Nt as injectiveKeyPrefix, On as withheldTargetClause, P as rdsFamilyProtectionSite, Q as canonicalizeRoute53QueryName, Qn as markNonRetryable, Rn as markReplayMayCollide, Rt as ambientClientDefaults, S as quotedRemedyLogicalId, Sn as pasteableCommand, T as resolveExplicitPhysicalId, U as protectedReplacementAdvice, Un as isRetryableTransientError, V as isAwsCliLiteral, Vn as isAmbiguousOutcomeError, Vt as credentialFingerprint, W as renderDisableCommand, Wn as isTransientServerError, Wt as CdkdError, X as ElapsedBudgetRegistry, Y as startInterruptWatch, Yn as THROTTLING_ERROR_NAMES, Zn as isThrottlingError, _ as VALUE_NOT_SHOWN, a as onlySecretDerived, at as segmentAfterAnchor, b as isQuotableImportValue, bn as hasClauseBreak, bt as markAuxiliaryFailure, c as recordedPrincipalsRepair, ct as createMaskedRetryLogger, dt as maskerOrIdentity, er as wrapMaskedAwsError, et as compositeIdSeparatorRefusal, ft as withDerivedNameMasks, g as assertRegionMatch, h as RESOURCE_NOT_FOUND, ht as clearCreatedBeforeFailure, i as holdsSecretDerivedEntry, in as ProvisioningError, j as logGroupProtectionSite, k as deleteWithProtectionCompensation, lt as isSecretDerivedValue, nt as logicalIdShown, o as readPrincipalLists, on as ResourceUpdateNotSupportedError, ot as stateOrphanRecordRemedy, p as withRemovalDefaults, qn as isAwsAuthoredFailure, r as SECRET_DERIVED_READ_LIVE, rt as packCompositeId, st as createMaskedLogSinks, tt as compositeIdSkipResult, u as clearOnUpdateRemoval, ut as maskDeep, v as isPlainImportJson, w as remedyLogicalId, wn as plainOrDescribed, x as normalizeAwsTagsToCfn, xn as isInertUnquoted, xt as markCreatedBeforeFailure, y as isPlainImportValue, yn as commandHole, z as UNNAMEABLE_ID_CLAUSE, zt as ambientCredentialConfig } from "./iam-policy-targets-DSDSdxXz.js";
|
|
4
4
|
import { s as ambientRegion } from "./aws-client-defaults-D0q0z4dG.js";
|
|
5
|
-
import { $a as
|
|
6
|
-
import { n as collectInlinePolicyNamesManagedBySiblings, t as IAMRoleProvider } from "./iam-role-provider-
|
|
7
|
-
import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-
|
|
8
|
-
import { RDSProvider } from "./rds-provider-
|
|
9
|
-
import { NeptuneProvider } from "./neptune-provider-
|
|
10
|
-
import { ASGProvider } from "./asg-provider-
|
|
5
|
+
import { $a as recoverMaskedOutput, $i as findSilentDropProperties, $n as observeThenDisableInstanceApiTermination, A as resolveDynamoDbDeleteBudgetClock, Aa as lambdaFunctionNameForMask, An as tagMapAsList, B as getPriorAttempts, Bi as refuseMalformedResourcesForDestroy, Br as passedParameterClassesOf, Ca as requireConfigObject, Cr as s3BucketWebsiteUrl, Ct as getStackRecords, D as beginDeleteWait, Dn as planTagDiff, Dr as getAccountInfo, E as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, En as DBPROXY_TAG_OPTIONS, F as waitForIndexesSettled, Gs as canonicalizeRegion, Gt as REDACTED_DELETE_ADDRESS_SKIP_REASON, Ho as rewriteTemplateAssetReferences, Hs as decodeListingKey, I as ECR_AUTO_DELETE_IMAGES_TAG, Jn as isWaitAbandonedError, Jt as redactedDeleteAddressSkip, Kn as deleteSkipReason, Ks as derivePartitionAndUrlSuffix, Kt as isRedactedRecordedValue, L as S3_AUTO_DELETE_OBJECTS_TAG, Lo as stringifyValue, Lr as parseWebACLArn, M as DELETE_INDEX_WAIT_PROCEED_NOTE, Mn as definedAttributes, N as INDEX_SETTLE_POLL_INTERVAL_MS, Nn as stringifyIfAssigned, O as compensateRemovedDeletionProtection, Oa as withRetry, On as readTagList, P as deleteTableWithIndexBusyRetry, Pt as getCurrentProducerRegions, Qn as isTerminationProtectionPropagationError, R as hasCdkAutoDeleteTag, Sa as requireConfigArray, Sn as reserveStackCreateToken, Sr as s3BucketRegionalDomainName, T as DynamoDBGlobalTableProvider, Tn as DBPROXY_TAGS_WHAT, Un as unchangedBehindSecretReference, V as markRefusedBeforeApplying, Vn as slowCcOperationTimeoutMs, Xa as markSameGenerationBag, Yn as markWaitAbandoned, Za as redactSecretsForState, Zn as ec2InstanceProtectionSite, _a as configBooleanRefusal, _t as getCurrentNestedStackContext, a as findNestedTemplateTreeDefect, ac as resolveAssemblyPath, ao as carriesSecretMask, ba as readConfigString, bi as refuseMalformedNestedChildOutputs, bn as earliestDefined, br as s3BucketDomainName, c as renderNestedTemplateTreeDefect, da as coerceWarmThroughput$1, dt as getNestedRevertRun, er as reDisableInstanceApiTermination, fa as isWarmThroughputDecrease, ga as coerceCfnInteger, ha as coerceCfnBoolean, ic as renderAssemblyPathEscape, j as resolveDynamoDbDeleteBudgetMs, ja as sameLambdaFunctionAddress, jn as tagPlanWarning, k as deleteBudgetKey, ka as canonicalLambdaFunctionName, kn as refuseMalformedDesiredTags, ma as toFiniteNumber, mt as revertNestedChildFromJournal, nc as describeFileReadFailure, o as isAbsoluteAssetPath, pa as toCfnInteger, qn as withIndeterminateGuard, qt as redactedDeleteAddressFields, rc as displayAssemblyPath, s as listNestedTemplateRows, t as DeployEngine, ta as withoutSilentDropProperties, to as dynamicReferenceTokens, tr as reEnableInstanceApiTermination, ua as WARM_THROUGHPUT_MEMBERS, va as configIntegerRefusal, vr as isSettledInstanceState, vt as withNestedStackContext, wa as requireConfigString, wn as acquireIdempotencyToken, xa as replayWarn, xr as s3BucketDualStackDomainName, xt as awaitInFlightSibling, ya as configStringRefusal, yr as s3BucketArn, z as isTruthyCfnBoolean, za as hasMaskableValues, zn as getCurrentResourceSecrets } from "./deploy-engine-Dre6eDNJ.js";
|
|
6
|
+
import { n as collectInlinePolicyNamesManagedBySiblings, t as IAMRoleProvider } from "./iam-role-provider-D9wk9Bnh.js";
|
|
7
|
+
import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-DFehMfoh.js";
|
|
8
|
+
import { RDSProvider } from "./rds-provider-Dl--9uQU.js";
|
|
9
|
+
import { NeptuneProvider } from "./neptune-provider-B1GRQ6UO.js";
|
|
10
|
+
import { ASGProvider } from "./asg-provider-CksS_6jO.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";
|
|
@@ -2606,7 +2606,7 @@ function manualBucketDeletionClause(bucketName, maskSecrets, journaled) {
|
|
|
2606
2606
|
identifier: bucketName,
|
|
2607
2607
|
maskSecrets
|
|
2608
2608
|
});
|
|
2609
|
-
const lead = journaled ? "
|
|
2609
|
+
const lead = journaled ? "Outside a rollback's re-create, the failed deploy's rollback journal records the bucket for `cdkd rollback --revert-failed`; otherwise delete it yourself before the next deploy" : "Manual deletion may be required before the next deploy";
|
|
2610
2610
|
return command ? `${lead}: ${command}` : `${lead}, via the console: the bucket name cannot be reproduced safely on a command line, so any command shown here could act on a different bucket or run part of the name as shell.`;
|
|
2611
2611
|
}
|
|
2612
2612
|
function configItemId(item) {
|
|
@@ -5518,7 +5518,7 @@ var SQSQueuePolicyProvider = class {
|
|
|
5518
5518
|
this.logger.debug(`Successfully created SQS queue policy ${logicalId}`);
|
|
5519
5519
|
return {
|
|
5520
5520
|
physicalId: queues[0],
|
|
5521
|
-
attributes: {}
|
|
5521
|
+
attributes: { [WRITTEN_QUEUES_KEY]: queues.join(",") }
|
|
5522
5522
|
};
|
|
5523
5523
|
} catch (error) {
|
|
5524
5524
|
const cause = error instanceof Error ? error : void 0;
|
|
@@ -5527,12 +5527,15 @@ var SQSQueuePolicyProvider = class {
|
|
|
5527
5527
|
throw thrown;
|
|
5528
5528
|
}
|
|
5529
5529
|
}
|
|
5530
|
-
async update(logicalId, physicalId, resourceType, properties,
|
|
5530
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
5531
5531
|
this.logger.debug(`Updating SQS queue policy ${logicalId}: ${physicalId}`);
|
|
5532
5532
|
const queues = properties["Queues"];
|
|
5533
5533
|
const policyDocument = properties["PolicyDocument"];
|
|
5534
5534
|
if (!queues || queues.length === 0) throw new ProvisioningError(`Queues is required for SQS queue policy ${logicalId}`, resourceType, logicalId, physicalId);
|
|
5535
5535
|
if (!policyDocument) throw new ProvisioningError(`PolicyDocument is required for SQS queue policy ${logicalId}`, resourceType, logicalId, physicalId);
|
|
5536
|
+
const written = recordedQueues(physicalId, context?.recordedAttributes);
|
|
5537
|
+
const listedOnly = await this.queuesCarryingDocument(listedQueues(previousProperties).filter((url) => !written.includes(url) && !queues.includes(url)), previousProperties["PolicyDocument"], logicalId);
|
|
5538
|
+
const removed = [...written.filter((url) => !queues.includes(url)), ...listedOnly];
|
|
5536
5539
|
try {
|
|
5537
5540
|
const policyDoc = typeof policyDocument === "string" ? policyDocument : JSON.stringify(policyDocument);
|
|
5538
5541
|
for (const queueUrl of queues) {
|
|
@@ -5542,21 +5545,35 @@ var SQSQueuePolicyProvider = class {
|
|
|
5542
5545
|
Attributes: { Policy: policyDoc }
|
|
5543
5546
|
}));
|
|
5544
5547
|
}
|
|
5548
|
+
for (const queueUrl of removed) await this.clearQueuePolicy(queueUrl, resourceType, logicalId, context?.expectedRegion, "pre-update");
|
|
5545
5549
|
this.logger.debug(`Successfully updated SQS queue policy ${logicalId}`);
|
|
5546
5550
|
return {
|
|
5547
5551
|
physicalId: queues[0],
|
|
5548
5552
|
wasReplaced: false,
|
|
5549
|
-
attributes: {}
|
|
5553
|
+
attributes: { [WRITTEN_QUEUES_KEY]: queues.join(",") }
|
|
5550
5554
|
};
|
|
5551
5555
|
} catch (error) {
|
|
5556
|
+
if (error instanceof ProvisioningError) throw error;
|
|
5552
5557
|
const cause = error instanceof Error ? error : void 0;
|
|
5553
5558
|
throw new ProvisioningError(`Failed to update SQS queue policy ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
5554
5559
|
}
|
|
5555
5560
|
}
|
|
5556
|
-
async delete(logicalId, physicalId, resourceType,
|
|
5561
|
+
async delete(logicalId, physicalId, resourceType, properties, context) {
|
|
5557
5562
|
this.logger.debug(`Deleting SQS queue policy ${logicalId}: ${physicalId}`);
|
|
5558
|
-
const
|
|
5563
|
+
const named = physicalId.includes(",") ? splitQueueUrls(physicalId) : recordedQueues(physicalId, context?.recordedAttributes);
|
|
5564
|
+
const queueUrls = [...physicalId.includes(",") ? [] : await this.queuesCarryingDocument(listedQueues(properties ?? {}).filter((url) => !named.includes(url)), properties?.["PolicyDocument"], logicalId), ...named];
|
|
5565
|
+
if (queueUrls.length === 0) throw new ProvisioningError(`Failed to delete SQS queue policy ${logicalId}: its physical id names no queue URL`, resourceType, logicalId, physicalId);
|
|
5559
5566
|
for (const queueUrl of queueUrls) try {
|
|
5567
|
+
await this.clearQueuePolicy(queueUrl, resourceType, logicalId, context?.expectedRegion);
|
|
5568
|
+
} catch (error) {
|
|
5569
|
+
if (error instanceof ProvisioningError) throw error;
|
|
5570
|
+
const cause = error instanceof Error ? error : void 0;
|
|
5571
|
+
throw new ProvisioningError(`Failed to delete SQS queue policy ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
5572
|
+
}
|
|
5573
|
+
this.logger.debug(`Successfully deleted SQS queue policy ${logicalId}`);
|
|
5574
|
+
}
|
|
5575
|
+
async clearQueuePolicy(queueUrl, resourceType, logicalId, expectedRegion, phase = "not-found") {
|
|
5576
|
+
try {
|
|
5560
5577
|
await this.sqsClient.send(new SetQueueAttributesCommand({
|
|
5561
5578
|
QueueUrl: queueUrl,
|
|
5562
5579
|
Attributes: { Policy: "" }
|
|
@@ -5564,33 +5581,77 @@ var SQSQueuePolicyProvider = class {
|
|
|
5564
5581
|
} catch (error) {
|
|
5565
5582
|
if (error instanceof Error && (error.name === "QueueDoesNotExist" || error.message.includes("does not exist"))) {
|
|
5566
5583
|
const clientRegion = await this.sqsClient.config.region();
|
|
5567
|
-
assertRegionMatch(clientRegion,
|
|
5584
|
+
assertRegionMatch(clientRegion, expectedRegion, resourceType, logicalId, queueUrl, phase);
|
|
5568
5585
|
this.logger.debug(`Queue ${queueUrl} does not exist, skipping policy deletion`);
|
|
5569
|
-
|
|
5586
|
+
return;
|
|
5570
5587
|
}
|
|
5571
|
-
|
|
5572
|
-
throw new ProvisioningError(`Failed to delete SQS queue policy ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
5588
|
+
throw error;
|
|
5573
5589
|
}
|
|
5574
|
-
this.logger.debug(`Successfully deleted SQS queue policy ${logicalId}`);
|
|
5575
5590
|
}
|
|
5576
|
-
async
|
|
5577
|
-
|
|
5591
|
+
async queuesCarryingDocument(candidates, document, logicalId) {
|
|
5592
|
+
if (candidates.length === 0) return [];
|
|
5593
|
+
let reference;
|
|
5594
|
+
if (typeof document === "string" && document.length > 0) reference = canonicalPolicy$1(document);
|
|
5595
|
+
else if (document !== null && typeof document === "object") reference = canonicalJson$2(document);
|
|
5596
|
+
if (reference === void 0) {
|
|
5597
|
+
this.logger.warn(safeMsg`The queues ${candidates.join(", ")} listed by ${logicalId} were not checked (no policy document recorded to compare with) and may still carry its policy.`);
|
|
5598
|
+
return [];
|
|
5599
|
+
}
|
|
5600
|
+
const carrying = [];
|
|
5601
|
+
for (const queueUrl of candidates) {
|
|
5602
|
+
const current = await this.readPolicyForWidening(queueUrl);
|
|
5603
|
+
if (current.kind === "policy" && canonicalPolicy$1(current.policy) === reference) carrying.push(queueUrl);
|
|
5604
|
+
else if (current.kind === "unreadable") this.logger.warn(safeMsg`Could not read the policy of queue ${queueUrl} (${current.reason}), so it is not cleared: it may still carry the policy of ${logicalId}.`);
|
|
5605
|
+
else this.logger.debug(safeMsg`Queue ${queueUrl} does not carry the policy of ${logicalId}; left as is`);
|
|
5606
|
+
}
|
|
5607
|
+
return carrying;
|
|
5608
|
+
}
|
|
5609
|
+
async readPolicyForWidening(queueUrl) {
|
|
5578
5610
|
try {
|
|
5579
|
-
|
|
5580
|
-
QueueUrl:
|
|
5611
|
+
const policy = (await this.sqsClient.send(new GetQueueAttributesCommand({
|
|
5612
|
+
QueueUrl: queueUrl,
|
|
5581
5613
|
AttributeNames: ["Policy"]
|
|
5582
5614
|
}))).Attributes?.["Policy"];
|
|
5615
|
+
return policy ? {
|
|
5616
|
+
kind: "policy",
|
|
5617
|
+
policy
|
|
5618
|
+
} : { kind: "none" };
|
|
5583
5619
|
} catch (err) {
|
|
5584
|
-
const
|
|
5585
|
-
if (
|
|
5586
|
-
|
|
5620
|
+
const name = err.name;
|
|
5621
|
+
if (name === "QueueDoesNotExist" || name === "AWS.SimpleQueueService.NonExistentQueue") return { kind: "none" };
|
|
5622
|
+
return {
|
|
5623
|
+
kind: "unreadable",
|
|
5624
|
+
reason: name ?? "error"
|
|
5625
|
+
};
|
|
5587
5626
|
}
|
|
5588
|
-
|
|
5589
|
-
|
|
5627
|
+
}
|
|
5628
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
5629
|
+
const queueUrls = splitQueueUrls(physicalId);
|
|
5630
|
+
if (queueUrls.length === 0) return void 0;
|
|
5631
|
+
const held = [];
|
|
5632
|
+
let firstPolicy;
|
|
5633
|
+
for (const queueUrl of queueUrls) {
|
|
5634
|
+
let policyAttr;
|
|
5635
|
+
try {
|
|
5636
|
+
policyAttr = (await this.sqsClient.send(new GetQueueAttributesCommand({
|
|
5637
|
+
QueueUrl: queueUrl,
|
|
5638
|
+
AttributeNames: ["Policy"]
|
|
5639
|
+
}))).Attributes?.["Policy"];
|
|
5640
|
+
} catch (err) {
|
|
5641
|
+
const e = err;
|
|
5642
|
+
if (e.name === "QueueDoesNotExist" || e.name === "AWS.SimpleQueueService.NonExistentQueue") continue;
|
|
5643
|
+
throw err;
|
|
5644
|
+
}
|
|
5645
|
+
if (!policyAttr) continue;
|
|
5646
|
+
held.push(queueUrl);
|
|
5647
|
+
firstPolicy ??= policyAttr;
|
|
5648
|
+
}
|
|
5649
|
+
if (firstPolicy === void 0) return RESOURCE_NOT_FOUND;
|
|
5650
|
+
const result = { Queues: held };
|
|
5590
5651
|
try {
|
|
5591
|
-
result["PolicyDocument"] = JSON.parse(
|
|
5652
|
+
result["PolicyDocument"] = JSON.parse(firstPolicy);
|
|
5592
5653
|
} catch {
|
|
5593
|
-
result["PolicyDocument"] =
|
|
5654
|
+
result["PolicyDocument"] = firstPolicy;
|
|
5594
5655
|
}
|
|
5595
5656
|
return result;
|
|
5596
5657
|
}
|
|
@@ -5615,6 +5676,49 @@ var SQSQueuePolicyProvider = class {
|
|
|
5615
5676
|
function isSqsQueueUrl(value) {
|
|
5616
5677
|
return value.startsWith("https://sqs.") && value.includes("/");
|
|
5617
5678
|
}
|
|
5679
|
+
const WRITTEN_QUEUES_KEY = "cdkd:WrittenQueues";
|
|
5680
|
+
function recordedQueues(physicalId, attributes) {
|
|
5681
|
+
const named = splitQueueUrls(physicalId);
|
|
5682
|
+
const value = attributes?.[WRITTEN_QUEUES_KEY];
|
|
5683
|
+
if (typeof value !== "string") return named;
|
|
5684
|
+
const recorded = splitQueueUrls(value);
|
|
5685
|
+
if (recorded.length === 0 || !recorded.every(isListedQueueUrl)) return named;
|
|
5686
|
+
for (const url of recorded) if (!named.includes(url)) named.push(url);
|
|
5687
|
+
return named;
|
|
5688
|
+
}
|
|
5689
|
+
function listedQueues(bag) {
|
|
5690
|
+
const listed = bag["Queues"];
|
|
5691
|
+
if (!Array.isArray(listed)) return [];
|
|
5692
|
+
const out = [];
|
|
5693
|
+
for (const entry of listed) if (typeof entry === "string" && isListedQueueUrl(entry) && !out.includes(entry)) out.push(entry);
|
|
5694
|
+
return out;
|
|
5695
|
+
}
|
|
5696
|
+
function isListedQueueUrl(value) {
|
|
5697
|
+
return isSqsQueueUrl(value) && !value.includes(",") && !value.includes("*");
|
|
5698
|
+
}
|
|
5699
|
+
function canonicalJson$2(value) {
|
|
5700
|
+
const sortKeys = (v) => {
|
|
5701
|
+
if (Array.isArray(v)) return v.map(sortKeys);
|
|
5702
|
+
if (v !== null && typeof v === "object") {
|
|
5703
|
+
const out = Object.create(null);
|
|
5704
|
+
for (const key of Object.keys(v).sort()) out[key] = sortKeys(v[key]);
|
|
5705
|
+
return out;
|
|
5706
|
+
}
|
|
5707
|
+
return v;
|
|
5708
|
+
};
|
|
5709
|
+
const sorted = sortKeys(value);
|
|
5710
|
+
return JSON.stringify(sorted);
|
|
5711
|
+
}
|
|
5712
|
+
function canonicalPolicy$1(text) {
|
|
5713
|
+
try {
|
|
5714
|
+
return canonicalJson$2(JSON.parse(text));
|
|
5715
|
+
} catch {
|
|
5716
|
+
return `raw:${text}`;
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
function splitQueueUrls(physicalId) {
|
|
5720
|
+
return physicalId.split(",").filter((url) => url.length > 0);
|
|
5721
|
+
}
|
|
5618
5722
|
|
|
5619
5723
|
//#endregion
|
|
5620
5724
|
//#region src/provisioning/providers/create-ownership.ts
|
|
@@ -5748,7 +5852,7 @@ var SNSTopicProvider = class {
|
|
|
5748
5852
|
this.logger.debug(`Cleaned up partially-created SNS topic ${logicalId} (${topicArn}) after wiring failure`);
|
|
5749
5853
|
} catch (cleanupError) {
|
|
5750
5854
|
leftBehindArn = topicArn;
|
|
5751
|
-
warn(`Failed to clean up partially-created SNS topic ${logicalId} (${topicArn}): ${describeAwsFailure(cleanupError).detail}.
|
|
5855
|
+
warn(`Failed to clean up partially-created SNS topic ${logicalId} (${topicArn}): ${describeAwsFailure(cleanupError).detail}. Outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`; otherwise delete it yourself before the next deploy: ${pasteableAwsCommand(maskSecrets)`aws sns delete-topic --topic-arn ${topicArn}`.render()}`);
|
|
5752
5856
|
}
|
|
5753
5857
|
throw markAuxiliaryFailure(innerError, logicalId);
|
|
5754
5858
|
}
|
|
@@ -6363,15 +6467,27 @@ var SNSTopicPolicyProvider = class {
|
|
|
6363
6467
|
throw thrown;
|
|
6364
6468
|
}
|
|
6365
6469
|
}
|
|
6366
|
-
async update(logicalId, physicalId, resourceType, properties,
|
|
6470
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
6367
6471
|
this.logger.debug(`Updating SNS topic policy ${logicalId}: ${physicalId}`);
|
|
6368
6472
|
const topics = properties["Topics"];
|
|
6369
6473
|
const policyDocument = properties["PolicyDocument"];
|
|
6370
6474
|
if (!topics || topics.length === 0) throw new ProvisioningError(`Topics is required for SNS topic policy ${logicalId}`, resourceType, logicalId, physicalId);
|
|
6371
6475
|
if (!policyDocument) throw new ProvisioningError(`PolicyDocument is required for SNS topic policy ${logicalId}`, resourceType, logicalId, physicalId);
|
|
6372
6476
|
const policyDoc = typeof policyDocument === "string" ? policyDocument : JSON.stringify(policyDocument);
|
|
6477
|
+
const mask = context?.maskSecrets ?? ((t) => t);
|
|
6478
|
+
const written = splitTopicArns(physicalId);
|
|
6479
|
+
const listedOnly = await this.topicsCarryingDocument(listedTopics(previousProperties).filter((arn) => !written.includes(arn) && !topics.includes(arn)), previousProperties["PolicyDocument"], logicalId, mask);
|
|
6480
|
+
const dropped = written.filter((arn) => !topics.includes(arn));
|
|
6481
|
+
const unaddressable = dropped.filter((arn) => !isSnsTopicArn(arn));
|
|
6482
|
+
if (unaddressable.length > 0) {
|
|
6483
|
+
const message = mask(safeMsg`The recorded id segment(s) ${unaddressable.join(", ")} of ${logicalId} are not topic ARNs; ` + (listedTopics(previousProperties).length > 0 ? "the topics its previous Topics listed were checked instead." : "its previous Topics lists no topic ARN either, so a topic it was attached to may still carry its policy."));
|
|
6484
|
+
if (listedTopics(previousProperties).length > 0) this.logger.debug(message);
|
|
6485
|
+
else this.logger.warn(message);
|
|
6486
|
+
}
|
|
6487
|
+
const removed = [...dropped.filter((arn) => isSnsTopicArn(arn)), ...listedOnly];
|
|
6373
6488
|
try {
|
|
6374
6489
|
for (const topicArn of topics) await this.setTopicPolicy(topicArn, policyDoc);
|
|
6490
|
+
for (const topicArn of removed) await this.resetTopicPolicy(topicArn, resourceType, logicalId, context?.expectedRegion, "not-found", mask);
|
|
6375
6491
|
this.logger.debug(`Successfully updated SNS topic policy ${logicalId}`);
|
|
6376
6492
|
return {
|
|
6377
6493
|
physicalId: topics.join(","),
|
|
@@ -6379,28 +6495,77 @@ var SNSTopicPolicyProvider = class {
|
|
|
6379
6495
|
attributes: {}
|
|
6380
6496
|
};
|
|
6381
6497
|
} catch (error) {
|
|
6498
|
+
if (error instanceof ProvisioningError) throw error;
|
|
6382
6499
|
const cause = error instanceof Error ? error : void 0;
|
|
6383
6500
|
throw new ProvisioningError(`Failed to update SNS topic policy ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
6384
6501
|
}
|
|
6385
6502
|
}
|
|
6386
|
-
async delete(logicalId, physicalId, resourceType,
|
|
6503
|
+
async delete(logicalId, physicalId, resourceType, properties, context) {
|
|
6387
6504
|
this.logger.debug(`Deleting SNS topic policy ${logicalId}: ${physicalId}`);
|
|
6388
|
-
const
|
|
6505
|
+
const named = splitTopicArns(physicalId);
|
|
6506
|
+
if (named.length === 0) throw markNonRetryable(new ProvisioningError(`Failed to delete SNS topic policy ${logicalId}: its physical id is empty, so cdkd changed no topic. Set each topic the policy is attached to back to its default policy by hand, then drop the record with ${stateOrphanRecordRemedy(context, logicalId)}.`, resourceType, logicalId, physicalId));
|
|
6507
|
+
const topicArns = named.every((arn) => isSnsTopicArn(arn)) ? named : [.../* @__PURE__ */ new Set([...named.filter((arn) => isSnsTopicArn(arn)), ...listedTopics(properties ?? {})])];
|
|
6508
|
+
if (topicArns.length === 0) throw markNonRetryable(new ProvisioningError(`Failed to delete SNS topic policy ${logicalId}: its physical id names no SNS topic ARN and its Topics lists none either, so cdkd changed no topic. Set each topic the policy is attached to back to its default policy by hand, then drop the record with ${stateOrphanRecordRemedy(context, logicalId)}.`, resourceType, logicalId, physicalId));
|
|
6389
6509
|
for (const topicArn of topicArns) try {
|
|
6390
|
-
await this.
|
|
6391
|
-
this.logger.debug(`Removed policy from topic ${topicArn}`);
|
|
6510
|
+
await this.resetTopicPolicy(topicArn, resourceType, logicalId, context?.expectedRegion);
|
|
6392
6511
|
} catch (error) {
|
|
6393
|
-
if (error instanceof
|
|
6394
|
-
const clientRegion = await getAwsClients().sns.config.region();
|
|
6395
|
-
assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, topicArn);
|
|
6396
|
-
this.logger.debug(`Topic ${topicArn} not found or policy already removed, skipping`);
|
|
6397
|
-
continue;
|
|
6398
|
-
}
|
|
6512
|
+
if (error instanceof ProvisioningError) throw error;
|
|
6399
6513
|
const cause = error instanceof Error ? error : void 0;
|
|
6400
6514
|
throw new ProvisioningError(`Failed to delete SNS topic policy ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
6401
6515
|
}
|
|
6402
6516
|
this.logger.debug(`Successfully deleted SNS topic policy ${logicalId}`);
|
|
6403
6517
|
}
|
|
6518
|
+
async resetTopicPolicy(topicArn, resourceType, logicalId, expectedRegion, phase = "not-found", mask = (t) => t) {
|
|
6519
|
+
const defaultPolicy = defaultTopicPolicy(topicArn);
|
|
6520
|
+
if (defaultPolicy === void 0) throw new ProvisioningError(`Cannot remove SNS topic policy ${logicalId} from ${topicArn}: not an SNS topic ARN`, resourceType, logicalId, topicArn);
|
|
6521
|
+
try {
|
|
6522
|
+
await this.setTopicPolicy(topicArn, defaultPolicy);
|
|
6523
|
+
this.logger.debug(mask(safeMsg`Reset the policy of topic ${topicArn} to the default`));
|
|
6524
|
+
} catch (error) {
|
|
6525
|
+
const name = error?.name;
|
|
6526
|
+
if (name === "NotFoundException" || name === "NotFound") {
|
|
6527
|
+
const clientRegion = await getAwsClients().sns.config.region();
|
|
6528
|
+
assertRegionMatch(clientRegion, expectedRegion, resourceType, logicalId, topicArn, phase);
|
|
6529
|
+
this.logger.debug(mask(safeMsg`Topic ${topicArn} not found, skipping policy removal`));
|
|
6530
|
+
return;
|
|
6531
|
+
}
|
|
6532
|
+
throw error;
|
|
6533
|
+
}
|
|
6534
|
+
}
|
|
6535
|
+
async topicsCarryingDocument(candidates, document, logicalId, mask) {
|
|
6536
|
+
if (candidates.length === 0) return [];
|
|
6537
|
+
let reference;
|
|
6538
|
+
if (typeof document === "string" && document.length > 0) reference = canonicalPolicy(document);
|
|
6539
|
+
else if (document !== null && typeof document === "object") reference = canonicalJson$1(document);
|
|
6540
|
+
if (reference === void 0) {
|
|
6541
|
+
this.logger.warn(mask(safeMsg`The topics ${candidates.join(", ")} listed by ${logicalId} were not checked (no policy document recorded to compare with) and may still carry its policy.`));
|
|
6542
|
+
return [];
|
|
6543
|
+
}
|
|
6544
|
+
const carrying = [];
|
|
6545
|
+
for (const topicArn of candidates) {
|
|
6546
|
+
const current = await this.readPolicyForWidening(topicArn);
|
|
6547
|
+
if (current.kind === "policy" && canonicalPolicy(current.policy) === reference) carrying.push(topicArn);
|
|
6548
|
+
else if (current.kind === "unreadable") this.logger.warn(mask(safeMsg`Could not read the policy of topic ${topicArn} (${current.reason}), so it is not reset: it may still carry the policy of ${logicalId}.`));
|
|
6549
|
+
else this.logger.debug(mask(safeMsg`Topic ${topicArn} does not carry the policy of ${logicalId}; left as is`));
|
|
6550
|
+
}
|
|
6551
|
+
return carrying;
|
|
6552
|
+
}
|
|
6553
|
+
async readPolicyForWidening(topicArn) {
|
|
6554
|
+
try {
|
|
6555
|
+
const policy = (await getAwsClients().sns.send(new GetTopicAttributesCommand({ TopicArn: topicArn }))).Attributes?.["Policy"];
|
|
6556
|
+
return policy ? {
|
|
6557
|
+
kind: "policy",
|
|
6558
|
+
policy
|
|
6559
|
+
} : { kind: "none" };
|
|
6560
|
+
} catch (err) {
|
|
6561
|
+
const name = err.name;
|
|
6562
|
+
if (name === "NotFoundException" || name === "NotFound") return { kind: "none" };
|
|
6563
|
+
return {
|
|
6564
|
+
kind: "unreadable",
|
|
6565
|
+
reason: name ?? "error"
|
|
6566
|
+
};
|
|
6567
|
+
}
|
|
6568
|
+
}
|
|
6404
6569
|
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
6405
6570
|
const topics = physicalId.split(",").filter((t) => t.length > 0);
|
|
6406
6571
|
if (topics.length === 0) return void 0;
|
|
@@ -6453,6 +6618,60 @@ function isSnsTopicArnList(value) {
|
|
|
6453
6618
|
if (segments.length === 0) return false;
|
|
6454
6619
|
return segments.every((s) => isSnsTopicArn(s));
|
|
6455
6620
|
}
|
|
6621
|
+
function splitTopicArns(physicalId) {
|
|
6622
|
+
return physicalId.split(",").filter((arn) => arn.length > 0);
|
|
6623
|
+
}
|
|
6624
|
+
function listedTopics(bag) {
|
|
6625
|
+
const listed = bag["Topics"];
|
|
6626
|
+
if (!Array.isArray(listed)) return [];
|
|
6627
|
+
const out = [];
|
|
6628
|
+
for (const entry of listed) if (typeof entry === "string" && isSnsTopicArn(entry) && !out.includes(entry)) out.push(entry);
|
|
6629
|
+
return out;
|
|
6630
|
+
}
|
|
6631
|
+
function defaultTopicPolicy(topicArn) {
|
|
6632
|
+
if (!isSnsTopicArn(topicArn)) return void 0;
|
|
6633
|
+
const account = topicArn.split(":")[4];
|
|
6634
|
+
return JSON.stringify({
|
|
6635
|
+
Version: "2008-10-17",
|
|
6636
|
+
Id: "__default_policy_ID",
|
|
6637
|
+
Statement: [{
|
|
6638
|
+
Sid: "__default_statement_ID",
|
|
6639
|
+
Effect: "Allow",
|
|
6640
|
+
Principal: { AWS: "*" },
|
|
6641
|
+
Action: [
|
|
6642
|
+
"SNS:GetTopicAttributes",
|
|
6643
|
+
"SNS:SetTopicAttributes",
|
|
6644
|
+
"SNS:AddPermission",
|
|
6645
|
+
"SNS:RemovePermission",
|
|
6646
|
+
"SNS:DeleteTopic",
|
|
6647
|
+
"SNS:Subscribe",
|
|
6648
|
+
"SNS:ListSubscriptionsByTopic",
|
|
6649
|
+
"SNS:Publish"
|
|
6650
|
+
],
|
|
6651
|
+
Resource: topicArn,
|
|
6652
|
+
Condition: { StringEquals: { "AWS:SourceOwner": account } }
|
|
6653
|
+
}]
|
|
6654
|
+
});
|
|
6655
|
+
}
|
|
6656
|
+
function canonicalJson$1(value) {
|
|
6657
|
+
const sortKeys = (v) => {
|
|
6658
|
+
if (Array.isArray(v)) return v.map(sortKeys);
|
|
6659
|
+
if (v !== null && typeof v === "object") {
|
|
6660
|
+
const out = Object.create(null);
|
|
6661
|
+
for (const key of Object.keys(v).sort()) out[key] = sortKeys(v[key]);
|
|
6662
|
+
return out;
|
|
6663
|
+
}
|
|
6664
|
+
return v;
|
|
6665
|
+
};
|
|
6666
|
+
return JSON.stringify(sortKeys(value));
|
|
6667
|
+
}
|
|
6668
|
+
function canonicalPolicy(text) {
|
|
6669
|
+
try {
|
|
6670
|
+
return canonicalJson$1(JSON.parse(text));
|
|
6671
|
+
} catch {
|
|
6672
|
+
return `raw:${text}`;
|
|
6673
|
+
}
|
|
6674
|
+
}
|
|
6456
6675
|
|
|
6457
6676
|
//#endregion
|
|
6458
6677
|
//#region src/provisioning/providers/lambda-function-provider.ts
|
|
@@ -11185,7 +11404,7 @@ var LogsLogGroupProvider = class {
|
|
|
11185
11404
|
identifier: logGroupName,
|
|
11186
11405
|
maskSecrets: mask
|
|
11187
11406
|
});
|
|
11188
|
-
const manualStep = deleteCommand ? `
|
|
11407
|
+
const manualStep = deleteCommand ? `Outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`; otherwise delete it yourself before the next deploy: ${deleteCommand}` : "Outside a rollback's re-create, the failed deploy's rollback journal records it for `cdkd rollback --revert-failed`; otherwise delete it yourself before the next deploy, via the console: the log group name cannot be reproduced safely on a command line.";
|
|
11189
11408
|
this.logger.warn(mask(`Failed to clean up partially-created log group ${displaySafe(logicalId)} (${displaySafe(mask(logGroupName))}): ${describeAwsFailure(cleanupError).detail}. ${manualStep}`));
|
|
11190
11409
|
}
|
|
11191
11410
|
throw markAuxiliaryFailure(innerError, logicalId);
|
|
@@ -12371,7 +12590,7 @@ var SSMParameterProvider = class SSMParameterProvider {
|
|
|
12371
12590
|
identifier: name,
|
|
12372
12591
|
maskSecrets: mask
|
|
12373
12592
|
});
|
|
12374
|
-
const manualStep = deleteCommand ? `
|
|
12593
|
+
const manualStep = deleteCommand ? `Outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`; otherwise delete it yourself before the next deploy: ${deleteCommand}` : "Outside a rollback's re-create, the failed deploy's rollback journal records it for `cdkd rollback --revert-failed`; otherwise delete it yourself before the next deploy, via the console: the parameter name cannot be reproduced safely on a command line: a command naming the sanitized form would delete a DIFFERENT parameter, and one naming a name that is not inert unquoted could run part of it as shell.";
|
|
12375
12594
|
warn(`Failed to clean up partially-created SSM parameter ${displaySafe(logicalId)} (${displaySafe(mask(name))}): ${describeAwsFailure(cleanupError).detail}. ${manualStep}`);
|
|
12376
12595
|
}
|
|
12377
12596
|
throw markAuxiliaryFailure(innerError, logicalId);
|
|
@@ -23210,13 +23429,13 @@ var ELBv2Provider = class {
|
|
|
23210
23429
|
this.logger.warn(maskerOrIdentity(maskSecrets)(skippedCleanupText(heldBefore, `Listener ${logicalId} (${listenerArn})`, pasteableAwsCommand(maskSecrets)`aws elbv2 delete-listener --listener-arn ${listenerArn}`.render())));
|
|
23211
23430
|
throw markAuxiliaryFailure(innerError, logicalId);
|
|
23212
23431
|
}
|
|
23213
|
-
if (isInterruptedWaitError(innerError)) this.logger.warn(maskerOrIdentity(maskSecrets)(`Interrupted after creating Listener ${logicalId} (${listenerArn}) but before its attributes were applied. Nothing in cdkd state refers to it, so cdkd is deleting it now — left behind it would fail the next deploy with DuplicateListener and destroy could not reach it. If that delete fails,
|
|
23432
|
+
if (isInterruptedWaitError(innerError)) this.logger.warn(maskerOrIdentity(maskSecrets)(`Interrupted after creating Listener ${logicalId} (${listenerArn}) but before its attributes were applied. Nothing in cdkd state refers to it, so cdkd is deleting it now — left behind it would fail the next deploy with DuplicateListener and destroy could not reach it. If that delete fails, outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`; otherwise remove it yourself: ${pasteableAwsCommand(maskSecrets)`aws elbv2 delete-listener --listener-arn ${listenerArn}`.render()}`));
|
|
23214
23433
|
try {
|
|
23215
23434
|
await this.getClient().send(new DeleteListenerCommand({ ListenerArn: listenerArn }));
|
|
23216
23435
|
this.logger.debug(`Cleaned up partially-created Listener ${logicalId} (${listenerArn}) after attributes-wiring failure`);
|
|
23217
23436
|
} catch (cleanupError) {
|
|
23218
23437
|
leftBehindArn = listenerArn;
|
|
23219
|
-
this.logger.warn(`Failed to clean up partially-created Listener ${logicalId} (${listenerArn}): ${this.maskErrorMessage(cleanupError, maskSecrets)}.
|
|
23438
|
+
this.logger.warn(`Failed to clean up partially-created Listener ${logicalId} (${listenerArn}): ${this.maskErrorMessage(cleanupError, maskSecrets)}. Outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`; otherwise delete it yourself before the next deploy: ${pasteableAwsCommand(maskSecrets)`aws elbv2 delete-listener --listener-arn ${listenerArn}`.render()}`);
|
|
23220
23439
|
}
|
|
23221
23440
|
throw markAuxiliaryFailure(innerError, logicalId);
|
|
23222
23441
|
}
|
|
@@ -28738,13 +28957,13 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
|
|
|
28738
28957
|
this.logger.debug(`Applied ${Object.keys(attrs).length} ServiceAttribute(s) for ${logicalId}`);
|
|
28739
28958
|
}
|
|
28740
28959
|
} catch (innerError) {
|
|
28741
|
-
if (isInterruptedWaitError(innerError)) this.logger.warn(maskerOrIdentity(maskSecrets)(`Interrupted after creating ServiceDiscovery Service ${logicalId} (${serviceId}) but before its ServiceAttributes were applied. Nothing in cdkd state refers to it, so cdkd is deleting it now — left behind it would fail the next deploy on a name collision AND block deletion of its namespace with ResourceInUse. If that delete fails,
|
|
28960
|
+
if (isInterruptedWaitError(innerError)) this.logger.warn(maskerOrIdentity(maskSecrets)(`Interrupted after creating ServiceDiscovery Service ${logicalId} (${serviceId}) but before its ServiceAttributes were applied. Nothing in cdkd state refers to it, so cdkd is deleting it now — left behind it would fail the next deploy on a name collision AND block deletion of its namespace with ResourceInUse. If that delete fails, outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`; otherwise remove it yourself: ${pasteableAwsCommand(maskSecrets)`aws servicediscovery delete-service --id ${serviceId}`.render()}`));
|
|
28742
28961
|
try {
|
|
28743
28962
|
await client.send(new DeleteServiceCommand$1({ Id: serviceId }));
|
|
28744
28963
|
leftBehindServiceId = void 0;
|
|
28745
28964
|
this.logger.debug(`Cleaned up partially-created ServiceDiscovery Service ${logicalId} (${serviceId}) after ServiceAttributes wiring failure`);
|
|
28746
28965
|
} catch (cleanupError) {
|
|
28747
|
-
this.logger.warn(`Failed to clean up partially-created ServiceDiscovery Service ${logicalId} (${serviceId}) after ServiceAttributes wiring failure: ${this.maskErrorMessage(cleanupError, maskSecrets)}.
|
|
28966
|
+
this.logger.warn(`Failed to clean up partially-created ServiceDiscovery Service ${logicalId} (${serviceId}) after ServiceAttributes wiring failure: ${this.maskErrorMessage(cleanupError, maskSecrets)}. Outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`; otherwise delete it yourself before the next deploy: ${pasteableAwsCommand(maskSecrets)`aws servicediscovery delete-service --id ${serviceId}`.render()}`);
|
|
28748
28967
|
}
|
|
28749
28968
|
throw markAuxiliaryFailure(innerError, logicalId);
|
|
28750
28969
|
}
|
|
@@ -33007,7 +33226,7 @@ var KMSProvider = class {
|
|
|
33007
33226
|
markAuxiliaryFailure(error, logicalId);
|
|
33008
33227
|
const aws = pasteableAwsCommand();
|
|
33009
33228
|
const region = await this.regionArg(aws);
|
|
33010
|
-
this.logger.warn(safeMsg`KMS key ${createdKeyId} was created for ${logicalId}, but a follow-up call failed. A retry of this create reuses that key instead of creating another, so do not delete it while the deploy is still retrying. If the deploy then FAILS
|
|
33229
|
+
this.logger.warn(safeMsg`KMS key ${createdKeyId} was created for ${logicalId}, but a follow-up call failed. A retry of this create reuses that key instead of creating another, so do not delete it while the deploy is still retrying. If the deploy then FAILS (outside a rollback's re-create), its rollback journal records the key for \`cdkd rollback --revert-failed\` to schedule its deletion; otherwise schedule it yourself with: ${aws`aws kms schedule-key-deletion --key-id ${createdKeyId}${region} --pending-window-in-days 7`.render()}`);
|
|
33011
33230
|
}
|
|
33012
33231
|
const cause = error instanceof Error ? error : void 0;
|
|
33013
33232
|
const thrown = new ProvisioningError(`Failed to create KMS Key ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
|
|
@@ -35458,7 +35677,7 @@ var PipesPipeProvider = class {
|
|
|
35458
35677
|
const orphaned = async (why) => {
|
|
35459
35678
|
const aws = pasteableAwsCommand(mask);
|
|
35460
35679
|
const command = aws`aws pipes delete-pipe --name ${name}${await orphanCommandRegionArg(this.getClient(), aws)}`;
|
|
35461
|
-
original.message += ` (cdkd could not delete the pipe it had created: ${why};
|
|
35680
|
+
original.message += ` (cdkd could not delete the pipe it had created: ${why}; outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`. ` + (command.text !== void 0 ? `Otherwise delete it yourself with: ${command.text})` : `Otherwise delete it yourself from the EventBridge Pipes console.)`);
|
|
35462
35681
|
return leftBehind();
|
|
35463
35682
|
};
|
|
35464
35683
|
try {
|
|
@@ -36492,7 +36711,7 @@ var FSxFileSystemProvider = class {
|
|
|
36492
36711
|
this.logger.warn(`Rolled back partially-created FSx FileSystem ${fileSystemId}`);
|
|
36493
36712
|
} catch (cleanupError) {
|
|
36494
36713
|
survivorId = fileSystemId;
|
|
36495
|
-
this.logger.warn(`Failed to roll back partially-created FSx FileSystem ${fileSystemId}: ${describeAwsFailure(cleanupError).detail} —
|
|
36714
|
+
this.logger.warn(`Failed to roll back partially-created FSx FileSystem ${fileSystemId}: ${describeAwsFailure(cleanupError).detail} — outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`; otherwise delete it yourself to stop billing`);
|
|
36496
36715
|
}
|
|
36497
36716
|
if (error instanceof ProvisioningError) {
|
|
36498
36717
|
if (survivorId !== void 0) markCreatedBeforeFailure(error, logicalId, resourceType, survivorId);
|
|
@@ -43136,4 +43355,4 @@ var ACMCertificateProvider = class {
|
|
|
43136
43355
|
|
|
43137
43356
|
//#endregion
|
|
43138
43357
|
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 };
|
|
43139
|
-
//# sourceMappingURL=provider-classes-
|
|
43358
|
+
//# sourceMappingURL=provider-classes-Ca6o5by0.js.map
|