cdk-real-drift 0.4.23 → 0.4.24
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/cli.js +28 -8
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9651,7 +9651,10 @@ const CC_IDENTIFIER_ADAPTERS = {
|
|
|
9651
9651
|
const ruleName = pid.slice(bar + 1);
|
|
9652
9652
|
const busArn = declared.EventBusName;
|
|
9653
9653
|
if (typeof busArn === "string" && busArn.includes(":event-bus/")) return `${busArn.replace(":event-bus/", ":rule/")}/${ruleName}`;
|
|
9654
|
-
if (region && account)
|
|
9654
|
+
if (region && account) {
|
|
9655
|
+
const { partition } = partitionForRegion(region);
|
|
9656
|
+
return `arn:${partition}:events:${region}:${account}:rule/${busName}/${ruleName}`;
|
|
9657
|
+
}
|
|
9655
9658
|
}
|
|
9656
9659
|
};
|
|
9657
9660
|
function scalingPolicyComposite(pid, declared) {
|
|
@@ -13117,6 +13120,7 @@ function toPatchDocument(item) {
|
|
|
13117
13120
|
//#region src/revert/apply.ts
|
|
13118
13121
|
const POLL_INTERVAL_MS = 2e3;
|
|
13119
13122
|
const TIMEOUT_MS = 900 * 1e3;
|
|
13123
|
+
const MAX_POLL_READ_FAILURES = 10;
|
|
13120
13124
|
function isAlreadyGone(e) {
|
|
13121
13125
|
const o = e ?? {};
|
|
13122
13126
|
const name = typeof o.name === "string" ? o.name : "";
|
|
@@ -13125,15 +13129,18 @@ function isAlreadyGone(e) {
|
|
|
13125
13129
|
return m.includes("not found") || m.includes("does not exist") || m.includes("notfound");
|
|
13126
13130
|
}
|
|
13127
13131
|
const sleep$1 = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
13128
|
-
async function pollToCompletion(cc, first) {
|
|
13132
|
+
async function pollToCompletion(cc, first, poll = {}) {
|
|
13133
|
+
const doSleep = poll.sleep ?? sleep$1;
|
|
13134
|
+
const clock = poll.now ?? Date.now;
|
|
13129
13135
|
let event = first;
|
|
13130
13136
|
const token = event?.RequestToken;
|
|
13131
13137
|
if (!token) return {
|
|
13132
13138
|
ok: false,
|
|
13133
13139
|
error: "no request token returned"
|
|
13134
13140
|
};
|
|
13135
|
-
const deadline =
|
|
13136
|
-
|
|
13141
|
+
const deadline = clock() + TIMEOUT_MS;
|
|
13142
|
+
let pollFailures = 0;
|
|
13143
|
+
while (clock() < deadline) {
|
|
13137
13144
|
const status = event?.OperationStatus;
|
|
13138
13145
|
if (status === "SUCCESS") return { ok: true };
|
|
13139
13146
|
if (status === "FAILED" || status === "CANCEL_COMPLETE") {
|
|
@@ -13144,8 +13151,21 @@ async function pollToCompletion(cc, first) {
|
|
|
13144
13151
|
error: code && !msg.includes(code) ? `${code}: ${msg}` : msg
|
|
13145
13152
|
};
|
|
13146
13153
|
}
|
|
13147
|
-
await
|
|
13148
|
-
|
|
13154
|
+
await doSleep(POLL_INTERVAL_MS);
|
|
13155
|
+
try {
|
|
13156
|
+
event = (await cc.send(new GetResourceRequestStatusCommand({ RequestToken: token }))).ProgressEvent;
|
|
13157
|
+
pollFailures = 0;
|
|
13158
|
+
} catch (e) {
|
|
13159
|
+
const text = errorText(e);
|
|
13160
|
+
if (!classifyTransient(text).transient) return {
|
|
13161
|
+
ok: false,
|
|
13162
|
+
error: text
|
|
13163
|
+
};
|
|
13164
|
+
if (++pollFailures >= MAX_POLL_READ_FAILURES) return {
|
|
13165
|
+
ok: false,
|
|
13166
|
+
error: `unable to confirm Cloud Control request status after ${MAX_POLL_READ_FAILURES} poll attempts (mutation NOT resent, to avoid a duplicate write)`
|
|
13167
|
+
};
|
|
13168
|
+
}
|
|
13149
13169
|
}
|
|
13150
13170
|
return {
|
|
13151
13171
|
ok: false,
|
|
@@ -13159,7 +13179,7 @@ async function applyRevertItem(cc, item, identifier = item.physicalId, retry = {
|
|
|
13159
13179
|
TypeName: item.resourceType,
|
|
13160
13180
|
Identifier: identifier,
|
|
13161
13181
|
PatchDocument: toPatchDocument(item)
|
|
13162
|
-
}))).ProgressEvent);
|
|
13182
|
+
}))).ProgressEvent, retry);
|
|
13163
13183
|
} catch (e) {
|
|
13164
13184
|
return {
|
|
13165
13185
|
ok: false,
|
|
@@ -13199,7 +13219,7 @@ async function applyRevertDelete(cc, item, identifier = item.physicalId, retry =
|
|
|
13199
13219
|
const result = await pollToCompletion(cc, (await cc.send(new DeleteResourceCommand({
|
|
13200
13220
|
TypeName: item.resourceType,
|
|
13201
13221
|
Identifier: identifier
|
|
13202
|
-
}))).ProgressEvent);
|
|
13222
|
+
}))).ProgressEvent, retry);
|
|
13203
13223
|
if (!result.ok && isAlreadyGone({ message: result.error })) return { ok: true };
|
|
13204
13224
|
return result;
|
|
13205
13225
|
} catch (e) {
|