cdk-real-drift 0.7.6 → 0.8.0
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 +10 -3
- package/dist/cli.js +47 -1
- package/dist/cli.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -339,9 +339,16 @@ CI (with `--yes`).
|
|
|
339
339
|
- **`--fail`** (the `cdk diff --fail` / `cdk drift --fail` convention) exits `1` on
|
|
340
340
|
drift and suppresses all prompts. It's the one flag for scripts and CI.
|
|
341
341
|
- **`--strict`** is the orthogonal **coverage** axis: it exits `1` when a run was
|
|
342
|
-
incomplete (
|
|
343
|
-
|
|
344
|
-
|
|
342
|
+
incomplete (a resource skipped for an ACTIONABLE reason — a CC-unsupported type
|
|
343
|
+
with no override, a read error / throttle / AccessDenied — or a nested stack not
|
|
344
|
+
recursed into). A **custom resource** (`Custom::*` /
|
|
345
|
+
`AWS::CloudFormation::CustomResource`, e.g. `Custom::S3AutoDeleteObjects` /
|
|
346
|
+
`Custom::LogRetention`) has no cloud-side model to read, so it is a
|
|
347
|
+
permanent-by-nature gap that no `record` / `ignore` could clear — it is
|
|
348
|
+
**informational** and does NOT fail `--strict` (otherwise the flag would exit `1`
|
|
349
|
+
forever on nearly every real CDK app). The gap is always surfaced regardless (as
|
|
350
|
+
the `skipped=N` footer line or a loud `warning:`); `--strict` only decides whether
|
|
351
|
+
an actionable gap fails the build.
|
|
345
352
|
- Errors always exit `2`; `revert` exits `1` when drift remains after it.
|
|
346
353
|
- Interrupting a run with **Ctrl-C** (or **ESC** / SIGINT) during the gather/read
|
|
347
354
|
phase exits `130` (128 + SIGINT) for every verb, and a **SIGTERM** (CI
|
package/dist/cli.js
CHANGED
|
@@ -48,6 +48,7 @@ import { BuildBotLocaleCommand, CreateIntentCommand, CreateSlotCommand, CreateSl
|
|
|
48
48
|
import { GetScheduleCommand, SchedulerClient } from "@aws-sdk/client-scheduler";
|
|
49
49
|
import { DescribeReceiptRuleCommand, DescribeReceiptRuleSetCommand, ListReceiptFiltersCommand, SESClient, UpdateReceiptRuleCommand } from "@aws-sdk/client-ses";
|
|
50
50
|
import { DescribeParametersCommand as DescribeParametersCommand$2, SSMClient } from "@aws-sdk/client-ssm";
|
|
51
|
+
import { DescribeEndpointConfigCommand, SageMakerClient } from "@aws-sdk/client-sagemaker";
|
|
51
52
|
import { GetNamespaceCommand, GetServiceCommand, ServiceDiscoveryClient, UpdateHttpNamespaceCommand } from "@aws-sdk/client-servicediscovery";
|
|
52
53
|
import { GetQueueAttributesCommand, SQSClient, SetQueueAttributesCommand } from "@aws-sdk/client-sqs";
|
|
53
54
|
import { createHash } from "node:crypto";
|
|
@@ -8806,6 +8807,47 @@ const readGlueSecurityConfiguration = async ({ physicalId, declared, region }) =
|
|
|
8806
8807
|
if (Object.keys(ec).length > 0) model.EncryptionConfiguration = ec;
|
|
8807
8808
|
return model;
|
|
8808
8809
|
};
|
|
8810
|
+
const projectSageMakerVariant = (v) => {
|
|
8811
|
+
const out = {};
|
|
8812
|
+
if (str$1(v.VariantName)) out.VariantName = v.VariantName;
|
|
8813
|
+
if (str$1(v.ModelName)) out.ModelName = v.ModelName;
|
|
8814
|
+
if (typeof v.InitialInstanceCount === "number") out.InitialInstanceCount = v.InitialInstanceCount;
|
|
8815
|
+
if (str$1(v.InstanceType)) out.InstanceType = v.InstanceType;
|
|
8816
|
+
if (typeof v.InitialVariantWeight === "number") out.InitialVariantWeight = v.InitialVariantWeight;
|
|
8817
|
+
if (v.ServerlessConfig !== void 0) out.ServerlessConfig = v.ServerlessConfig;
|
|
8818
|
+
if (typeof v.VolumeSizeInGB === "number") out.VolumeSizeInGB = v.VolumeSizeInGB;
|
|
8819
|
+
if (typeof v.ModelDataDownloadTimeoutInSeconds === "number") out.ModelDataDownloadTimeoutInSeconds = v.ModelDataDownloadTimeoutInSeconds;
|
|
8820
|
+
if (typeof v.ContainerStartupHealthCheckTimeoutInSeconds === "number") out.ContainerStartupHealthCheckTimeoutInSeconds = v.ContainerStartupHealthCheckTimeoutInSeconds;
|
|
8821
|
+
if (typeof v.EnableSSMAccess === "boolean") out.EnableSSMAccess = v.EnableSSMAccess;
|
|
8822
|
+
if (v.ManagedInstanceScaling !== void 0) out.ManagedInstanceScaling = v.ManagedInstanceScaling;
|
|
8823
|
+
if (v.RoutingConfig !== void 0) out.RoutingConfig = v.RoutingConfig;
|
|
8824
|
+
if (typeof v.VariantInstanceProvisionTimeoutInSeconds === "number") out.VariantInstanceProvisionTimeoutInSeconds = v.VariantInstanceProvisionTimeoutInSeconds;
|
|
8825
|
+
if (Array.isArray(v.InstancePools) && v.InstancePools.length > 0) out.InstancePools = v.InstancePools;
|
|
8826
|
+
if (v.CapacityReservationConfig !== void 0) out.CapacityReservationConfig = v.CapacityReservationConfig;
|
|
8827
|
+
if (str$1(v.InferenceAmiVersion)) out.InferenceAmiVersion = v.InferenceAmiVersion;
|
|
8828
|
+
return out;
|
|
8829
|
+
};
|
|
8830
|
+
const readSageMakerEndpointConfig = async ({ physicalId, declared, region }) => {
|
|
8831
|
+
const name = str$1(physicalId) ?? str$1(declared.EndpointConfigName);
|
|
8832
|
+
if (!name) return void 0;
|
|
8833
|
+
const r = await new SageMakerClient({
|
|
8834
|
+
region,
|
|
8835
|
+
...READ_RETRY
|
|
8836
|
+
}).send(new DescribeEndpointConfigCommand({ EndpointConfigName: name }));
|
|
8837
|
+
if (!r.EndpointConfigName) throw new ResourceGoneError(`SageMaker EndpointConfig ${name} absent`);
|
|
8838
|
+
const model = {};
|
|
8839
|
+
if (str$1(r.EndpointConfigName)) model.EndpointConfigName = r.EndpointConfigName;
|
|
8840
|
+
if (Array.isArray(r.ProductionVariants) && r.ProductionVariants.length > 0) model.ProductionVariants = r.ProductionVariants.map(projectSageMakerVariant);
|
|
8841
|
+
if (Array.isArray(r.ShadowProductionVariants) && r.ShadowProductionVariants.length > 0) model.ShadowProductionVariants = r.ShadowProductionVariants.map(projectSageMakerVariant);
|
|
8842
|
+
if (r.DataCaptureConfig !== void 0) model.DataCaptureConfig = r.DataCaptureConfig;
|
|
8843
|
+
if (r.AsyncInferenceConfig !== void 0) model.AsyncInferenceConfig = r.AsyncInferenceConfig;
|
|
8844
|
+
if (str$1(r.KmsKeyId)) model.KmsKeyId = r.KmsKeyId;
|
|
8845
|
+
if (r.ExplainerConfig !== void 0) model.ExplainerConfig = r.ExplainerConfig;
|
|
8846
|
+
if (typeof r.EnableNetworkIsolation === "boolean") model.EnableNetworkIsolation = r.EnableNetworkIsolation;
|
|
8847
|
+
if (str$1(r.ExecutionRoleArn)) model.ExecutionRoleArn = r.ExecutionRoleArn;
|
|
8848
|
+
if (r.VpcConfig !== void 0) model.VpcConfig = r.VpcConfig;
|
|
8849
|
+
return model;
|
|
8850
|
+
};
|
|
8809
8851
|
const readMetricFilter = async ({ physicalId, declared, region }) => {
|
|
8810
8852
|
const logGroup = str$1(declared.LogGroupName);
|
|
8811
8853
|
const filterName = str$1(physicalId) ?? str$1(declared.FilterName);
|
|
@@ -9264,6 +9306,7 @@ const SDK_OVERRIDES = {
|
|
|
9264
9306
|
"AWS::Glue::Workflow": readGlueWorkflow,
|
|
9265
9307
|
"AWS::Glue::Connection": readGlueConnection,
|
|
9266
9308
|
"AWS::Glue::SecurityConfiguration": readGlueSecurityConfiguration,
|
|
9309
|
+
"AWS::SageMaker::EndpointConfig": readSageMakerEndpointConfig,
|
|
9267
9310
|
"AWS::Logs::MetricFilter": readMetricFilter,
|
|
9268
9311
|
"AWS::Scheduler::Schedule": readSchedulerSchedule
|
|
9269
9312
|
};
|
|
@@ -16038,6 +16081,9 @@ function nestedStackWarning(resources, stackName) {
|
|
|
16038
16081
|
function isPendingCreationSkip(f) {
|
|
16039
16082
|
return f.tier === "skipped" && f.note === "no physical id";
|
|
16040
16083
|
}
|
|
16084
|
+
function isCustomResourceSkip(f) {
|
|
16085
|
+
return f.tier === "skipped" && (f.resourceType === "AWS::CloudFormation::CustomResource" || f.resourceType.startsWith("Custom::"));
|
|
16086
|
+
}
|
|
16041
16087
|
function coverageWarning(findings, stackName, preDeploy = false) {
|
|
16042
16088
|
const skipped = findings.filter((f) => f.tier === "skipped" && !(preDeploy && isPendingCreationSkip(f)));
|
|
16043
16089
|
if (skipped.length === 0) return null;
|
|
@@ -16055,7 +16101,7 @@ function pendingCreationInfo(findings, stackName) {
|
|
|
16055
16101
|
return `info: ${stackName}: ${pending.length} resource(s) not yet deployed — will be created by the next deploy (pending creation, not a coverage gap): ${shown.join(", ")}${more}`;
|
|
16056
16102
|
}
|
|
16057
16103
|
function hasCoverageGap(findings, resources, preDeploy = false) {
|
|
16058
|
-
return findings.some((f) => f.tier === "skipped" && !(preDeploy && isPendingCreationSkip(f))) || resources.some((r) => r.resourceType === "AWS::CloudFormation::Stack");
|
|
16104
|
+
return findings.some((f) => f.tier === "skipped" && !(preDeploy && isPendingCreationSkip(f)) && !isCustomResourceSkip(f)) || resources.some((r) => r.resourceType === "AWS::CloudFormation::Stack");
|
|
16059
16105
|
}
|
|
16060
16106
|
function strictCoverageExit(strict, findings, resources, preDeploy = false) {
|
|
16061
16107
|
return strict && hasCoverageGap(findings, resources, preDeploy) ? 1 : 0;
|