cdk-real-drift 0.23.1 → 0.23.2

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
@@ -1956,6 +1956,7 @@ function buildCorpusCase(resource, liveRaw, schema, opts, findings) {
1956
1956
  region: opts.region,
1957
1957
  kmsAliasTargets: opts.kmsAliasTargets,
1958
1958
  oaiCanonicalIds: opts.oaiCanonicalIds,
1959
+ ...Object.keys(opts.stackTags ?? {}).length > 0 && (Array.isArray(liveRaw.Tags) || Array.isArray(liveRaw.TagSpecifications)) ? { stackTags: opts.stackTags } : {},
1959
1960
  ...sgSibling && resource.physicalId ? { siblingSgRules: { [resource.physicalId]: sgSibling } } : {},
1960
1961
  ...bucketNotif ? { bucketNotificationManaged: bucketNotif } : {},
1961
1962
  ...eipSiblingId ? { siblingEipAssociations: [eipSiblingId] } : {},
@@ -2686,6 +2687,12 @@ const KNOWN_DEFAULTS = {
2686
2687
  TransportProtocol: "udp",
2687
2688
  SessionTimeoutHours: 24
2688
2689
  },
2690
+ "AWS::EC2::CapacityReservation": {
2691
+ Tenancy: "default",
2692
+ EndDateType: "unlimited",
2693
+ EndDate: "null",
2694
+ InstanceMatchCriteria: "open"
2695
+ },
2689
2696
  "AWS::DAX::Cluster": {
2690
2697
  ClusterEndpointEncryptionType: "NONE",
2691
2698
  ParameterGroupName: "default.dax1.0"
@@ -3709,6 +3716,7 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
3709
3716
  "AWS::AmazonMQ::Broker": new Set(["MaintenanceWindowStartTime", "SubnetIds"]),
3710
3717
  "AWS::EC2::InstanceConnectEndpoint": new Set(["SecurityGroupIds"]),
3711
3718
  "AWS::EC2::EIPAssociation": new Set(["PrivateIpAddress", "EIP"]),
3719
+ "AWS::EC2::CapacityReservation": new Set(["AvailabilityZoneId"]),
3712
3720
  "AWS::EC2::Instance": new Set([
3713
3721
  "PrivateIpAddress",
3714
3722
  "CpuOptions",
@@ -3929,14 +3937,16 @@ const ELB_TG_ATTRIBUTE_DEFAULTS_BY_PROTOCOL = {
3929
3937
  "deregistration_delay.connection_termination.enabled": "true",
3930
3938
  "proxy_protocol_v2.enabled": "false",
3931
3939
  "target_health_state.unhealthy.connection_termination.enabled": "true",
3932
- "target_health_state.unhealthy.draining_interval_seconds": "0"
3940
+ "target_health_state.unhealthy.draining_interval_seconds": "0",
3941
+ "preserve_client_ip.enabled": "true"
3933
3942
  },
3934
3943
  TCP_UDP: {
3935
3944
  "stickiness.type": "source_ip",
3936
3945
  "deregistration_delay.connection_termination.enabled": "true",
3937
3946
  "proxy_protocol_v2.enabled": "false",
3938
3947
  "target_health_state.unhealthy.connection_termination.enabled": "true",
3939
- "target_health_state.unhealthy.draining_interval_seconds": "0"
3948
+ "target_health_state.unhealthy.draining_interval_seconds": "0",
3949
+ "preserve_client_ip.enabled": "true"
3940
3950
  }
3941
3951
  };
3942
3952
  const ELB_TG_ATTRIBUTE_DEFAULTS_BY_TARGET_TYPE = {
@@ -5798,30 +5808,62 @@ function canonicalizeBaselineForCompare(v, resourceType, path) {
5798
5808
  //#region src/normalize/stack-tags.ts
5799
5809
  const declaredTagKeys = (declared) => {
5800
5810
  const out = /* @__PURE__ */ new Set();
5801
- const tags = declared?.Tags;
5802
- if (Array.isArray(tags)) for (const t of tags) {
5803
- const k = t?.Key;
5804
- if (typeof k === "string") out.add(k);
5805
- }
5811
+ const collect = (tags) => {
5812
+ if (!Array.isArray(tags)) return;
5813
+ for (const t of tags) {
5814
+ const k = t?.Key;
5815
+ if (typeof k === "string") out.add(k);
5816
+ }
5817
+ };
5818
+ const d = declared;
5819
+ collect(d?.Tags);
5820
+ const specs = d?.TagSpecifications;
5821
+ if (Array.isArray(specs)) for (const spec of specs) collect(spec?.Tags);
5806
5822
  return out;
5807
5823
  };
5808
5824
  const subtractPropagatedStackTags = (live, stackTags, declaredKeys) => {
5809
5825
  if (Object.keys(stackTags).length === 0) return live;
5810
- const tags = live.Tags;
5811
- if (!Array.isArray(tags)) return live;
5812
- const filtered = tags.filter((t) => {
5826
+ const keepTag = (t) => {
5813
5827
  if (!t || typeof t !== "object") return true;
5814
5828
  const key = t.Key;
5815
5829
  const value = t.Value;
5816
5830
  if (typeof key !== "string") return true;
5817
5831
  if (declaredKeys.has(key)) return true;
5818
5832
  return !(key in stackTags && stackTags[key] === value);
5819
- });
5820
- if (filtered.length === tags.length) return live;
5821
- return {
5822
- ...live,
5823
- Tags: filtered
5824
5833
  };
5834
+ let out = live;
5835
+ const tags = live.Tags;
5836
+ if (Array.isArray(tags)) {
5837
+ const filtered = tags.filter(keepTag);
5838
+ if (filtered.length !== tags.length) out = {
5839
+ ...out,
5840
+ Tags: filtered
5841
+ };
5842
+ }
5843
+ const specs = out.TagSpecifications;
5844
+ if (Array.isArray(specs)) {
5845
+ let changed = false;
5846
+ const filteredSpecs = specs.map((spec) => {
5847
+ const specTags = spec?.Tags;
5848
+ if (!Array.isArray(specTags)) return spec;
5849
+ const filtered = specTags.filter(keepTag);
5850
+ if (filtered.length === specTags.length) return spec;
5851
+ changed = true;
5852
+ return {
5853
+ ...spec,
5854
+ Tags: filtered
5855
+ };
5856
+ }).filter((spec) => {
5857
+ const specTags = spec?.Tags;
5858
+ return !(Array.isArray(specTags) && specTags.length === 0);
5859
+ });
5860
+ if (changed || filteredSpecs.length !== specs.length) {
5861
+ out = { ...out };
5862
+ if (filteredSpecs.length === 0) delete out.TagSpecifications;
5863
+ else out.TagSpecifications = filteredSpecs;
5864
+ }
5865
+ }
5866
+ return out;
5825
5867
  };
5826
5868
 
5827
5869
  //#endregion
@@ -5920,8 +5962,8 @@ function elbAttributeDefaultsFor(resourceType, declared, live) {
5920
5962
  const targetType = declared.TargetType ?? live.TargetType;
5921
5963
  return {
5922
5964
  ...shared,
5923
- ...typeof protocol === "string" ? ELB_TG_ATTRIBUTE_DEFAULTS_BY_PROTOCOL[protocol] ?? {} : {},
5924
- ...typeof targetType === "string" ? ELB_TG_ATTRIBUTE_DEFAULTS_BY_TARGET_TYPE[targetType] ?? {} : {}
5965
+ ...typeof targetType === "string" ? ELB_TG_ATTRIBUTE_DEFAULTS_BY_TARGET_TYPE[targetType] ?? {} : {},
5966
+ ...typeof protocol === "string" ? ELB_TG_ATTRIBUTE_DEFAULTS_BY_PROTOCOL[protocol] ?? {} : {}
5925
5967
  };
5926
5968
  }
5927
5969
  return shared;
@@ -19443,6 +19485,8 @@ const CC_REVERTABLE_DESPITE_READ_OVERRIDE = new Set([
19443
19485
  "AWS::EC2::EIP"
19444
19486
  ]);
19445
19487
  const REVERT_SET_DEFAULT_PATHS = new Set([
19488
+ "AWS::EC2::CapacityReservation\0InstanceMatchCriteria",
19489
+ "AWS::EC2::CapacityReservation\0EndDateType",
19446
19490
  "AWS::DLM::LifecyclePolicy\0RetainInterval",
19447
19491
  "AWS::DLM::LifecyclePolicy\0CreateInterval",
19448
19492
  "AWS::IAM::Role\0MaxSessionDuration",