@go-to-k/cdkd 0.51.4 → 0.51.5

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
@@ -19470,7 +19470,8 @@ import {
19470
19470
  ReplaceNetworkAclAssociationCommand,
19471
19471
  DescribeNetworkAclsCommand,
19472
19472
  DescribeNetworkInterfacesCommand as DescribeNetworkInterfacesCommand2,
19473
- DeleteNetworkInterfaceCommand as DeleteNetworkInterfaceCommand2
19473
+ DeleteNetworkInterfaceCommand as DeleteNetworkInterfaceCommand2,
19474
+ DescribeVolumesCommand
19474
19475
  } from "@aws-sdk/client-ec2";
19475
19476
  init_aws_clients();
19476
19477
  var EC2Provider = class {
@@ -21749,8 +21750,23 @@ var EC2Provider = class {
21749
21750
  * always emitted (even as `[]`) so the v3 `observedProperties`
21750
21751
  * baseline catches console-side rule ADDs to a templated SG.
21751
21752
  * - **AWS::EC2::Instance**: `DescribeInstances` for `ImageId`,
21752
- * `InstanceType`, `KeyName`, `SubnetId`. SecurityGroupIds /
21753
- * BlockDeviceMappings shape-match is out of scope for v1.
21753
+ * `InstanceType`, `KeyName`, `SubnetId`, `SecurityGroupIds` (sorted
21754
+ * list of `SecurityGroups[].GroupId` for stable positional compare),
21755
+ * `PrivateIpAddress`, `SourceDestCheck`, `Monitoring` (mapped from
21756
+ * AWS `Monitoring.State` to CFn boolean), `Tenancy` (from
21757
+ * `Placement.Tenancy`), `IamInstanceProfile` (ARN form — v2 fallback
21758
+ * state holding a name will fire one-time drift, resolved via
21759
+ * `cdkd state refresh-observed`), `Tags` (filtered `aws:*`). For
21760
+ * `BlockDeviceMappings`, `DescribeInstances` only returns
21761
+ * `(DeviceName, Ebs.VolumeId, Ebs.DeleteOnTermination)`; cdkd
21762
+ * additionally calls `DescribeVolumes` on the attached volume ids to
21763
+ * surface `VolumeType` / `VolumeSize` / `Iops` / `Throughput` /
21764
+ * `Encrypted` / `KmsKeyId` / `SnapshotId`. The DescribeVolumes call
21765
+ * is best-effort — a permissions gap or other failure falls back to
21766
+ * the partial shape (DeleteOnTermination only). All arrays / scalars
21767
+ * that map to user-controllable CFn properties are always emitted
21768
+ * (even as `[]` or default scalar) so the v3 `observedProperties`
21769
+ * baseline catches console-side ADDs.
21754
21770
  * - **AWS::EC2::NetworkAcl**: `DescribeNetworkAcls` for `VpcId`.
21755
21771
  *
21756
21772
  * Skipped (return `undefined`, falls through to the comparator's
@@ -21937,6 +21953,75 @@ var EC2Provider = class {
21937
21953
  result["KeyName"] = instance.KeyName;
21938
21954
  if (instance.SubnetId !== void 0)
21939
21955
  result["SubnetId"] = instance.SubnetId;
21956
+ result["SecurityGroupIds"] = (instance.SecurityGroups ?? []).map((g) => g.GroupId).filter((id) => typeof id === "string").sort();
21957
+ if (instance.PrivateIpAddress !== void 0) {
21958
+ result["PrivateIpAddress"] = instance.PrivateIpAddress;
21959
+ }
21960
+ if (instance.SourceDestCheck !== void 0) {
21961
+ result["SourceDestCheck"] = instance.SourceDestCheck;
21962
+ }
21963
+ const monitoringState = instance.Monitoring?.State;
21964
+ result["Monitoring"] = monitoringState === "enabled" || monitoringState === "pending";
21965
+ if (instance.Placement?.Tenancy !== void 0) {
21966
+ result["Tenancy"] = instance.Placement.Tenancy;
21967
+ }
21968
+ if (instance.IamInstanceProfile?.Arn !== void 0) {
21969
+ result["IamInstanceProfile"] = instance.IamInstanceProfile.Arn;
21970
+ }
21971
+ const ebsMappings = (instance.BlockDeviceMappings ?? []).filter(
21972
+ (m) => m.Ebs?.VolumeId !== void 0
21973
+ );
21974
+ const volumeIds = ebsMappings.map((m) => m.Ebs.VolumeId);
21975
+ let volumesById = /* @__PURE__ */ new Map();
21976
+ if (volumeIds.length > 0) {
21977
+ try {
21978
+ const volResp = await this.ec2Client.send(
21979
+ new DescribeVolumesCommand({ VolumeIds: volumeIds })
21980
+ );
21981
+ for (const v of volResp.Volumes ?? []) {
21982
+ if (v.VolumeId !== void 0)
21983
+ volumesById.set(v.VolumeId, v);
21984
+ }
21985
+ } catch (err) {
21986
+ this.logger.debug(
21987
+ `DescribeVolumes(${volumeIds.join(",")}) failed: ${err instanceof Error ? err.message : String(err)}`
21988
+ );
21989
+ volumesById = /* @__PURE__ */ new Map();
21990
+ }
21991
+ }
21992
+ const blockMappings = [];
21993
+ for (const m of instance.BlockDeviceMappings ?? []) {
21994
+ const out = {};
21995
+ if (m.DeviceName !== void 0)
21996
+ out["DeviceName"] = m.DeviceName;
21997
+ if (m.Ebs?.VolumeId !== void 0) {
21998
+ const ebs = {};
21999
+ if (m.Ebs.DeleteOnTermination !== void 0) {
22000
+ ebs["DeleteOnTermination"] = m.Ebs.DeleteOnTermination;
22001
+ }
22002
+ const vol = volumesById.get(m.Ebs.VolumeId);
22003
+ if (vol !== void 0) {
22004
+ if (vol.VolumeType !== void 0)
22005
+ ebs["VolumeType"] = vol.VolumeType;
22006
+ if (vol.Size !== void 0)
22007
+ ebs["VolumeSize"] = vol.Size;
22008
+ if (vol.Iops !== void 0)
22009
+ ebs["Iops"] = vol.Iops;
22010
+ if (vol.Throughput !== void 0)
22011
+ ebs["Throughput"] = vol.Throughput;
22012
+ if (vol.Encrypted !== void 0)
22013
+ ebs["Encrypted"] = vol.Encrypted;
22014
+ if (vol.KmsKeyId !== void 0)
22015
+ ebs["KmsKeyId"] = vol.KmsKeyId;
22016
+ if (vol.SnapshotId !== void 0)
22017
+ ebs["SnapshotId"] = vol.SnapshotId;
22018
+ }
22019
+ out["Ebs"] = ebs;
22020
+ }
22021
+ blockMappings.push(out);
22022
+ }
22023
+ result["BlockDeviceMappings"] = blockMappings;
22024
+ result["Tags"] = normalizeAwsTagsToCfn(instance.Tags);
21940
22025
  return result;
21941
22026
  }
21942
22027
  async readNetworkAclCurrentState(physicalId) {
@@ -44710,7 +44795,7 @@ function reorderArgs(argv) {
44710
44795
  }
44711
44796
  async function main() {
44712
44797
  const program = new Command14();
44713
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.51.4");
44798
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.51.5");
44714
44799
  program.addCommand(createBootstrapCommand());
44715
44800
  program.addCommand(createSynthCommand());
44716
44801
  program.addCommand(createListCommand());