cdk-real-drift 0.2.34 → 0.2.35
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 +122 -10
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1204,7 +1204,8 @@ const KNOWN_DEFAULTS = {
|
|
|
1204
1204
|
},
|
|
1205
1205
|
"AWS::EKS::Cluster": {
|
|
1206
1206
|
ControlPlaneScalingConfig: { Tier: "standard" },
|
|
1207
|
-
UpgradePolicy: { SupportType: "EXTENDED" }
|
|
1207
|
+
UpgradePolicy: { SupportType: "EXTENDED" },
|
|
1208
|
+
AccessConfig: { AuthenticationMode: "CONFIG_MAP" }
|
|
1208
1209
|
},
|
|
1209
1210
|
"AWS::EKS::Addon": { NamespaceConfig: { Namespace: "kube-system" } },
|
|
1210
1211
|
"AWS::WAFv2::WebACL": { OnSourceDDoSProtectionConfig: { ALBLowReputationMode: "ACTIVE_UNDER_DDOS" } },
|
|
@@ -1381,7 +1382,27 @@ const KNOWN_DEFAULTS = {
|
|
|
1381
1382
|
SchedulingStrategy: "REPLICA",
|
|
1382
1383
|
HealthCheckGracePeriodSeconds: 0,
|
|
1383
1384
|
EnableExecuteCommand: false,
|
|
1384
|
-
DeploymentController: { Type: "ECS" }
|
|
1385
|
+
DeploymentController: { Type: "ECS" },
|
|
1386
|
+
DeploymentConfiguration: {
|
|
1387
|
+
BakeTimeInMinutes: 0,
|
|
1388
|
+
Alarms: {
|
|
1389
|
+
AlarmNames: [],
|
|
1390
|
+
Enable: false,
|
|
1391
|
+
Rollback: false
|
|
1392
|
+
},
|
|
1393
|
+
Strategy: "ROLLING",
|
|
1394
|
+
DeploymentCircuitBreaker: {
|
|
1395
|
+
ThresholdConfiguration: {
|
|
1396
|
+
Type: "BOUNDED_PERCENT",
|
|
1397
|
+
Value: 50
|
|
1398
|
+
},
|
|
1399
|
+
Enable: false,
|
|
1400
|
+
ResetOnHealthyTask: true,
|
|
1401
|
+
Rollback: false
|
|
1402
|
+
},
|
|
1403
|
+
MaximumPercent: 200,
|
|
1404
|
+
MinimumHealthyPercent: 100
|
|
1405
|
+
}
|
|
1385
1406
|
},
|
|
1386
1407
|
"AWS::AppSync::GraphQLApi": {
|
|
1387
1408
|
ApiType: "GRAPHQL",
|
|
@@ -1526,7 +1547,13 @@ const KNOWN_DEFAULTS = {
|
|
|
1526
1547
|
"AWS::Synthetics::Canary": {
|
|
1527
1548
|
FailureRetentionPeriod: 31,
|
|
1528
1549
|
SuccessRetentionPeriod: 31,
|
|
1529
|
-
ProvisionedResourceCleanup: "AUTOMATIC"
|
|
1550
|
+
ProvisionedResourceCleanup: "AUTOMATIC",
|
|
1551
|
+
RunConfig: {
|
|
1552
|
+
TimeoutInSeconds: 840,
|
|
1553
|
+
MemoryInMB: 1500,
|
|
1554
|
+
EphemeralStorage: 1024,
|
|
1555
|
+
ActiveTracing: false
|
|
1556
|
+
}
|
|
1530
1557
|
},
|
|
1531
1558
|
"AWS::MSK::Cluster": {
|
|
1532
1559
|
EnhancedMonitoring: "DEFAULT",
|
|
@@ -1534,8 +1561,34 @@ const KNOWN_DEFAULTS = {
|
|
|
1534
1561
|
},
|
|
1535
1562
|
"AWS::Glue::Job": {
|
|
1536
1563
|
JobMode: "SCRIPT",
|
|
1537
|
-
MaxRetries: 0
|
|
1564
|
+
MaxRetries: 0,
|
|
1565
|
+
Timeout: 2880,
|
|
1566
|
+
ExecutionProperty: { MaxConcurrentRuns: 1 }
|
|
1567
|
+
},
|
|
1568
|
+
"AWS::SES::EmailIdentity": {
|
|
1569
|
+
DkimAttributes: { SigningEnabled: true },
|
|
1570
|
+
DkimSigningAttributes: { NextSigningKeyLength: "RSA_2048_BIT" },
|
|
1571
|
+
FeedbackAttributes: { EmailForwardingEnabled: true }
|
|
1538
1572
|
},
|
|
1573
|
+
"AWS::SES::ConfigurationSet": {
|
|
1574
|
+
SendingOptions: { SendingEnabled: true },
|
|
1575
|
+
ReputationOptions: { ReputationMetricsEnabled: true }
|
|
1576
|
+
},
|
|
1577
|
+
"AWS::Glue::Schema": { CheckpointVersion: {
|
|
1578
|
+
IsLatest: true,
|
|
1579
|
+
VersionNumber: 1
|
|
1580
|
+
} },
|
|
1581
|
+
"AWS::Signer::SigningProfile": { SignatureValidityPeriod: {
|
|
1582
|
+
Type: "MONTHS",
|
|
1583
|
+
Value: 135
|
|
1584
|
+
} },
|
|
1585
|
+
"AWS::Lambda::CodeSigningConfig": { CodeSigningPolicies: { UntrustedArtifactOnDeployment: "Warn" } },
|
|
1586
|
+
"AWS::EC2::SecurityGroup": { SecurityGroupEgress: [{
|
|
1587
|
+
CidrIp: "0.0.0.0/0",
|
|
1588
|
+
FromPort: -1,
|
|
1589
|
+
ToPort: -1,
|
|
1590
|
+
IpProtocol: "-1"
|
|
1591
|
+
}] },
|
|
1539
1592
|
"AWS::AutoScaling::AutoScalingGroup": {
|
|
1540
1593
|
Cooldown: "300",
|
|
1541
1594
|
HealthCheckType: "EC2",
|
|
@@ -1829,8 +1882,22 @@ const KNOWN_DEFAULT_PATHS = {
|
|
|
1829
1882
|
"DeploymentConfiguration.DeploymentCircuitBreaker.ThresholdConfiguration": {
|
|
1830
1883
|
Type: "BOUNDED_PERCENT",
|
|
1831
1884
|
Value: 50
|
|
1885
|
+
},
|
|
1886
|
+
"DeploymentConfiguration.DeploymentCircuitBreaker": {
|
|
1887
|
+
ThresholdConfiguration: {
|
|
1888
|
+
Type: "BOUNDED_PERCENT",
|
|
1889
|
+
Value: 50
|
|
1890
|
+
},
|
|
1891
|
+
Enable: false,
|
|
1892
|
+
ResetOnHealthyTask: true,
|
|
1893
|
+
Rollback: false
|
|
1832
1894
|
}
|
|
1833
1895
|
},
|
|
1896
|
+
"AWS::Bedrock::Guardrail": {
|
|
1897
|
+
"ContentPolicyConfig.ContentFiltersTierConfig": { TierName: "CLASSIC" },
|
|
1898
|
+
"TopicPolicyConfig.TopicsTierConfig": { TierName: "CLASSIC" }
|
|
1899
|
+
},
|
|
1900
|
+
"AWS::Synthetics::Canary": { "Schedule.RetryConfig": { MaxRetries: 0 } },
|
|
1834
1901
|
"AWS::OpenSearchService::Domain": {
|
|
1835
1902
|
"EBSOptions.Iops": 3e3,
|
|
1836
1903
|
"EBSOptions.Throughput": 125
|
|
@@ -1950,7 +2017,8 @@ const GENERATED_DEFAULTS = { "AWS::Lambda::Function": { LoggingConfig: {
|
|
|
1950
2017
|
} } };
|
|
1951
2018
|
const GENERATED_PATHS = {
|
|
1952
2019
|
"AWS::ApiGateway::Method": ["Integration.CacheNamespace"],
|
|
1953
|
-
"AWS::XRay::SamplingRule": ["SamplingRule.RuleARN"]
|
|
2020
|
+
"AWS::XRay::SamplingRule": ["SamplingRule.RuleARN"],
|
|
2021
|
+
"AWS::Budgets::Budget": ["Budget.BudgetName"]
|
|
1954
2022
|
};
|
|
1955
2023
|
const CONTEXT_DEFAULTS = { "AWS::EC2::VPCEndpointService": { SupportedRegions: "regionList" } };
|
|
1956
2024
|
const CONTEXT_ARN_DEFAULTS = {
|
|
@@ -1969,7 +2037,8 @@ const ENGINE_DEFAULTS = {
|
|
|
1969
2037
|
StorageType: (e) => e.startsWith("aurora") ? "aurora" : void 0,
|
|
1970
2038
|
AllocatedStorage: (e) => e.startsWith("aurora") ? 1 : void 0,
|
|
1971
2039
|
Port: rdsDefaultPort
|
|
1972
|
-
}
|
|
2040
|
+
},
|
|
2041
|
+
"AWS::ElastiCache::CacheCluster": { Port: (e) => /memcached/i.test(e) ? 11211 : /redis|valkey/i.test(e) ? 6379 : void 0 }
|
|
1973
2042
|
};
|
|
1974
2043
|
function rdsDefaultPort(engine) {
|
|
1975
2044
|
if (/mysql|maria/.test(engine)) return 3306;
|
|
@@ -2183,7 +2252,11 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
|
|
|
2183
2252
|
"AWS::DocDB::DBInstance": new Set(["PreferredMaintenanceWindow"]),
|
|
2184
2253
|
"AWS::Neptune::DBCluster": new Set(["PreferredMaintenanceWindow", "PreferredBackupWindow"]),
|
|
2185
2254
|
"AWS::Neptune::DBInstance": new Set(["PreferredMaintenanceWindow", "AvailabilityZone"]),
|
|
2186
|
-
"AWS::ElastiCache::CacheCluster": new Set([
|
|
2255
|
+
"AWS::ElastiCache::CacheCluster": new Set([
|
|
2256
|
+
"PreferredMaintenanceWindow",
|
|
2257
|
+
"SnapshotWindow",
|
|
2258
|
+
"PreferredAvailabilityZones"
|
|
2259
|
+
]),
|
|
2187
2260
|
"AWS::ElastiCache::ReplicationGroup": new Set(["PreferredMaintenanceWindow", "SnapshotWindow"]),
|
|
2188
2261
|
"AWS::ElastiCache::ServerlessCache": new Set(["DailySnapshotTime"]),
|
|
2189
2262
|
"AWS::MemoryDB::Cluster": new Set(["MaintenanceWindow", "SnapshotWindow"]),
|
|
@@ -2198,7 +2271,10 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
|
|
|
2198
2271
|
"AWS::EC2::NetworkInterface": new Set(["PrivateIpAddress"]),
|
|
2199
2272
|
"AWS::EC2::NatGateway": new Set(["PrivateIpAddress", "VpcId"]),
|
|
2200
2273
|
"AWS::EFS::MountTarget": new Set(["IpAddress"]),
|
|
2201
|
-
"AWS::EC2::EIP": new Set(["NetworkBorderGroup"]),
|
|
2274
|
+
"AWS::EC2::EIP": new Set(["NetworkBorderGroup", "NetworkInterfaceId"]),
|
|
2275
|
+
"AWS::EFS::FileSystem": new Set(["KmsKeyId"]),
|
|
2276
|
+
"AWS::EC2::SecurityGroup": new Set(["VpcId"]),
|
|
2277
|
+
"AWS::GlobalAccelerator::Accelerator": new Set(["IpAddresses"]),
|
|
2202
2278
|
"AWS::EC2::VPCEndpoint": new Set(["ServiceRegion", "DnsOptions"]),
|
|
2203
2279
|
"AWS::EC2::VPCPeeringConnection": new Set(["PeerRegion"]),
|
|
2204
2280
|
"AWS::EC2::VPCCidrBlock": new Set(["Ipv6CidrBlock", "Ipv6CidrBlockNetworkBorderGroup"]),
|
|
@@ -3830,7 +3906,7 @@ function isPolicySubsetOf(sub, sup) {
|
|
|
3830
3906
|
function matchesKnownDefault(live, def) {
|
|
3831
3907
|
if (deepEqual(live, def)) return true;
|
|
3832
3908
|
if (!isNestedObject(live) || !isNestedObject(def)) return false;
|
|
3833
|
-
return Object.entries(live).every(([k, v]) => k in def ?
|
|
3909
|
+
return Object.entries(live).every(([k, v]) => k in def ? matchesKnownDefault(v, def[k]) : isTrivialEmpty(v));
|
|
3834
3910
|
}
|
|
3835
3911
|
function collectNestedUndeclared(declaredVal, liveVal, path, emit, nestedArrayIdentity) {
|
|
3836
3912
|
if (Array.isArray(declaredVal) && Array.isArray(liveVal)) {
|
|
@@ -3983,6 +4059,16 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
3983
4059
|
...knownDefPaths,
|
|
3984
4060
|
"LoggingConfig.LogFormat": "JSON"
|
|
3985
4061
|
};
|
|
4062
|
+
if (resourceType === "AWS::Glue::Schema") {
|
|
4063
|
+
const arn = declared["Registry"]?.["Arn"];
|
|
4064
|
+
if (typeof arn === "string") {
|
|
4065
|
+
const name = arn.split(/[:/]/).pop();
|
|
4066
|
+
if (name) knownDefPaths = {
|
|
4067
|
+
...knownDefPaths,
|
|
4068
|
+
"Registry.Name": name
|
|
4069
|
+
};
|
|
4070
|
+
}
|
|
4071
|
+
}
|
|
3986
4072
|
if (resourceType === "AWS::ApiGateway::RestApi") {
|
|
3987
4073
|
const types = declared["EndpointConfiguration"]?.["Types"];
|
|
3988
4074
|
if (Array.isArray(types) && types.includes("PRIVATE")) {
|
|
@@ -10743,6 +10829,24 @@ function isManagedPolicyAttachmentMember(f) {
|
|
|
10743
10829
|
function isNestedSdkWritable(f) {
|
|
10744
10830
|
return SDK_NESTED_WRITERS[f.resourceType]?.match(f.path) ?? false;
|
|
10745
10831
|
}
|
|
10832
|
+
function nullHuskRemovalOps(model) {
|
|
10833
|
+
const ops = [];
|
|
10834
|
+
const walk = (value, pointer) => {
|
|
10835
|
+
if (Array.isArray(value)) {
|
|
10836
|
+
if (value.length > 0 && value.every((v) => v === null || v === void 0)) {
|
|
10837
|
+
if (pointer !== "") ops.push({
|
|
10838
|
+
op: "remove",
|
|
10839
|
+
path: pointer,
|
|
10840
|
+
human: `strip null array husk at ${pointer}`
|
|
10841
|
+
});
|
|
10842
|
+
return;
|
|
10843
|
+
}
|
|
10844
|
+
value.forEach((v, i) => walk(v, `${pointer}/${i}`));
|
|
10845
|
+
} else if (value && typeof value === "object") for (const [k, v] of Object.entries(value)) walk(v, `${pointer}/${k.replace(/~/g, "~0").replace(/\//g, "~1")}`);
|
|
10846
|
+
};
|
|
10847
|
+
walk(model, "");
|
|
10848
|
+
return ops;
|
|
10849
|
+
}
|
|
10746
10850
|
function toPointer(dotted) {
|
|
10747
10851
|
return "/" + dotted.split(".").map((s) => s.replace(/~/g, "~0").replace(/\//g, "~1")).join("/");
|
|
10748
10852
|
}
|
|
@@ -10944,6 +11048,13 @@ function buildRevertPlan(findings, baseline, opts = {}) {
|
|
|
10944
11048
|
item.ops.push(op);
|
|
10945
11049
|
itemsByLogical.set(key, item);
|
|
10946
11050
|
}
|
|
11051
|
+
if (opts.liveByLogical) for (const item of itemsByLogical.values()) {
|
|
11052
|
+
if (item.kind !== "cc") continue;
|
|
11053
|
+
const live = opts.liveByLogical.get(item.logicalId);
|
|
11054
|
+
if (!live) continue;
|
|
11055
|
+
const huskOps = nullHuskRemovalOps(live);
|
|
11056
|
+
if (huskOps.length > 0) item.ops.unshift(...huskOps);
|
|
11057
|
+
}
|
|
10947
11058
|
const ordered = [...itemsByLogical.values()];
|
|
10948
11059
|
return {
|
|
10949
11060
|
items: [...ordered.filter((i) => i.kind !== "delete"), ...ordered.filter((i) => i.kind === "delete")],
|
|
@@ -11618,7 +11729,8 @@ async function revertStack(p) {
|
|
|
11618
11729
|
removeUnrecorded: includeRemovals,
|
|
11619
11730
|
schemas: gathered.schemas,
|
|
11620
11731
|
siblingSgRules: buildSiblingSgRules(gathered.desired),
|
|
11621
|
-
stackName
|
|
11732
|
+
stackName,
|
|
11733
|
+
liveByLogical: gathered.liveByLogical
|
|
11622
11734
|
});
|
|
11623
11735
|
if (plan.items.length === 0 && plan.notRevertable.length === 0) {
|
|
11624
11736
|
console.log(style.clean(`${stackName} (${region}): no drift to revert.`));
|