cdk-real-drift 0.4.13 → 0.4.15
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 +263 -57
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { dirname, join, resolve } from "node:path";
|
|
|
5
5
|
import { YAMLSeq, isSeq, parse, parseDocument } from "yaml";
|
|
6
6
|
import { CloudControlClient, DeleteResourceCommand, GetResourceCommand, GetResourceRequestStatusCommand, UpdateResourceCommand } from "@aws-sdk/client-cloudcontrol";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
|
-
import { BaseCredentials, CdkAppMultiContext, NonInteractiveIoHost, Toolkit } from "@aws-cdk/toolkit-lib";
|
|
8
|
+
import { BaseCredentials, CdkAppMultiContext, NonInteractiveIoHost, StackSelectionStrategy, Toolkit } from "@aws-cdk/toolkit-lib";
|
|
9
9
|
import { CloudFormationClient, DescribeStackResourcesCommand, DescribeStacksCommand, DescribeTypeCommand, GetTemplateCommand, ListExportsCommand, ListStackResourcesCommand } from "@aws-sdk/client-cloudformation";
|
|
10
10
|
import { KMSClient, ListAliasesCommand } from "@aws-sdk/client-kms";
|
|
11
11
|
import { APIGatewayClient, GetAuthorizersCommand, GetGatewayResponsesCommand, GetModelsCommand, GetRequestValidatorsCommand, GetResourcesCommand, UpdateIntegrationCommand, UpdateIntegrationResponseCommand, UpdateMethodResponseCommand, UpdateRestApiCommand } from "@aws-sdk/client-api-gateway";
|
|
@@ -951,6 +951,31 @@ function missingContextWarning(keys, opts = {}) {
|
|
|
951
951
|
|
|
952
952
|
//#endregion
|
|
953
953
|
//#region src/synth/synth.ts
|
|
954
|
+
/**
|
|
955
|
+
* Map the requested stack name(s)/glob(s) to the toolkit-lib `StackSelector` that scopes
|
|
956
|
+
* `toolkit.synth`'s metadata validation (#905).
|
|
957
|
+
*
|
|
958
|
+
* - No patterns (`undefined` / empty) → `undefined`: the caller wants EVERY stack (no-args
|
|
959
|
+
* discovery or `--all`), so we pass no selector and toolkit-lib defaults to `ALL_STACKS` —
|
|
960
|
+
* the pre-#905 behavior, unchanged. Everything is validated because the user asked for it.
|
|
961
|
+
* - One or more patterns → a `PATTERN_MATCH` selector over those patterns. toolkit-lib then
|
|
962
|
+
* validates ONLY the matched stacks, so a sibling stack the user did NOT target can fail a
|
|
963
|
+
* context lookup without aborting synth. `PATTERN_MATCH` (NOT `PATTERN_MUST_MATCH`) is
|
|
964
|
+
* deliberate: it halts successfully — never throws — when the patterns match zero stacks.
|
|
965
|
+
* The selector matches on the toolkit's HIERARCHICAL id (`Stage/Stack` for a staged stack)
|
|
966
|
+
* via picomatch, which can differ from the deployed stackName resolveStacks filters on, so
|
|
967
|
+
* a staged-stack pattern may legitimately match nothing here; that must not error. The
|
|
968
|
+
* real "unknown stack / no-match glob" errors stay in resolveStacks, checked against the
|
|
969
|
+
* FULL discovered stack list (this selector only narrows what gets VALIDATED, never what
|
|
970
|
+
* gets discovered — the returned assembly still carries every stack).
|
|
971
|
+
*/
|
|
972
|
+
function buildStackSelector(patterns) {
|
|
973
|
+
if (!patterns || patterns.length === 0) return void 0;
|
|
974
|
+
return {
|
|
975
|
+
strategy: StackSelectionStrategy.PATTERN_MATCH,
|
|
976
|
+
patterns
|
|
977
|
+
};
|
|
978
|
+
}
|
|
954
979
|
const CONCRETE_REGION = /^[a-z]{2}(-[a-z]+)+-\d+$/;
|
|
955
980
|
/**
|
|
956
981
|
* Build the stderr message body (no `warning:` prefix — the caller adds it) for the case where
|
|
@@ -1004,6 +1029,7 @@ function cleanupEmptyContextFile(file, existedBefore) {
|
|
|
1004
1029
|
}
|
|
1005
1030
|
async function synthApp(app, opts = {}) {
|
|
1006
1031
|
const { region, profile, context = {} } = opts;
|
|
1032
|
+
const stackSelector = buildStackSelector(opts.stackPatterns);
|
|
1007
1033
|
const toolkit = new Toolkit({
|
|
1008
1034
|
ioHost: new QuietIoHost(),
|
|
1009
1035
|
sdkConfig: { baseCredentials: BaseCredentials.awsCliCompatible({
|
|
@@ -1033,7 +1059,7 @@ async function synthApp(app, opts = {}) {
|
|
|
1033
1059
|
...hasOverrides && { contextStore: new CdkAppMultiContext(process.cwd(), context) }
|
|
1034
1060
|
});
|
|
1035
1061
|
}
|
|
1036
|
-
const cached = await toolkit.synth(source);
|
|
1062
|
+
const cached = await toolkit.synth(source, stackSelector ? { stacks: stackSelector } : void 0);
|
|
1037
1063
|
if (!isDir) cleanupEmptyContextFile(contextFile, contextFileExistedBefore);
|
|
1038
1064
|
try {
|
|
1039
1065
|
const missingKeys = missingContextKeys(collectMissingRecursively(cached.cloudAssembly));
|
|
@@ -1128,10 +1154,12 @@ async function resolveProfileRegion(profile) {
|
|
|
1128
1154
|
async function resolveStacks(a) {
|
|
1129
1155
|
const app = resolveApp(a.app);
|
|
1130
1156
|
if (!app) throw new Error("cdkrd needs a CDK app: run in a directory with cdk.json, pass --app \"<cmd>\" or --app <cdk.out> (a pre-synthesized assembly), or set $CDKRD_APP");
|
|
1157
|
+
const scopePatterns = !a.all && a.stackNames.length > 0 ? a.stackNames : void 0;
|
|
1131
1158
|
const discovered = await discoverStacks(app, {
|
|
1132
1159
|
region: a.region,
|
|
1133
1160
|
profile: a.profile,
|
|
1134
|
-
context: a.context
|
|
1161
|
+
context: a.context,
|
|
1162
|
+
stackPatterns: scopePatterns
|
|
1135
1163
|
});
|
|
1136
1164
|
let fallbackRegion = a.region;
|
|
1137
1165
|
if (!fallbackRegion && discovered.some((s) => !s.region)) {
|
|
@@ -4734,21 +4762,37 @@ function collectNestedUndeclared(declaredVal, liveVal, path, emit, nestedArrayId
|
|
|
4734
4762
|
}
|
|
4735
4763
|
}
|
|
4736
4764
|
const PATH_UNSAFE_KEY = /[.[\]]/;
|
|
4737
|
-
function
|
|
4765
|
+
function sortScalarSet(v) {
|
|
4766
|
+
if (Array.isArray(v) && v.every((e) => typeof e === "string" || typeof e === "number" || typeof e === "boolean")) return [...v].sort((a, b) => `${typeof a}:${String(a)}` < `${typeof b}:${String(b)}` ? -1 : 1);
|
|
4767
|
+
return v;
|
|
4768
|
+
}
|
|
4769
|
+
function sortScalarSetAtNestedPath(model, segs) {
|
|
4770
|
+
if (segs.length === 0 || model === null || typeof model !== "object") return;
|
|
4771
|
+
const [head, ...rest] = segs;
|
|
4772
|
+
if (head === "*") {
|
|
4773
|
+
const children = Array.isArray(model) ? model : Object.values(model);
|
|
4774
|
+
for (const child of children) sortScalarSetAtNestedPath(child, rest);
|
|
4775
|
+
return;
|
|
4776
|
+
}
|
|
4777
|
+
if (Array.isArray(model)) return;
|
|
4778
|
+
const obj = model;
|
|
4779
|
+
if (!(head in obj)) return;
|
|
4780
|
+
if (rest.length === 0) obj[head] = sortScalarSet(obj[head]);
|
|
4781
|
+
else sortScalarSetAtNestedPath(obj[head], rest);
|
|
4782
|
+
}
|
|
4783
|
+
function sortUnorderedSetProps(model, resourceType, schemaObjectArrayKeys = [], schemaScalarPaths = []) {
|
|
4738
4784
|
const objKeys = new Set([...UNORDERED_OBJECT_ARRAY_PROPS[resourceType] ?? [], ...schemaObjectArrayKeys]);
|
|
4739
4785
|
const orderSig = ORDER_SIGNIFICANT_ARRAY_KEYS[resourceType];
|
|
4740
4786
|
for (const k of objKeys) if (!orderSig?.has(k) && Array.isArray(model[k])) model[k] = sortUnorderedObjectArray(model[k]);
|
|
4741
|
-
for (const
|
|
4742
|
-
|
|
4743
|
-
if (Array.isArray(v) && v.every((e) => typeof e === "string" || typeof e === "number" || typeof e === "boolean")) model[k] = [...v].sort((a, b) => `${typeof a}:${String(a)}` < `${typeof b}:${String(b)}` ? -1 : 1);
|
|
4744
|
-
}
|
|
4787
|
+
for (const path of [...UNORDERED_ARRAY_PROPS[resourceType] ?? [], ...schemaScalarPaths]) if (path.includes(".")) sortScalarSetAtNestedPath(model, path.split("."));
|
|
4788
|
+
else if (path in model) model[path] = sortScalarSet(model[path]);
|
|
4745
4789
|
}
|
|
4746
4790
|
function normalizeLiveModel(liveRaw, schema, opts = {}) {
|
|
4747
4791
|
const oaiMap = opts.oaiCanonicalIds ?? {};
|
|
4748
4792
|
const live = canonicalizeForCompare(rewriteOaiPrincipalsDeep(stripAwsTagsDeep(stripCcApiAwsManagedFields(liveRaw)), oaiMap), opts.resourceType);
|
|
4749
4793
|
deepStripPaths(live, schema.readOnlyPaths);
|
|
4750
4794
|
deepStripPaths(live, schema.writeOnlyPaths);
|
|
4751
|
-
if (opts.resourceType) sortUnorderedSetProps(live, opts.resourceType, (schema.unorderedObjectArrayPaths ?? []).filter((p) => !p.includes(".")));
|
|
4795
|
+
if (opts.resourceType) sortUnorderedSetProps(live, opts.resourceType, (schema.unorderedObjectArrayPaths ?? []).filter((p) => !p.includes(".")), schema.unorderedScalarPaths ?? []);
|
|
4752
4796
|
return live;
|
|
4753
4797
|
}
|
|
4754
4798
|
function remapSortedIndexToDeclared(path, arrayKey, sortedDeclared, rawDeclared) {
|
|
@@ -5571,9 +5615,15 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
5571
5615
|
|
|
5572
5616
|
//#endregion
|
|
5573
5617
|
//#region src/read/client-config.ts
|
|
5618
|
+
const CLIENT_TIMEOUTS = { requestHandler: {
|
|
5619
|
+
connectionTimeout: 6e3,
|
|
5620
|
+
requestTimeout: 6e4,
|
|
5621
|
+
throwOnRequestTimeout: true
|
|
5622
|
+
} };
|
|
5574
5623
|
const READ_RETRY = {
|
|
5575
5624
|
maxAttempts: 10,
|
|
5576
|
-
retryMode: "adaptive"
|
|
5625
|
+
retryMode: "adaptive",
|
|
5626
|
+
...CLIENT_TIMEOUTS
|
|
5577
5627
|
};
|
|
5578
5628
|
|
|
5579
5629
|
//#endregion
|
|
@@ -8346,6 +8396,10 @@ const readCodeBuildProject = async ({ physicalId, declared, region }) => {
|
|
|
8346
8396
|
...cache.location !== void 0 && { Location: cache.location },
|
|
8347
8397
|
...cache.modes?.length && { Modes: cache.modes }
|
|
8348
8398
|
};
|
|
8399
|
+
if (Array.isArray(p.tags) && p.tags.length > 0) model.Tags = p.tags.map((t) => ({
|
|
8400
|
+
Key: t.key,
|
|
8401
|
+
Value: t.value
|
|
8402
|
+
}));
|
|
8349
8403
|
return model;
|
|
8350
8404
|
};
|
|
8351
8405
|
const readServiceDiscoveryNamespace = async ({ physicalId, region }) => {
|
|
@@ -9319,6 +9373,11 @@ const CC_IDENTIFIER_ADAPTERS = {
|
|
|
9319
9373
|
"AWS::ApiGatewayV2::Integration": compositeWith("ApiId"),
|
|
9320
9374
|
"AWS::ApiGatewayV2::Model": compositeWith("ApiId"),
|
|
9321
9375
|
"AWS::ApiGatewayV2::Deployment": compositeWith("ApiId"),
|
|
9376
|
+
"AWS::ApiGatewayV2::ApiMapping": (pid, declared) => {
|
|
9377
|
+
if (pid.includes("|")) return pid;
|
|
9378
|
+
const domainName = declared.DomainName;
|
|
9379
|
+
return typeof domainName === "string" && domainName.length > 0 ? `${pid}|${domainName}` : void 0;
|
|
9380
|
+
},
|
|
9322
9381
|
"AWS::ApiGatewayV2::Authorizer": (pid, declared) => {
|
|
9323
9382
|
if (pid.includes("|")) return pid;
|
|
9324
9383
|
const apiId = declared.ApiId;
|
|
@@ -9364,6 +9423,12 @@ const CC_IDENTIFIER_ADAPTERS = {
|
|
|
9364
9423
|
const restApiId = declared.RestApiId;
|
|
9365
9424
|
return typeof restApiId === "string" && restApiId.length > 0 ? `${pid}|${restApiId}` : void 0;
|
|
9366
9425
|
},
|
|
9426
|
+
"AWS::ApiGateway::BasePathMapping": (pid, declared) => {
|
|
9427
|
+
if (pid.includes("|")) return pid;
|
|
9428
|
+
const domainName = declared.DomainName;
|
|
9429
|
+
if (typeof domainName !== "string" || domainName.length === 0) return void 0;
|
|
9430
|
+
return `${domainName}|${typeof declared.BasePath === "string" ? declared.BasePath : ""}`;
|
|
9431
|
+
},
|
|
9367
9432
|
"AWS::ApplicationAutoScaling::ScalingPolicy": scalingPolicyComposite,
|
|
9368
9433
|
"AWS::ECS::Service": (pid, declared) => {
|
|
9369
9434
|
if (pid.includes("|")) return pid;
|
|
@@ -10567,7 +10632,10 @@ const writeS3BucketPolicy = async (ctx, ops) => {
|
|
|
10567
10632
|
const bucket = str(ctx.declared["Bucket"]);
|
|
10568
10633
|
if (!bucket) throw new Error("cannot resolve bucket for revert");
|
|
10569
10634
|
const desired = policyJson(await desiredModel("AWS::S3::BucketPolicy", ctx, ops));
|
|
10570
|
-
const c = new S3Client({
|
|
10635
|
+
const c = new S3Client({
|
|
10636
|
+
region: ctx.region,
|
|
10637
|
+
...CLIENT_TIMEOUTS
|
|
10638
|
+
});
|
|
10571
10639
|
if (desired === void 0) await c.send(new DeleteBucketPolicyCommand({ Bucket: bucket }));
|
|
10572
10640
|
else await c.send(new PutBucketPolicyCommand({
|
|
10573
10641
|
Bucket: bucket,
|
|
@@ -10578,7 +10646,10 @@ const writeSnsTopicPolicy = async (ctx, ops) => {
|
|
|
10578
10646
|
const topics = strList(ctx.declared["Topics"]);
|
|
10579
10647
|
if (topics.length === 0) throw new Error("cannot resolve topic for revert");
|
|
10580
10648
|
const desired = policyJson(await desiredModel("AWS::SNS::TopicPolicy", ctx, ops)) ?? "";
|
|
10581
|
-
const c = new SNSClient({
|
|
10649
|
+
const c = new SNSClient({
|
|
10650
|
+
region: ctx.region,
|
|
10651
|
+
...CLIENT_TIMEOUTS
|
|
10652
|
+
});
|
|
10582
10653
|
for (const topic of topics) await c.send(new SetTopicAttributesCommand({
|
|
10583
10654
|
TopicArn: topic,
|
|
10584
10655
|
AttributeName: "Policy",
|
|
@@ -10589,7 +10660,10 @@ const writeSqsQueuePolicy = async (ctx, ops) => {
|
|
|
10589
10660
|
const queues = strList(ctx.declared["Queues"]);
|
|
10590
10661
|
if (queues.length === 0) throw new Error("cannot resolve queue for revert");
|
|
10591
10662
|
const desired = policyJson(await desiredModel("AWS::SQS::QueuePolicy", ctx, ops)) ?? "";
|
|
10592
|
-
const c = new SQSClient({
|
|
10663
|
+
const c = new SQSClient({
|
|
10664
|
+
region: ctx.region,
|
|
10665
|
+
...CLIENT_TIMEOUTS
|
|
10666
|
+
});
|
|
10593
10667
|
for (const queue of queues) await c.send(new SetQueueAttributesCommand({
|
|
10594
10668
|
QueueUrl: queue,
|
|
10595
10669
|
Attributes: { Policy: desired }
|
|
@@ -10599,7 +10673,10 @@ const writeEventBusPolicy = async (ctx) => {
|
|
|
10599
10673
|
const eventBusName = str(ctx.declared["EventBusName"]) ?? "default";
|
|
10600
10674
|
const statementId = str(ctx.declared["StatementId"]);
|
|
10601
10675
|
if (!statementId) throw new Error("cannot resolve StatementId for EventBusPolicy revert");
|
|
10602
|
-
const c = new EventBridgeClient({
|
|
10676
|
+
const c = new EventBridgeClient({
|
|
10677
|
+
region: ctx.region,
|
|
10678
|
+
...CLIENT_TIMEOUTS
|
|
10679
|
+
});
|
|
10603
10680
|
const declaredStmt = ctx.declared["Statement"];
|
|
10604
10681
|
let desiredStatement;
|
|
10605
10682
|
if (declaredStmt && typeof declaredStmt === "object" && !Array.isArray(declaredStmt)) desiredStatement = {
|
|
@@ -10642,7 +10719,10 @@ const writeIamPolicy = async (ctx, ops) => {
|
|
|
10642
10719
|
if (!name) throw new Error("cannot resolve policy name for revert");
|
|
10643
10720
|
const desired = policyJson(await desiredModel("AWS::IAM::Policy", ctx, ops));
|
|
10644
10721
|
if (desired === void 0) throw new Error("cannot revert an IAM inline policy to absent");
|
|
10645
|
-
const c = new IAMClient({
|
|
10722
|
+
const c = new IAMClient({
|
|
10723
|
+
region: ctx.region,
|
|
10724
|
+
...CLIENT_TIMEOUTS
|
|
10725
|
+
});
|
|
10646
10726
|
const roles = strList(ctx.declared["Roles"]);
|
|
10647
10727
|
const users = strList(ctx.declared["Users"]);
|
|
10648
10728
|
const groups = strList(ctx.declared["Groups"]);
|
|
@@ -10691,7 +10771,10 @@ const parseAttachmentOp = (o) => {
|
|
|
10691
10771
|
const writeIamManagedPolicy = async (ctx, ops) => {
|
|
10692
10772
|
const arn = isArn(ctx.physicalId) ?? isArn(ctx.declared["ManagedPolicyArn"]);
|
|
10693
10773
|
if (!arn) throw new Error("cannot resolve managed policy arn for revert");
|
|
10694
|
-
const c = new IAMClient({
|
|
10774
|
+
const c = new IAMClient({
|
|
10775
|
+
region: ctx.region,
|
|
10776
|
+
...CLIENT_TIMEOUTS
|
|
10777
|
+
});
|
|
10695
10778
|
for (const o of ops) {
|
|
10696
10779
|
const parsed = parseAttachmentOp(o);
|
|
10697
10780
|
if (!parsed) continue;
|
|
@@ -10741,7 +10824,10 @@ const asInlinePolicies = (v) => Array.isArray(v) ? v.filter((p) => !!p && typeof
|
|
|
10741
10824
|
const writeIamRoleInlinePolicies = async (ctx, ops) => {
|
|
10742
10825
|
const role = str(ctx.physicalId);
|
|
10743
10826
|
if (!role) throw new Error("cannot resolve role name for revert");
|
|
10744
|
-
const c = new IAMClient({
|
|
10827
|
+
const c = new IAMClient({
|
|
10828
|
+
region: ctx.region,
|
|
10829
|
+
...CLIENT_TIMEOUTS
|
|
10830
|
+
});
|
|
10745
10831
|
for (const op of ops) {
|
|
10746
10832
|
if (op.path !== "/Policies") throw new Error(`unsupported inline-policy revert path: ${op.path}`);
|
|
10747
10833
|
const desired = op.op === "add" ? asInlinePolicies(op.value) : [];
|
|
@@ -10766,7 +10852,10 @@ const writeElbLoadBalancerAttributes = async (ctx, ops) => {
|
|
|
10766
10852
|
if (!arn) throw new Error("cannot resolve load balancer arn for revert");
|
|
10767
10853
|
const attrs = elbAttributeOps(ops);
|
|
10768
10854
|
if (attrs.length === 0) return;
|
|
10769
|
-
await new ElasticLoadBalancingV2Client({
|
|
10855
|
+
await new ElasticLoadBalancingV2Client({
|
|
10856
|
+
region: ctx.region,
|
|
10857
|
+
...CLIENT_TIMEOUTS
|
|
10858
|
+
}).send(new ModifyLoadBalancerAttributesCommand({
|
|
10770
10859
|
LoadBalancerArn: arn,
|
|
10771
10860
|
Attributes: attrs
|
|
10772
10861
|
}));
|
|
@@ -10776,7 +10865,10 @@ const writeElbTargetGroupAttributes = async (ctx, ops) => {
|
|
|
10776
10865
|
if (!arn) throw new Error("cannot resolve target group arn for revert");
|
|
10777
10866
|
const attrs = elbAttributeOps(ops);
|
|
10778
10867
|
if (attrs.length === 0) return;
|
|
10779
|
-
await new ElasticLoadBalancingV2Client({
|
|
10868
|
+
await new ElasticLoadBalancingV2Client({
|
|
10869
|
+
region: ctx.region,
|
|
10870
|
+
...CLIENT_TIMEOUTS
|
|
10871
|
+
}).send(new ModifyTargetGroupAttributesCommand({
|
|
10780
10872
|
TargetGroupArn: arn,
|
|
10781
10873
|
Attributes: attrs
|
|
10782
10874
|
}));
|
|
@@ -10785,7 +10877,10 @@ const writeServiceDiscoveryHttpNamespace = async (ctx, ops) => {
|
|
|
10785
10877
|
const id = str(ctx.physicalId);
|
|
10786
10878
|
if (!id) throw new Error("cannot resolve namespace id for revert");
|
|
10787
10879
|
const m = await desiredModel("AWS::ServiceDiscovery::HttpNamespace", ctx, ops);
|
|
10788
|
-
await new ServiceDiscoveryClient({
|
|
10880
|
+
await new ServiceDiscoveryClient({
|
|
10881
|
+
region: ctx.region,
|
|
10882
|
+
...CLIENT_TIMEOUTS
|
|
10883
|
+
}).send(new UpdateHttpNamespaceCommand({
|
|
10789
10884
|
Id: id,
|
|
10790
10885
|
Namespace: { Description: str(m.Description) ?? "" }
|
|
10791
10886
|
}));
|
|
@@ -10815,7 +10910,10 @@ const writeDocDbCluster = async (ctx, ops) => {
|
|
|
10815
10910
|
any = true;
|
|
10816
10911
|
}
|
|
10817
10912
|
if (!any) return;
|
|
10818
|
-
await new DocDBClient({
|
|
10913
|
+
await new DocDBClient({
|
|
10914
|
+
region: ctx.region,
|
|
10915
|
+
...CLIENT_TIMEOUTS
|
|
10916
|
+
}).send(new ModifyDBClusterCommand(input));
|
|
10819
10917
|
};
|
|
10820
10918
|
const DOCDB_INSTANCE_MODIFY_PARAMS = new Set([
|
|
10821
10919
|
"DBInstanceClass",
|
|
@@ -10841,12 +10939,18 @@ const writeDocDbInstance = async (ctx, ops) => {
|
|
|
10841
10939
|
any = true;
|
|
10842
10940
|
}
|
|
10843
10941
|
if (!any) return;
|
|
10844
|
-
await new DocDBClient({
|
|
10942
|
+
await new DocDBClient({
|
|
10943
|
+
region: ctx.region,
|
|
10944
|
+
...CLIENT_TIMEOUTS
|
|
10945
|
+
}).send(new ModifyDBInstanceCommand(input));
|
|
10845
10946
|
};
|
|
10846
10947
|
const writeCloudFrontDistribution = async (ctx, ops) => {
|
|
10847
10948
|
const id = str(ctx.physicalId);
|
|
10848
10949
|
if (!id) throw new Error("cannot resolve distribution id for revert");
|
|
10849
|
-
const c = new CloudFrontClient({
|
|
10950
|
+
const c = new CloudFrontClient({
|
|
10951
|
+
region: ctx.region,
|
|
10952
|
+
...CLIENT_TIMEOUTS
|
|
10953
|
+
});
|
|
10850
10954
|
const cur = await c.send(new GetDistributionConfigCommand({ Id: id }));
|
|
10851
10955
|
if (!cur.DistributionConfig || !cur.ETag) throw new Error("could not read current distribution config for revert");
|
|
10852
10956
|
const reverted = applyOps({ DistributionConfig: cur.DistributionConfig }, ops);
|
|
@@ -10871,7 +10975,10 @@ const WAF_UPDATABLE_PASSTHROUGH = [
|
|
|
10871
10975
|
const writeWafv2WebAcl = async (ctx, ops) => {
|
|
10872
10976
|
const [name, id, scope] = (str(ctx.physicalId) ?? "").split("|");
|
|
10873
10977
|
if (!name || !id || !scope) throw new Error("cannot resolve WebACL Name|Id|Scope for revert");
|
|
10874
|
-
const c = new WAFV2Client({
|
|
10978
|
+
const c = new WAFV2Client({
|
|
10979
|
+
region: ctx.region,
|
|
10980
|
+
...CLIENT_TIMEOUTS
|
|
10981
|
+
});
|
|
10875
10982
|
const cur = await c.send(new GetWebACLCommand({
|
|
10876
10983
|
Name: name,
|
|
10877
10984
|
Id: id,
|
|
@@ -10917,7 +11024,10 @@ const GLUE_JOB_UPDATE_FIELDS = [
|
|
|
10917
11024
|
const writeGlueJob = async (ctx, ops) => {
|
|
10918
11025
|
const name = str(ctx.physicalId) ?? str(ctx.declared["Name"]);
|
|
10919
11026
|
if (!name) throw new Error("cannot resolve Glue job name for revert");
|
|
10920
|
-
const c = new GlueClient({
|
|
11027
|
+
const c = new GlueClient({
|
|
11028
|
+
region: ctx.region,
|
|
11029
|
+
...CLIENT_TIMEOUTS
|
|
11030
|
+
});
|
|
10921
11031
|
const got = await c.send(new GetJobCommand({ JobName: name }));
|
|
10922
11032
|
if (!got.Job) throw new Error("could not read current Glue job for revert");
|
|
10923
11033
|
const m = applyOps(got.Job, ops);
|
|
@@ -10938,7 +11048,10 @@ const writeGlueTable = async (ctx, ops) => {
|
|
|
10938
11048
|
const tableInput = m.TableInput;
|
|
10939
11049
|
if (!dbName || !tableInput || !str(tableInput.Name)) throw new Error("cannot resolve Glue table target for revert");
|
|
10940
11050
|
const catalogId = str(m.CatalogId) ?? str(ctx.declared["CatalogId"]);
|
|
10941
|
-
await new GlueClient({
|
|
11051
|
+
await new GlueClient({
|
|
11052
|
+
region: ctx.region,
|
|
11053
|
+
...CLIENT_TIMEOUTS
|
|
11054
|
+
}).send(new UpdateTableCommand({
|
|
10942
11055
|
DatabaseName: dbName,
|
|
10943
11056
|
TableInput: tableInput,
|
|
10944
11057
|
...catalogId && { CatalogId: catalogId }
|
|
@@ -10960,7 +11073,10 @@ const writeGlueClassifier = async (ctx, ops) => {
|
|
|
10960
11073
|
}
|
|
10961
11074
|
}
|
|
10962
11075
|
if (Object.keys(input).length === 0) throw new Error("cannot resolve Glue classifier target for revert");
|
|
10963
|
-
await new GlueClient({
|
|
11076
|
+
await new GlueClient({
|
|
11077
|
+
region: ctx.region,
|
|
11078
|
+
...CLIENT_TIMEOUTS
|
|
11079
|
+
}).send(new UpdateClassifierCommand(input));
|
|
10964
11080
|
};
|
|
10965
11081
|
const writeGlueWorkflow = async (ctx, ops) => {
|
|
10966
11082
|
const m = await desiredModel("AWS::Glue::Workflow", ctx, ops);
|
|
@@ -10974,7 +11090,10 @@ const writeGlueWorkflow = async (ctx, ops) => {
|
|
|
10974
11090
|
if (m.DefaultRunProperties !== void 0) input.DefaultRunProperties = m.DefaultRunProperties;
|
|
10975
11091
|
else if (removed("DefaultRunProperties")) input.DefaultRunProperties = {};
|
|
10976
11092
|
if (m.MaxConcurrentRuns !== void 0) input.MaxConcurrentRuns = Number(m.MaxConcurrentRuns);
|
|
10977
|
-
await new GlueClient({
|
|
11093
|
+
await new GlueClient({
|
|
11094
|
+
region: ctx.region,
|
|
11095
|
+
...CLIENT_TIMEOUTS
|
|
11096
|
+
}).send(new UpdateWorkflowCommand(input));
|
|
10978
11097
|
};
|
|
10979
11098
|
const GLUE_CONNECTION_PASSWORD_KEY = /PASSWORD/i;
|
|
10980
11099
|
const writeGlueConnection = async (ctx, ops) => {
|
|
@@ -10986,7 +11105,10 @@ const writeGlueConnection = async (ctx, ops) => {
|
|
|
10986
11105
|
const name = str(ci?.Name) ?? str(ctx.physicalId) ?? str(declInput?.Name);
|
|
10987
11106
|
if (!ci || !name) throw new Error("cannot resolve Glue connection target for revert");
|
|
10988
11107
|
const catalogId = str(m.CatalogId) ?? str(ctx.declared["CatalogId"]);
|
|
10989
|
-
await new GlueClient({
|
|
11108
|
+
await new GlueClient({
|
|
11109
|
+
region: ctx.region,
|
|
11110
|
+
...CLIENT_TIMEOUTS
|
|
11111
|
+
}).send(new UpdateConnectionCommand({
|
|
10990
11112
|
Name: name,
|
|
10991
11113
|
...catalogId && { CatalogId: catalogId },
|
|
10992
11114
|
ConnectionInput: {
|
|
@@ -11001,7 +11123,10 @@ const writeSesReceiptRule = async (ctx, ops) => {
|
|
|
11001
11123
|
const ruleSetName = str(m.RuleSetName) ?? str(ctx.declared["RuleSetName"]);
|
|
11002
11124
|
const rule = m.Rule;
|
|
11003
11125
|
if (!ruleSetName || !rule || !str(rule.Name)) throw new Error("cannot resolve SES receipt rule target for revert");
|
|
11004
|
-
await new SESClient({
|
|
11126
|
+
await new SESClient({
|
|
11127
|
+
region: ctx.region,
|
|
11128
|
+
...CLIENT_TIMEOUTS
|
|
11129
|
+
}).send(new UpdateReceiptRuleCommand({
|
|
11005
11130
|
RuleSetName: ruleSetName,
|
|
11006
11131
|
Rule: rule
|
|
11007
11132
|
}));
|
|
@@ -11021,7 +11146,10 @@ const writeCloudWatchAnomalyDetector = async (ctx, ops) => {
|
|
|
11021
11146
|
EndTime: toDate(r.EndTime)
|
|
11022
11147
|
})) }
|
|
11023
11148
|
};
|
|
11024
|
-
await new CloudWatchClient({
|
|
11149
|
+
await new CloudWatchClient({
|
|
11150
|
+
region: ctx.region,
|
|
11151
|
+
...CLIENT_TIMEOUTS
|
|
11152
|
+
}).send(new PutAnomalyDetectorCommand({
|
|
11025
11153
|
...single && { SingleMetricAnomalyDetector: single },
|
|
11026
11154
|
...math && { MetricMathAnomalyDetector: math },
|
|
11027
11155
|
...!single && !math && { SingleMetricAnomalyDetector: {
|
|
@@ -11040,7 +11168,10 @@ const writeDlmLifecyclePolicy = async (ctx, ops) => {
|
|
|
11040
11168
|
const top = o.path.replace(/^\//, "").split("/")[0] ?? "";
|
|
11041
11169
|
if (o.op === "remove" && (top === "State" || top === "Description" || top === "ExecutionRoleArn")) throw new Error(`DLM LifecyclePolicy ${top} cannot be cleared via UpdateLifecyclePolicy (no safe clearing value; needs live confirmation); update it manually`);
|
|
11042
11170
|
}
|
|
11043
|
-
const c = new DLMClient({
|
|
11171
|
+
const c = new DLMClient({
|
|
11172
|
+
region: ctx.region,
|
|
11173
|
+
...CLIENT_TIMEOUTS
|
|
11174
|
+
});
|
|
11044
11175
|
const m = await desiredModel("AWS::DLM::LifecyclePolicy", ctx, ops);
|
|
11045
11176
|
let details = m.PolicyDetails;
|
|
11046
11177
|
if (details === void 0 && DLM_DEFAULT_POLICY_SHORTHAND.some((k) => m[k] !== void 0)) {
|
|
@@ -11068,7 +11199,10 @@ const writeMetricFilter = async (ctx, ops) => {
|
|
|
11068
11199
|
...t.Unit !== void 0 && { unit: t.Unit },
|
|
11069
11200
|
...t.Dimensions !== void 0 && { dimensions: t.Dimensions }
|
|
11070
11201
|
}));
|
|
11071
|
-
await new CloudWatchLogsClient({
|
|
11202
|
+
await new CloudWatchLogsClient({
|
|
11203
|
+
region: ctx.region,
|
|
11204
|
+
...CLIENT_TIMEOUTS
|
|
11205
|
+
}).send(new PutMetricFilterCommand({
|
|
11072
11206
|
logGroupName: logGroup,
|
|
11073
11207
|
filterName,
|
|
11074
11208
|
filterPattern: str(m.FilterPattern) ?? "",
|
|
@@ -11101,7 +11235,10 @@ const writeRoute53RecordSet = async (ctx, ops) => {
|
|
|
11101
11235
|
if (Array.isArray(m.ResourceRecords)) rrset.ResourceRecords = m.ResourceRecords.map((v) => ({ Value: v }));
|
|
11102
11236
|
if (m.AliasTarget !== void 0) rrset.AliasTarget = m.AliasTarget;
|
|
11103
11237
|
for (const k of RR_ROUTING_FIELDS) if (m[k] !== void 0) rrset[k] = m[k];
|
|
11104
|
-
await new Route53Client({
|
|
11238
|
+
await new Route53Client({
|
|
11239
|
+
region: ctx.region,
|
|
11240
|
+
...CLIENT_TIMEOUTS
|
|
11241
|
+
}).send(new ChangeResourceRecordSetsCommand({
|
|
11105
11242
|
HostedZoneId: zone,
|
|
11106
11243
|
ChangeBatch: { Changes: [{
|
|
11107
11244
|
Action: "UPSERT",
|
|
@@ -11129,7 +11266,10 @@ const writeConfigRuleInputParameters = async (ctx, ops) => {
|
|
|
11129
11266
|
const op = ops.find((o) => o.path === "/InputParameters");
|
|
11130
11267
|
if (!op) throw new Error("Config rule InputParameters revert: op not found");
|
|
11131
11268
|
if (op.op !== "add") throw new Error("Config rule InputParameters cannot be cleared via revert: PutConfigRule re-PUTs the whole rule and the exact clearing payload (omit vs empty {}) needs live confirmation; clear it manually");
|
|
11132
|
-
const client = new ConfigServiceClient({
|
|
11269
|
+
const client = new ConfigServiceClient({
|
|
11270
|
+
region: ctx.region,
|
|
11271
|
+
...CLIENT_TIMEOUTS
|
|
11272
|
+
});
|
|
11133
11273
|
const rule = (await client.send(new DescribeConfigRulesCommand({ ConfigRuleNames: [name] }))).ConfigRules?.[0];
|
|
11134
11274
|
if (!rule) throw new Error(`Config rule not found for revert: ${name}`);
|
|
11135
11275
|
const { ConfigRuleArn, ConfigRuleId, ConfigRuleState, CreatedBy, RuleEvaluationVisibility, ...rest } = rule;
|
|
@@ -11160,7 +11300,10 @@ const writeOpenSearchDomain = async (ctx, ops) => {
|
|
|
11160
11300
|
const name = str(ctx.physicalId) ?? str(ctx.declared["DomainName"]);
|
|
11161
11301
|
if (!name) throw new Error("cannot resolve OpenSearch domain name for revert");
|
|
11162
11302
|
const touched = new Set(ops.map((o) => o.path.replace(/^\//, "").split("/")[0]).filter((p) => !!p));
|
|
11163
|
-
const c = new OpenSearchClient({
|
|
11303
|
+
const c = new OpenSearchClient({
|
|
11304
|
+
region: ctx.region,
|
|
11305
|
+
...CLIENT_TIMEOUTS
|
|
11306
|
+
});
|
|
11164
11307
|
const cfg = (await c.send(new DescribeDomainConfigCommand({ DomainName: name }))).DomainConfig;
|
|
11165
11308
|
const model = {};
|
|
11166
11309
|
for (const p of touched) if (cfg?.[p]?.Options !== void 0) model[p] = cfg[p].Options;
|
|
@@ -11178,7 +11321,10 @@ const writeOpenSearchDomain = async (ctx, ops) => {
|
|
|
11178
11321
|
const writeLogGroupBearerTokenAuth = async (ctx, ops) => {
|
|
11179
11322
|
const lg = str(ctx.physicalId) ?? str(ctx.declared["LogGroupName"]);
|
|
11180
11323
|
if (!lg) throw new Error("cannot resolve log group name for revert");
|
|
11181
|
-
const c = new CloudWatchLogsClient({
|
|
11324
|
+
const c = new CloudWatchLogsClient({
|
|
11325
|
+
region: ctx.region,
|
|
11326
|
+
...CLIENT_TIMEOUTS
|
|
11327
|
+
});
|
|
11182
11328
|
for (const op of ops) {
|
|
11183
11329
|
const enabled = op.op === "add" ? op.value === true : false;
|
|
11184
11330
|
await c.send(new PutBearerTokenAuthenticationCommand({
|
|
@@ -11190,7 +11336,10 @@ const writeLogGroupBearerTokenAuth = async (ctx, ops) => {
|
|
|
11190
11336
|
const writeCognitoIdentityPoolEvents = async (ctx, ops) => {
|
|
11191
11337
|
const id = str(ctx.physicalId) ?? str(ctx.declared["Id"]);
|
|
11192
11338
|
if (!id) throw new Error("cannot resolve identity pool id for CognitoEvents revert");
|
|
11193
|
-
const c = new CognitoSyncClient({
|
|
11339
|
+
const c = new CognitoSyncClient({
|
|
11340
|
+
region: ctx.region,
|
|
11341
|
+
...CLIENT_TIMEOUTS
|
|
11342
|
+
});
|
|
11194
11343
|
const cur = (await c.send(new GetCognitoEventsCommand({ IdentityPoolId: id }))).Events ?? {};
|
|
11195
11344
|
const events = { ...applyOps({ CognitoEvents: { ...cur } }, ops).CognitoEvents ?? {} };
|
|
11196
11345
|
for (const k of Object.keys(cur)) if (!(k in events)) events[k] = "";
|
|
@@ -11273,7 +11422,10 @@ const writeApiGatewayMethod = async (ctx, ops) => {
|
|
|
11273
11422
|
for (const op of ops) for (const p of apigwKnobPatches(op)) if (p.kind === "integration") integrationPatches.push(p.patch);
|
|
11274
11423
|
else if (p.kind === "integrationResponse") pushByKey(integrationRespPatches, p.statusCode, p.patch);
|
|
11275
11424
|
else pushByKey(methodRespPatches, p.statusCode, p.patch);
|
|
11276
|
-
const c = new APIGatewayClient({
|
|
11425
|
+
const c = new APIGatewayClient({
|
|
11426
|
+
region: ctx.region,
|
|
11427
|
+
...CLIENT_TIMEOUTS
|
|
11428
|
+
});
|
|
11277
11429
|
if (integrationPatches.length > 0) await c.send(new UpdateIntegrationCommand({
|
|
11278
11430
|
restApiId,
|
|
11279
11431
|
resourceId,
|
|
@@ -11320,14 +11472,20 @@ const writeEcsServiceWriteOnlyProps = async (ctx, ops) => {
|
|
|
11320
11472
|
const declared = ctx.declared["VolumeConfigurations"];
|
|
11321
11473
|
input.volumeConfigurations = Array.isArray(declared) ? camelKeysDeep(declared) : [];
|
|
11322
11474
|
}
|
|
11323
|
-
await new ECSClient({
|
|
11475
|
+
await new ECSClient({
|
|
11476
|
+
region: ctx.region,
|
|
11477
|
+
...CLIENT_TIMEOUTS
|
|
11478
|
+
}).send(new UpdateServiceCommand(input));
|
|
11324
11479
|
};
|
|
11325
11480
|
const writeMskConfiguration = async (ctx, ops) => {
|
|
11326
11481
|
const arn = str(ctx.physicalId);
|
|
11327
11482
|
if (!arn) throw new Error("cannot resolve MSK Configuration ARN for revert");
|
|
11328
11483
|
const op = ops.find((o) => o.path === "/ServerProperties");
|
|
11329
11484
|
if (op === void 0 || op.op === "remove" || typeof op.value !== "string") throw new Error("MSK Configuration ServerProperties revert: unexpected op");
|
|
11330
|
-
await new KafkaClient({
|
|
11485
|
+
await new KafkaClient({
|
|
11486
|
+
region: ctx.region,
|
|
11487
|
+
...CLIENT_TIMEOUTS
|
|
11488
|
+
}).send(new UpdateConfigurationCommand({
|
|
11331
11489
|
Arn: arn,
|
|
11332
11490
|
ServerProperties: new TextEncoder().encode(op.value)
|
|
11333
11491
|
}));
|
|
@@ -11356,7 +11514,10 @@ const writeCodeBuildReportGroup = async (ctx, ops) => {
|
|
|
11356
11514
|
key: str(t.Key),
|
|
11357
11515
|
value: str(t.Value)
|
|
11358
11516
|
})) : [];
|
|
11359
|
-
await new CodeBuildClient({
|
|
11517
|
+
await new CodeBuildClient({
|
|
11518
|
+
region: ctx.region,
|
|
11519
|
+
...CLIENT_TIMEOUTS
|
|
11520
|
+
}).send(new UpdateReportGroupCommand(input));
|
|
11360
11521
|
};
|
|
11361
11522
|
const DAX_CLUSTER_MODIFY_PARAMS = {
|
|
11362
11523
|
Description: "Description",
|
|
@@ -11382,7 +11543,10 @@ const writeDaxCluster = async (ctx, ops) => {
|
|
|
11382
11543
|
any = true;
|
|
11383
11544
|
}
|
|
11384
11545
|
if (!any) return;
|
|
11385
|
-
await new DAXClient({
|
|
11546
|
+
await new DAXClient({
|
|
11547
|
+
region: ctx.region,
|
|
11548
|
+
...CLIENT_TIMEOUTS
|
|
11549
|
+
}).send(new UpdateClusterCommand(input));
|
|
11386
11550
|
};
|
|
11387
11551
|
const writeDaxParameterGroup = async (ctx, ops) => {
|
|
11388
11552
|
const name = str(ctx.physicalId) ?? str(ctx.declared["ParameterGroupName"]);
|
|
@@ -11400,7 +11564,10 @@ const writeDaxParameterGroup = async (ctx, ops) => {
|
|
|
11400
11564
|
ParameterValue: desiredValues[k]
|
|
11401
11565
|
}));
|
|
11402
11566
|
if (values.length === 0) return;
|
|
11403
|
-
await new DAXClient({
|
|
11567
|
+
await new DAXClient({
|
|
11568
|
+
region: ctx.region,
|
|
11569
|
+
...CLIENT_TIMEOUTS
|
|
11570
|
+
}).send(new UpdateParameterGroupCommand({
|
|
11404
11571
|
ParameterGroupName: name,
|
|
11405
11572
|
ParameterNameValues: values
|
|
11406
11573
|
}));
|
|
@@ -11420,7 +11587,10 @@ const writeElastiCacheParameterGroup = async (ctx, ops) => {
|
|
|
11420
11587
|
} else if (key !== void 0) modifyKeys.add(key);
|
|
11421
11588
|
else for (const k of Object.keys(desiredValues)) modifyKeys.add(k);
|
|
11422
11589
|
}
|
|
11423
|
-
const c = new ElastiCacheClient({
|
|
11590
|
+
const c = new ElastiCacheClient({
|
|
11591
|
+
region: ctx.region,
|
|
11592
|
+
...CLIENT_TIMEOUTS
|
|
11593
|
+
});
|
|
11424
11594
|
const modify = [...modifyKeys].filter((k) => typeof desiredValues[k] === "string").map((k) => ({
|
|
11425
11595
|
ParameterName: k,
|
|
11426
11596
|
ParameterValue: desiredValues[k]
|
|
@@ -11451,7 +11621,10 @@ const writeMemoryDbParameterGroup = async (ctx, ops) => {
|
|
|
11451
11621
|
} else if (key !== void 0) modifyKeys.add(key);
|
|
11452
11622
|
else for (const k of Object.keys(desiredValues)) modifyKeys.add(k);
|
|
11453
11623
|
}
|
|
11454
|
-
const c = new MemoryDBClient({
|
|
11624
|
+
const c = new MemoryDBClient({
|
|
11625
|
+
region: ctx.region,
|
|
11626
|
+
...CLIENT_TIMEOUTS
|
|
11627
|
+
});
|
|
11455
11628
|
const modify = [...modifyKeys].filter((k) => typeof desiredValues[k] === "string").map((k) => ({
|
|
11456
11629
|
ParameterName: k,
|
|
11457
11630
|
ParameterValue: desiredValues[k]
|
|
@@ -11515,7 +11688,10 @@ const writeEc2ClientVpnEndpoint = async (ctx, ops) => {
|
|
|
11515
11688
|
} else if (removed("SecurityGroupIds")) throw new Error("EC2 ClientVpnEndpoint SecurityGroupIds cannot be cleared via ModifyClientVpnEndpoint (an endpoint cannot revert to no security group in a selective modify); update it manually");
|
|
11516
11689
|
}
|
|
11517
11690
|
if (!any) return;
|
|
11518
|
-
await new EC2Client({
|
|
11691
|
+
await new EC2Client({
|
|
11692
|
+
region: ctx.region,
|
|
11693
|
+
...CLIENT_TIMEOUTS
|
|
11694
|
+
}).send(new ModifyClientVpnEndpointCommand(input));
|
|
11519
11695
|
};
|
|
11520
11696
|
const LEX_CFN_TO_LEX_RESOLUTION_STRATEGY = {
|
|
11521
11697
|
ORIGINAL_VALUE: "OriginalValue",
|
|
@@ -11553,7 +11729,10 @@ const writeLexBotLocales = async (ctx, ops) => {
|
|
|
11553
11729
|
if (!botId) throw new Error("cannot resolve Lex Bot id for revert");
|
|
11554
11730
|
const declaredLocales = ctx.declared["BotLocales"];
|
|
11555
11731
|
if (!Array.isArray(declaredLocales)) throw new Error("Lex BotLocales revert: declared BotLocales is not an array");
|
|
11556
|
-
const c = new LexModelsV2Client({
|
|
11732
|
+
const c = new LexModelsV2Client({
|
|
11733
|
+
region: ctx.region,
|
|
11734
|
+
...CLIENT_TIMEOUTS
|
|
11735
|
+
});
|
|
11557
11736
|
const botVersion = "DRAFT";
|
|
11558
11737
|
for (const rawLocale of declaredLocales) {
|
|
11559
11738
|
if (!rawLocale || typeof rawLocale !== "object") continue;
|
|
@@ -11855,7 +12034,10 @@ const writeElasticBeanstalkApplication = async (ctx, ops) => {
|
|
|
11855
12034
|
}
|
|
11856
12035
|
}
|
|
11857
12036
|
if (!any) return;
|
|
11858
|
-
await new ElasticBeanstalkClient({
|
|
12037
|
+
await new ElasticBeanstalkClient({
|
|
12038
|
+
region: ctx.region,
|
|
12039
|
+
...CLIENT_TIMEOUTS
|
|
12040
|
+
}).send(new UpdateApplicationCommand(input));
|
|
11859
12041
|
};
|
|
11860
12042
|
const EB_ENVIRONMENT_MODIFY_PARAMS = new Set(["Description"]);
|
|
11861
12043
|
const writeElasticBeanstalkEnvironment = async (ctx, ops) => {
|
|
@@ -11871,7 +12053,10 @@ const writeElasticBeanstalkEnvironment = async (ctx, ops) => {
|
|
|
11871
12053
|
}
|
|
11872
12054
|
}
|
|
11873
12055
|
if (!any) return;
|
|
11874
|
-
await new ElasticBeanstalkClient({
|
|
12056
|
+
await new ElasticBeanstalkClient({
|
|
12057
|
+
region: ctx.region,
|
|
12058
|
+
...CLIENT_TIMEOUTS
|
|
12059
|
+
}).send(new UpdateEnvironmentCommand(input));
|
|
11875
12060
|
};
|
|
11876
12061
|
const KVS_STREAM_RETENTION_DEFAULT = 0;
|
|
11877
12062
|
const KVS_CHANNEL_MESSAGE_TTL_DEFAULT = 60;
|
|
@@ -11883,7 +12068,10 @@ const writeKinesisVideoStreamRetention = async (ctx, ops) => {
|
|
|
11883
12068
|
const op = ops.find((o) => o.path.replace(/^\//, "") === "DataRetentionInHours");
|
|
11884
12069
|
if (!op) return;
|
|
11885
12070
|
const target = op.op === "add" && typeof op.value === "number" ? op.value : KVS_STREAM_RETENTION_DEFAULT;
|
|
11886
|
-
const kv = new KinesisVideoClient({
|
|
12071
|
+
const kv = new KinesisVideoClient({
|
|
12072
|
+
region: ctx.region,
|
|
12073
|
+
...CLIENT_TIMEOUTS
|
|
12074
|
+
});
|
|
11887
12075
|
const desc = await kv.send(new DescribeStreamCommand(kvsStreamRef(id)));
|
|
11888
12076
|
const current = desc.StreamInfo?.DataRetentionInHours ?? 0;
|
|
11889
12077
|
const version = desc.StreamInfo?.Version;
|
|
@@ -11902,7 +12090,10 @@ const writeKinesisVideoSignalingChannel = async (ctx, ops) => {
|
|
|
11902
12090
|
const op = ops.find((o) => o.path.replace(/^\//, "") === "MessageTtlSeconds");
|
|
11903
12091
|
if (!op) return;
|
|
11904
12092
|
const target = op.op === "add" && typeof op.value === "number" ? op.value : KVS_CHANNEL_MESSAGE_TTL_DEFAULT;
|
|
11905
|
-
const kv = new KinesisVideoClient({
|
|
12093
|
+
const kv = new KinesisVideoClient({
|
|
12094
|
+
region: ctx.region,
|
|
12095
|
+
...CLIENT_TIMEOUTS
|
|
12096
|
+
});
|
|
11906
12097
|
const desc = await kv.send(new DescribeSignalingChannelCommand(kvsChannelDescribeRef(id)));
|
|
11907
12098
|
const arn = desc.ChannelInfo?.ChannelARN;
|
|
11908
12099
|
const version = desc.ChannelInfo?.Version;
|
|
@@ -11920,7 +12111,10 @@ const writeKinesisVideoStreamStorage = async (ctx, ops) => {
|
|
|
11920
12111
|
const op = ops.find((o) => o.path.replace(/^\//, "").replace(/\//g, ".").endsWith("DefaultStorageTier"));
|
|
11921
12112
|
if (!op) return;
|
|
11922
12113
|
const target = op.op === "add" && typeof op.value === "string" ? op.value : KVS_STREAM_STORAGE_TIER_DEFAULT;
|
|
11923
|
-
const kv = new KinesisVideoClient({
|
|
12114
|
+
const kv = new KinesisVideoClient({
|
|
12115
|
+
region: ctx.region,
|
|
12116
|
+
...CLIENT_TIMEOUTS
|
|
12117
|
+
});
|
|
11924
12118
|
const version = (await kv.send(new DescribeStreamCommand(kvsStreamRef(id)))).StreamInfo?.Version;
|
|
11925
12119
|
if (version === void 0) throw new Error(`cannot resolve stream version for ${id}`);
|
|
11926
12120
|
await kv.send(new UpdateStreamStorageConfigurationCommand({
|
|
@@ -11957,7 +12151,10 @@ const writeApiGatewayV2Stage = async (ctx, ops) => {
|
|
|
11957
12151
|
}
|
|
11958
12152
|
return [...keys];
|
|
11959
12153
|
};
|
|
11960
|
-
const client = new ApiGatewayV2Client({
|
|
12154
|
+
const client = new ApiGatewayV2Client({
|
|
12155
|
+
region: ctx.region,
|
|
12156
|
+
...CLIENT_TIMEOUTS
|
|
12157
|
+
});
|
|
11961
12158
|
if (touched.has("AccessLogSettings") && isCleared("AccessLogSettings")) await client.send(new DeleteAccessLogSettingsCommand({
|
|
11962
12159
|
ApiId: apiId,
|
|
11963
12160
|
StageName: stageName
|
|
@@ -11991,7 +12188,10 @@ const writeApiGatewayRestApiPolicy = async (ctx) => {
|
|
|
11991
12188
|
if (!restApiId) throw new Error("cannot resolve RestApiId for RestApi Policy revert");
|
|
11992
12189
|
const declaredPolicy = ctx.declared["Policy"];
|
|
11993
12190
|
const value = declaredPolicy === void 0 || declaredPolicy === null ? "" : typeof declaredPolicy === "string" ? declaredPolicy : JSON.stringify(declaredPolicy);
|
|
11994
|
-
await new APIGatewayClient({
|
|
12191
|
+
await new APIGatewayClient({
|
|
12192
|
+
region: ctx.region,
|
|
12193
|
+
...CLIENT_TIMEOUTS
|
|
12194
|
+
}).send(new UpdateRestApiCommand({
|
|
11995
12195
|
restApiId,
|
|
11996
12196
|
patchOperations: [{
|
|
11997
12197
|
op: "replace",
|
|
@@ -12075,7 +12275,10 @@ const writeCloudControlIndexNested = async (ctx, ops) => {
|
|
|
12075
12275
|
const type = ctx.resourceType;
|
|
12076
12276
|
if (!type) throw new Error("writeCloudControlIndexNested: resourceType missing on ctx");
|
|
12077
12277
|
const identifier = ctx.identifier ?? ctx.physicalId;
|
|
12078
|
-
const cc = new CloudControlClient({
|
|
12278
|
+
const cc = new CloudControlClient({
|
|
12279
|
+
region: ctx.region,
|
|
12280
|
+
...CLIENT_TIMEOUTS
|
|
12281
|
+
});
|
|
12079
12282
|
const got = await cc.send(new GetResourceCommand({
|
|
12080
12283
|
TypeName: type,
|
|
12081
12284
|
Identifier: identifier
|
|
@@ -13301,7 +13504,10 @@ async function revertStack(p) {
|
|
|
13301
13504
|
};
|
|
13302
13505
|
}
|
|
13303
13506
|
}
|
|
13304
|
-
const cc = new CloudControlClient({
|
|
13507
|
+
const cc = new CloudControlClient({
|
|
13508
|
+
region,
|
|
13509
|
+
...CLIENT_TIMEOUTS
|
|
13510
|
+
});
|
|
13305
13511
|
const byLogical = new Map(gathered.desired.resources.map((res) => [res.logicalId, res]));
|
|
13306
13512
|
const failedDeleteIds = /* @__PURE__ */ new Set();
|
|
13307
13513
|
const failedUpdateIds = /* @__PURE__ */ new Set();
|