cdk-real-drift 0.4.20 → 0.4.21
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 +21 -12
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1274,7 +1274,10 @@ function resolve$1(node, ctx, inCondition = false) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
case "Fn::FindInMap": {
|
|
1276
1276
|
if (!Array.isArray(v) || v.length < 3) return UNRESOLVED;
|
|
1277
|
-
const [mapName, topKey, secondKey] = v.slice(0, 3).map((x) =>
|
|
1277
|
+
const [mapName, topKey, secondKey] = v.slice(0, 3).map((x) => {
|
|
1278
|
+
const r = resolve$1(x, ctx);
|
|
1279
|
+
return typeof r === "number" || typeof r === "boolean" ? String(r) : r;
|
|
1280
|
+
});
|
|
1278
1281
|
if (typeof mapName !== "string" || typeof topKey !== "string" || typeof secondKey !== "string") return UNRESOLVED;
|
|
1279
1282
|
const val = ctx.mappings?.[mapName]?.[topKey]?.[secondKey];
|
|
1280
1283
|
if (val !== void 0) return val;
|
|
@@ -3517,7 +3520,8 @@ const READGAP_COLLECTION_PATHS = {
|
|
|
3517
3520
|
"AWS::Budgets::Budget": new Set(["NotificationsWithSubscribers"]),
|
|
3518
3521
|
"AWS::DynamoDB::GlobalTable": new Set(["SSESpecification"]),
|
|
3519
3522
|
"AWS::DynamoDB::Table": new Set(["SSESpecification"]),
|
|
3520
|
-
"AWS::CertificateManager::Certificate": new Set(["DomainValidationOptions"])
|
|
3523
|
+
"AWS::CertificateManager::Certificate": new Set(["DomainValidationOptions"]),
|
|
3524
|
+
"AWS::EC2::ClientVpnEndpoint": new Set(["TagSpecifications"])
|
|
3521
3525
|
};
|
|
3522
3526
|
const SCALAR_RETURNED_WHEN_SET = {
|
|
3523
3527
|
"AWS::NetworkFirewall::RuleGroup": new Set(["Description"]),
|
|
@@ -11749,24 +11753,28 @@ const writeEc2ClientVpnEndpoint = async (ctx, ops) => {
|
|
|
11749
11753
|
const desired = await desiredModel("AWS::EC2::ClientVpnEndpoint", ctx, ops);
|
|
11750
11754
|
const input = { ClientVpnEndpointId: id };
|
|
11751
11755
|
let any = false;
|
|
11756
|
+
const unExpressible = [];
|
|
11752
11757
|
const tops = new Set(ops.map((op) => op.path.replace(/^\//, "").split("/")[0] ?? ""));
|
|
11753
11758
|
const removed = (field) => ops.some((o) => o.op === "remove" && (o.path.replace(/^\//, "").split("/")[0] ?? "") === field);
|
|
11754
11759
|
for (const top of tops) if (CLIENT_VPN_SCALAR_PARAMS.has(top)) {
|
|
11755
11760
|
if (desired[top] !== void 0) {
|
|
11756
11761
|
input[top] = desired[top];
|
|
11757
11762
|
any = true;
|
|
11758
|
-
} else if (removed(top)) {
|
|
11759
|
-
|
|
11760
|
-
else if (top === "SplitTunnel") input.SplitTunnel = false;
|
|
11761
|
-
else if (top === "DisconnectOnSessionTimeout") input.DisconnectOnSessionTimeout = false;
|
|
11762
|
-
else throw new Error(`EC2 ClientVpnEndpoint ${top} cannot be cleared via ModifyClientVpnEndpoint (its unset state is not expressible in a selective modify); update it manually`);
|
|
11763
|
+
} else if (removed(top)) if (top === "Description") {
|
|
11764
|
+
input.Description = "";
|
|
11763
11765
|
any = true;
|
|
11764
|
-
}
|
|
11766
|
+
} else if (top === "SplitTunnel") {
|
|
11767
|
+
input.SplitTunnel = false;
|
|
11768
|
+
any = true;
|
|
11769
|
+
} else if (top === "DisconnectOnSessionTimeout") {
|
|
11770
|
+
input.DisconnectOnSessionTimeout = false;
|
|
11771
|
+
any = true;
|
|
11772
|
+
} else unExpressible.push(top);
|
|
11765
11773
|
} else if (top === "ConnectionLogOptions") {
|
|
11766
11774
|
if (desired.ConnectionLogOptions !== void 0) {
|
|
11767
11775
|
input.ConnectionLogOptions = desired.ConnectionLogOptions;
|
|
11768
11776
|
any = true;
|
|
11769
|
-
} else if (removed("ConnectionLogOptions"))
|
|
11777
|
+
} else if (removed("ConnectionLogOptions")) unExpressible.push("ConnectionLogOptions");
|
|
11770
11778
|
} else if (top === "DnsServers") {
|
|
11771
11779
|
const list = desired.DnsServers;
|
|
11772
11780
|
input.DnsServers = Array.isArray(list) && list.length > 0 ? {
|
|
@@ -11781,13 +11789,13 @@ const writeEc2ClientVpnEndpoint = async (ctx, ops) => {
|
|
|
11781
11789
|
input.SecurityGroupIds = list;
|
|
11782
11790
|
input.VpcId = vpcId;
|
|
11783
11791
|
any = true;
|
|
11784
|
-
} else if (removed("SecurityGroupIds"))
|
|
11792
|
+
} else if (removed("SecurityGroupIds")) unExpressible.push("SecurityGroupIds");
|
|
11785
11793
|
}
|
|
11786
|
-
if (
|
|
11787
|
-
await new EC2Client({
|
|
11794
|
+
if (any) await new EC2Client({
|
|
11788
11795
|
region: ctx.region,
|
|
11789
11796
|
...CLIENT_TIMEOUTS
|
|
11790
11797
|
}).send(new ModifyClientVpnEndpointCommand(input));
|
|
11798
|
+
if (unExpressible.length > 0) throw new Error(`EC2 ClientVpnEndpoint ${unExpressible.join(", ")} cannot be cleared via ModifyClientVpnEndpoint (unset state is not expressible in a selective modify)${any ? "; the other revert op(s) were applied" : ""}; update ${unExpressible.length > 1 ? "them" : "it"} manually`);
|
|
11791
11799
|
};
|
|
11792
11800
|
const LEX_CFN_TO_LEX_RESOLUTION_STRATEGY = {
|
|
11793
11801
|
ORIGINAL_VALUE: "OriginalValue",
|
|
@@ -15355,6 +15363,7 @@ async function main(argv) {
|
|
|
15355
15363
|
default:
|
|
15356
15364
|
console.error(`unknown command: ${cmd}\n`);
|
|
15357
15365
|
console.error(HELP);
|
|
15366
|
+
if (argv.includes("--json")) console.log("[]");
|
|
15358
15367
|
return 2;
|
|
15359
15368
|
}
|
|
15360
15369
|
}
|