@go-to-k/cdkd 0.51.7 → 0.51.9

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
@@ -19471,7 +19471,8 @@ import {
19471
19471
  DescribeNetworkAclsCommand,
19472
19472
  DescribeNetworkInterfacesCommand as DescribeNetworkInterfacesCommand2,
19473
19473
  DeleteNetworkInterfaceCommand as DeleteNetworkInterfaceCommand2,
19474
- DescribeVolumesCommand
19474
+ DescribeVolumesCommand,
19475
+ DescribeInstanceAttributeCommand
19475
19476
  } from "@aws-sdk/client-ec2";
19476
19477
  init_aws_clients();
19477
19478
  var EC2Provider = class {
@@ -21761,12 +21762,14 @@ var EC2Provider = class {
21761
21762
  * `(DeviceName, Ebs.VolumeId, Ebs.DeleteOnTermination)`; cdkd
21762
21763
  * additionally calls `DescribeVolumes` on the attached volume ids to
21763
21764
  * 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.
21765
+ * `Encrypted` / `KmsKeyId` / `SnapshotId`. `DisableApiTermination`
21766
+ * is recovered via a separate `DescribeInstanceAttribute` call (the
21767
+ * `DescribeInstances` response does not include it). Both extra
21768
+ * calls are best-effort a permissions gap or other failure falls
21769
+ * back to omitting the key. All arrays / scalars that map to
21770
+ * user-controllable CFn properties are always emitted (even as `[]`
21771
+ * or default scalar) so the v3 `observedProperties` baseline
21772
+ * catches console-side ADDs.
21770
21773
  * - **AWS::EC2::NetworkAcl**: `DescribeNetworkAcls` for `VpcId`.
21771
21774
  *
21772
21775
  * Skipped (return `undefined`, falls through to the comparator's
@@ -22037,6 +22040,21 @@ var EC2Provider = class {
22037
22040
  }
22038
22041
  result["BlockDeviceMappings"] = blockMappings;
22039
22042
  result["Tags"] = normalizeAwsTagsToCfn(instance.Tags);
22043
+ try {
22044
+ const attrResp = await this.ec2Client.send(
22045
+ new DescribeInstanceAttributeCommand({
22046
+ InstanceId: physicalId,
22047
+ Attribute: "disableApiTermination"
22048
+ })
22049
+ );
22050
+ if (attrResp.DisableApiTermination?.Value !== void 0) {
22051
+ result["DisableApiTermination"] = attrResp.DisableApiTermination.Value;
22052
+ }
22053
+ } catch (err) {
22054
+ this.logger.debug(
22055
+ `DescribeInstanceAttribute(disableApiTermination, ${physicalId}) failed: ${err instanceof Error ? err.message : String(err)}`
22056
+ );
22057
+ }
22040
22058
  return result;
22041
22059
  }
22042
22060
  async readNetworkAclCurrentState(physicalId) {
@@ -35729,9 +35747,22 @@ var FirehoseProvider = class {
35729
35747
  *
35730
35748
  * Non-S3 destination types
35731
35749
  * (`Redshift`/`Elasticsearch`/`Amazonopensearchservice`/`Splunk`/`HttpEndpoint`/`AmazonOpenSearchServerless`)
35732
- * stay drift-unknown — declared via `getDriftUnknownPaths()` until
35733
- * per-destination reverse-map lands. `DeliveryStreamEncryptionConfigurationInput`
35734
- * also drift-unknown.
35750
+ * are reverse-mapped via `mapRedshiftDescriptionToCfn` /
35751
+ * `mapHttpEndpointDescriptionToCfn` / `mapNonS3DestinationToCfn`. The
35752
+ * SDK reuses field names between Description and Configuration for
35753
+ * these destinations, so a `pickDefinedDeep` pass-through produces a
35754
+ * CFn-compatible shape. AWS-managed read-only `VpcId` is stripped
35755
+ * from `VpcConfigurationDescription`. Write-only fields AWS strips
35756
+ * from descriptions (`RedshiftDestinationConfiguration.Password`,
35757
+ * `HttpEndpointDestinationConfiguration.EndpointConfiguration.AccessKey`)
35758
+ * stay drift-unknown via `getDriftUnknownPaths` — no AWS API recovers them.
35759
+ *
35760
+ * `DeliveryStreamEncryptionConfigurationInput` is also surfaced. AWS
35761
+ * returns the read-side shape `DeliveryStreamEncryptionConfiguration`
35762
+ * (with extra `Status` / `FailureDescription` fields); we reverse-map
35763
+ * to the CFn input shape (`KeyARN` + `KeyType`) and always emit a
35764
+ * `{}` placeholder so the v3 baseline catches console-side encryption
35765
+ * enables on a previously-default stream.
35735
35766
  *
35736
35767
  * Tags are surfaced via a follow-up `ListTagsForDeliveryStream` call
35737
35768
  * with `aws:*` filtered out and always emitted as `[]` placeholder when
@@ -35780,7 +35811,38 @@ var FirehoseProvider = class {
35780
35811
  result["S3DestinationConfiguration"] = mapS3DescriptionToCfn(
35781
35812
  dest.S3DestinationDescription
35782
35813
  );
35814
+ } else if (dest?.RedshiftDestinationDescription) {
35815
+ result["RedshiftDestinationConfiguration"] = mapRedshiftDescriptionToCfn(
35816
+ dest.RedshiftDestinationDescription
35817
+ );
35818
+ } else if (dest?.ElasticsearchDestinationDescription) {
35819
+ result["ElasticsearchDestinationConfiguration"] = mapNonS3DestinationToCfn(
35820
+ dest.ElasticsearchDestinationDescription
35821
+ );
35822
+ } else if (dest?.AmazonopensearchserviceDestinationDescription) {
35823
+ result["AmazonopensearchserviceDestinationConfiguration"] = mapNonS3DestinationToCfn(
35824
+ dest.AmazonopensearchserviceDestinationDescription
35825
+ );
35826
+ } else if (dest?.AmazonOpenSearchServerlessDestinationDescription) {
35827
+ result["AmazonOpenSearchServerlessDestinationConfiguration"] = mapNonS3DestinationToCfn(
35828
+ dest.AmazonOpenSearchServerlessDestinationDescription
35829
+ );
35830
+ } else if (dest?.SplunkDestinationDescription) {
35831
+ result["SplunkDestinationConfiguration"] = mapNonS3DestinationToCfn(
35832
+ dest.SplunkDestinationDescription
35833
+ );
35834
+ } else if (dest?.HttpEndpointDestinationDescription) {
35835
+ result["HttpEndpointDestinationConfiguration"] = mapHttpEndpointDescriptionToCfn(
35836
+ dest.HttpEndpointDestinationDescription
35837
+ );
35783
35838
  }
35839
+ const enc = desc.DeliveryStreamEncryptionConfiguration;
35840
+ const encOut = {};
35841
+ if (enc?.KeyARN !== void 0)
35842
+ encOut["KeyARN"] = enc.KeyARN;
35843
+ if (enc?.KeyType !== void 0)
35844
+ encOut["KeyType"] = enc.KeyType;
35845
+ result["DeliveryStreamEncryptionConfigurationInput"] = encOut;
35784
35846
  try {
35785
35847
  const tagsResp = await this.getClient().send(
35786
35848
  new ListTagsForDeliveryStreamCommand({ DeliveryStreamName: physicalId })
@@ -35803,32 +35865,23 @@ var FirehoseProvider = class {
35803
35865
  * fire false-positive drift on every run. See the `readCurrentState`
35804
35866
  * docstring for the full rationale per category.
35805
35867
  *
35806
- * Categories:
35807
- * - Non-S3 destination types: shape divergence at scale (Description
35808
- * vs Configuration field naming, write-only redacted fields like
35809
- * Redshift `Password`); reverse-mapping is feasible per-destination
35810
- * but deferred until per-shape user demand emerges.
35811
- * - `DeliveryStreamEncryptionConfigurationInput`: input-only shape
35812
- * (`KeyARN` + `KeyType`) vs. read-side `DeliveryStreamEncryptionConfiguration`
35813
- * (extra status / failure fields); not yet round-tripped.
35814
- *
35815
- * S3 / ExtendedS3 inner nested fields (`EncryptionConfiguration` /
35816
- * `CloudWatchLoggingOptions` / `ProcessingConfiguration` /
35817
- * `DataFormatConversionConfiguration` / `DynamicPartitioningConfiguration` /
35818
- * `S3BackupConfiguration`) are now surfaced via `mapS3DescriptionToCfn`
35819
- * / `mapExtendedS3DescriptionToCfn` and no longer drift-unknown.
35868
+ * Only write-only fields AWS strips from descriptions remain:
35869
+ * Redshift `Password`, HttpEndpoint `EndpointConfiguration.AccessKey`.
35870
+ * State that carries these would otherwise fire drift on every run —
35871
+ * declaring them as drift-unknown is the cleanest fix because there
35872
+ * is no AWS read API to recover their values.
35873
+ *
35874
+ * S3 / ExtendedS3 inner nested fields, non-S3 destination types
35875
+ * (Redshift / Elasticsearch / Amazonopensearchservice / Splunk /
35876
+ * HttpEndpoint / AmazonOpenSearchServerless), and
35877
+ * `DeliveryStreamEncryptionConfigurationInput` are all reverse-mapped
35878
+ * by `readCurrentState` and no longer drift-unknown.
35820
35879
  */
35821
35880
  getDriftUnknownPaths() {
35822
35881
  return [
35823
- // Non-S3 destinations (drift-unknown until per-destination reverse-map lands)
35824
- "RedshiftDestinationConfiguration",
35825
- "ElasticsearchDestinationConfiguration",
35826
- "AmazonopensearchserviceDestinationConfiguration",
35827
- "SplunkDestinationConfiguration",
35828
- "HttpEndpointDestinationConfiguration",
35829
- "AmazonOpenSearchServerlessDestinationConfiguration",
35830
- // Encryption input shape (deferred)
35831
- "DeliveryStreamEncryptionConfigurationInput"
35882
+ // Write-only fields AWS does not return on read — no API workaround.
35883
+ "RedshiftDestinationConfiguration.Password",
35884
+ "HttpEndpointDestinationConfiguration.EndpointConfiguration.AccessKey"
35832
35885
  ];
35833
35886
  }
35834
35887
  async import(input) {
@@ -35956,6 +36009,70 @@ function mapExtendedS3DescriptionToCfn(desc) {
35956
36009
  }
35957
36010
  return out;
35958
36011
  }
36012
+ function mapNonS3DestinationToCfn(desc) {
36013
+ const cleaned = pickDefinedDeep(desc);
36014
+ if (!cleaned)
36015
+ return {};
36016
+ if (cleaned["VpcConfigurationDescription"]) {
36017
+ const vpc = { ...cleaned["VpcConfigurationDescription"] };
36018
+ delete vpc["VpcId"];
36019
+ delete cleaned["VpcConfigurationDescription"];
36020
+ if (Object.keys(vpc).length > 0)
36021
+ cleaned["VpcConfiguration"] = vpc;
36022
+ }
36023
+ return cleaned;
36024
+ }
36025
+ function mapRedshiftDescriptionToCfn(desc) {
36026
+ const out = {};
36027
+ for (const k of [
36028
+ "RoleARN",
36029
+ "ClusterJDBCURL",
36030
+ "CopyCommand",
36031
+ "Username",
36032
+ "RetryOptions",
36033
+ "ProcessingConfiguration",
36034
+ "S3BackupMode",
36035
+ "CloudWatchLoggingOptions",
36036
+ "SecretsManagerConfiguration"
36037
+ ]) {
36038
+ const v = pickDefinedDeep(desc[k]);
36039
+ if (v !== void 0)
36040
+ out[k] = v;
36041
+ }
36042
+ if (desc["S3DestinationDescription"]) {
36043
+ out["S3Configuration"] = mapS3DescriptionToCfn(
36044
+ desc["S3DestinationDescription"]
36045
+ );
36046
+ }
36047
+ if (desc["S3BackupDescription"]) {
36048
+ out["S3BackupConfiguration"] = mapS3DescriptionToCfn(
36049
+ desc["S3BackupDescription"]
36050
+ );
36051
+ }
36052
+ return out;
36053
+ }
36054
+ function mapHttpEndpointDescriptionToCfn(desc) {
36055
+ const out = {};
36056
+ for (const k of [
36057
+ "BufferingHints",
36058
+ "CloudWatchLoggingOptions",
36059
+ "RequestConfiguration",
36060
+ "ProcessingConfiguration",
36061
+ "RoleARN",
36062
+ "RetryOptions",
36063
+ "SecretsManagerConfiguration"
36064
+ ]) {
36065
+ const v = pickDefinedDeep(desc[k]);
36066
+ if (v !== void 0)
36067
+ out[k] = v;
36068
+ }
36069
+ if (desc["EndpointConfiguration"]) {
36070
+ const endpoint = pickDefinedDeep(desc["EndpointConfiguration"]);
36071
+ if (endpoint !== void 0)
36072
+ out["EndpointConfiguration"] = endpoint;
36073
+ }
36074
+ return out;
36075
+ }
35959
36076
 
35960
36077
  // src/provisioning/providers/cloudtrail-provider.ts
35961
36078
  import {
@@ -45093,7 +45210,7 @@ function reorderArgs(argv) {
45093
45210
  }
45094
45211
  async function main() {
45095
45212
  const program = new Command14();
45096
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.51.7");
45213
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.51.9");
45097
45214
  program.addCommand(createBootstrapCommand());
45098
45215
  program.addCommand(createSynthCommand());
45099
45216
  program.addCommand(createListCommand());