cdk-real-drift 0.17.3 → 0.18.1
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/README.md +3 -0
- package/dist/cli.js +54 -1
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1181,6 +1181,9 @@ Control cannot sub-path patch it),
|
|
|
1181
1181
|
`AWS::Glue::Job` / `Classifier` / `Workflow`),
|
|
1182
1182
|
`servicediscovery:UpdateHttpNamespace` (reverts an
|
|
1183
1183
|
`AWS::ServiceDiscovery::HttpNamespace` `Description`),
|
|
1184
|
+
`servicediscovery:UpdateService` (reverts an `AWS::ServiceDiscovery::Service`'s
|
|
1185
|
+
`Description` / `DnsConfig.DnsRecords` / `HealthCheckConfig` — a DNS-namespace
|
|
1186
|
+
service; an API-only (HTTP) namespace service cannot be updated),
|
|
1184
1187
|
`cognito-sync:SetCognitoEvents` (reverts an `AWS::Cognito::IdentityPool`'s
|
|
1185
1188
|
writeOnly `CognitoEvents`),
|
|
1186
1189
|
`kinesisvideo:UpdateDataRetention` / `kinesisvideo:UpdateSignalingChannel` /
|
package/dist/cli.js
CHANGED
|
@@ -56,7 +56,7 @@ import { BuildBotLocaleCommand, CreateIntentCommand, CreateSlotCommand, CreateSl
|
|
|
56
56
|
import { GetScheduleCommand, SchedulerClient } from "@aws-sdk/client-scheduler";
|
|
57
57
|
import { DescribeReceiptRuleCommand, DescribeReceiptRuleSetCommand, ListReceiptFiltersCommand, SESClient, UpdateReceiptRuleCommand } from "@aws-sdk/client-ses";
|
|
58
58
|
import { DescribeEndpointConfigCommand, DescribeMonitoringScheduleCommand, ListTagsCommand as ListTagsCommand$1, SageMakerClient } from "@aws-sdk/client-sagemaker";
|
|
59
|
-
import { GetNamespaceCommand, GetServiceCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$4, ServiceDiscoveryClient, UpdateHttpNamespaceCommand } from "@aws-sdk/client-servicediscovery";
|
|
59
|
+
import { GetNamespaceCommand, GetServiceCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$4, ServiceDiscoveryClient, UpdateHttpNamespaceCommand, UpdateServiceCommand as UpdateServiceCommand$1 } from "@aws-sdk/client-servicediscovery";
|
|
60
60
|
import { createHash } from "node:crypto";
|
|
61
61
|
import { S_BAR, S_BAR_END, S_BAR_START, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, confirm, isCancel, select, spinner } from "@clack/prompts";
|
|
62
62
|
import pc from "picocolors";
|
|
@@ -2940,6 +2940,10 @@ const KNOWN_DEFAULT_PATHS = {
|
|
|
2940
2940
|
"DataQualityJobInput.EndpointInput.S3DataDistributionType": "FullyReplicated",
|
|
2941
2941
|
"DataQualityJobInput.EndpointInput.S3InputMode": "File"
|
|
2942
2942
|
},
|
|
2943
|
+
"AWS::SageMaker::MonitoringSchedule": {
|
|
2944
|
+
"MonitoringScheduleConfig.MonitoringType": "DataQuality",
|
|
2945
|
+
"MonitoringScheduleConfig.MonitoringJobDefinition.StoppingCondition": { MaxRuntimeInSeconds: 3600 }
|
|
2946
|
+
},
|
|
2943
2947
|
"AWS::SageMaker::Model": {
|
|
2944
2948
|
"PrimaryContainer.Mode": "SingleModel",
|
|
2945
2949
|
"Containers.*.Mode": "SingleModel"
|
|
@@ -16859,6 +16863,54 @@ const writeServiceDiscoveryHttpNamespace = async (ctx, ops) => {
|
|
|
16859
16863
|
Namespace: { Description: str(m.Description) ?? "" }
|
|
16860
16864
|
}));
|
|
16861
16865
|
};
|
|
16866
|
+
const SD_SERVICE_MUTABLE_TOPS = new Set([
|
|
16867
|
+
"Description",
|
|
16868
|
+
"DnsConfig",
|
|
16869
|
+
"HealthCheckConfig"
|
|
16870
|
+
]);
|
|
16871
|
+
const writeServiceDiscoveryService = async (ctx, ops) => {
|
|
16872
|
+
const id = str(ctx.physicalId);
|
|
16873
|
+
if (!id) throw new Error("cannot resolve Cloud Map service id for revert");
|
|
16874
|
+
const desired = await desiredModel("AWS::ServiceDiscovery::Service", ctx, ops);
|
|
16875
|
+
if (desired.Type === "HTTP") throw new Error(`ServiceDiscovery Service ${id} lives in an API-only (HTTP) namespace — UpdateService cannot modify it, so its drift is not revertable`);
|
|
16876
|
+
const unExpressible = /* @__PURE__ */ new Set();
|
|
16877
|
+
let anyExpressible = false;
|
|
16878
|
+
for (const op of ops) {
|
|
16879
|
+
const top = opTopSeg(op.path);
|
|
16880
|
+
if (!SD_SERVICE_MUTABLE_TOPS.has(top)) {
|
|
16881
|
+
unExpressible.add(top);
|
|
16882
|
+
continue;
|
|
16883
|
+
}
|
|
16884
|
+
const sub = op.path.replace(/^\//, "").split("/")[1] ?? "";
|
|
16885
|
+
if (top === "DnsConfig" && sub !== "DnsRecords" && sub !== "") {
|
|
16886
|
+
unExpressible.add(`DnsConfig/${sub}`);
|
|
16887
|
+
continue;
|
|
16888
|
+
}
|
|
16889
|
+
anyExpressible = true;
|
|
16890
|
+
}
|
|
16891
|
+
if (anyExpressible) {
|
|
16892
|
+
const service = {};
|
|
16893
|
+
if (str(desired.Description)) service.Description = desired.Description;
|
|
16894
|
+
const dns = desired.DnsConfig;
|
|
16895
|
+
const records = dns && Array.isArray(dns.DnsRecords) ? dns.DnsRecords : void 0;
|
|
16896
|
+
if (records && records.length > 0) service.DnsConfig = { DnsRecords: records.map((r) => {
|
|
16897
|
+
const rec = r;
|
|
16898
|
+
return {
|
|
16899
|
+
Type: rec.Type,
|
|
16900
|
+
TTL: typeof rec.TTL === "number" ? rec.TTL : Number(rec.TTL)
|
|
16901
|
+
};
|
|
16902
|
+
}) };
|
|
16903
|
+
if (desired.HealthCheckConfig !== void 0) service.HealthCheckConfig = desired.HealthCheckConfig;
|
|
16904
|
+
await new ServiceDiscoveryClient({
|
|
16905
|
+
region: ctx.region,
|
|
16906
|
+
...CLIENT_TIMEOUTS
|
|
16907
|
+
}).send(new UpdateServiceCommand$1({
|
|
16908
|
+
Id: id,
|
|
16909
|
+
Service: service
|
|
16910
|
+
}));
|
|
16911
|
+
}
|
|
16912
|
+
if (unExpressible.size > 0) throw new Error(`ServiceDiscovery Service ${id}: UpdateService cannot express ${[...unExpressible].join(", ")} (create-only / immutable)${anyExpressible ? " — the other drifted values were reverted" : ""}`);
|
|
16913
|
+
};
|
|
16862
16914
|
const DOCDB_CLUSTER_MODIFY_PARAMS = new Set([
|
|
16863
16915
|
"BackupRetentionPeriod",
|
|
16864
16916
|
"PreferredBackupWindow",
|
|
@@ -18282,6 +18334,7 @@ const SDK_WRITERS = {
|
|
|
18282
18334
|
"AWS::DocDB::DBCluster": writeDocDbCluster,
|
|
18283
18335
|
"AWS::DocDB::DBInstance": writeDocDbInstance,
|
|
18284
18336
|
"AWS::ServiceDiscovery::HttpNamespace": writeServiceDiscoveryHttpNamespace,
|
|
18337
|
+
"AWS::ServiceDiscovery::Service": writeServiceDiscoveryService,
|
|
18285
18338
|
"AWS::S3::BucketPolicy": writeS3BucketPolicy,
|
|
18286
18339
|
"AWS::SNS::TopicPolicy": writeSnsTopicPolicy,
|
|
18287
18340
|
"AWS::SQS::QueuePolicy": writeSqsQueuePolicy,
|