cdk-real-drift 0.2.39 → 0.2.41

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 CHANGED
@@ -2254,7 +2254,7 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
2254
2254
  "AWS::KinesisAnalyticsV2::Application": new Set(["ApplicationMaintenanceConfiguration"]),
2255
2255
  "AWS::ElasticBeanstalk::ConfigurationTemplate": new Set(["PlatformArn"]),
2256
2256
  "AWS::ElasticBeanstalk::Environment": new Set(["PlatformArn"]),
2257
- "AWS::ElasticLoadBalancing::LoadBalancer": new Set(["AvailabilityZones", "Policies"]),
2257
+ "AWS::ElasticLoadBalancing::LoadBalancer": new Set(["AvailabilityZones"]),
2258
2258
  "AWS::AutoScaling::AutoScalingGroup": new Set(["AvailabilityZones", "AvailabilityZoneIds"]),
2259
2259
  "AWS::ApiGateway::Authorizer": new Set(["AuthType"]),
2260
2260
  "AWS::RDS::DBCluster": new Set([
@@ -3243,6 +3243,9 @@ async function loadDesired(client, stackName, region, templateOverride, recovery
3243
3243
  const clustersWithSiblingCapacityProviders = collectClustersWithSiblingCapacityProviders(template.Resources ?? {});
3244
3244
  for (const [logicalId, res] of Object.entries(template.Resources ?? {})) {
3245
3245
  if (res.Type === "AWS::CDK::Metadata") continue;
3246
+ if (typeof res.Condition === "string" && !physIds[logicalId]) {
3247
+ if (evalCondition(res.Condition, ctx) === false) continue;
3248
+ }
3246
3249
  const cdkPath = res.Metadata?.["aws:cdk:path"];
3247
3250
  const declaredRaw = res.Properties ?? {};
3248
3251
  resources.push({
@@ -3872,6 +3875,12 @@ function dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live) {
3872
3875
  if (!isNestedObject(gsi)) return false;
3873
3876
  return deepEqual(value, warmThroughputDefault(gsi.ProvisionedThroughput));
3874
3877
  }
3878
+ const CLB_DEFAULT_SSL_POLICY_NAME = "ELBSecurityPolicy-2016-08";
3879
+ function clbDefaultSslPoliciesAtDefault(resourceType, key, value) {
3880
+ if (resourceType !== "AWS::ElasticLoadBalancing::LoadBalancer" || key !== "Policies") return false;
3881
+ if (!Array.isArray(value) || value.length === 0) return false;
3882
+ return value.every((el) => isNestedObject(el) && el["PolicyType"] === "SSLNegotiationPolicyType" && el["PolicyName"] === CLB_DEFAULT_SSL_POLICY_NAME);
3883
+ }
3875
3884
  const CFN_RANDOM_SUFFIX = /-[0-9A-Za-z]{12,}$/;
3876
3885
  function stripInjectedJsonStringDefaults(declared, live, defaults) {
3877
3886
  const stripObject = (d, l) => {
@@ -4533,7 +4542,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4533
4542
  }
4534
4543
  continue;
4535
4544
  }
4536
- if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v)) {
4545
+ if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v) || clbDefaultSslPoliciesAtDefault(resourceType, k, v)) {
4537
4546
  findings.push({
4538
4547
  tier: "atDefault",
4539
4548
  logicalId,