@go-to-k/cdkd 0.141.1 → 0.143.0
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 +92 -12
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -27395,6 +27395,16 @@ var EFSProvider = class {
|
|
|
27395
27395
|
//#endregion
|
|
27396
27396
|
//#region src/provisioning/providers/firehose-provider.ts
|
|
27397
27397
|
/**
|
|
27398
|
+
* CFn destination property names that this provider can apply
|
|
27399
|
+
* in-place via UpdateDestinationCommand. Other destination types
|
|
27400
|
+
* still hard-reject in update() with a tightened error pointing at
|
|
27401
|
+
* the per-shape reverse-mapper follow-up issue (#549).
|
|
27402
|
+
*
|
|
27403
|
+
* Membership grows as each follow-up PR lands. Keep alphabetical
|
|
27404
|
+
* to minimize merge conflicts when multiple follow-ups race.
|
|
27405
|
+
*/
|
|
27406
|
+
const SUPPORTED_UPDATE_DESTINATIONS = new Set(["ExtendedS3DestinationConfiguration", "RedshiftDestinationConfiguration"]);
|
|
27407
|
+
/**
|
|
27398
27408
|
* SDK Provider for AWS Kinesis Firehose resources
|
|
27399
27409
|
*
|
|
27400
27410
|
* Supports:
|
|
@@ -27586,16 +27596,29 @@ var FirehoseProvider = class {
|
|
|
27586
27596
|
* `DescribeDeliveryStream` call, then applies the diff. Only fires
|
|
27587
27597
|
* when the destination shape actually differs.
|
|
27588
27598
|
*
|
|
27599
|
+
* - `RedshiftDestinationConfiguration` (#549) — same flow as
|
|
27600
|
+
* ExtendedS3: `DescribeDeliveryStream` recovers VersionId +
|
|
27601
|
+
* DestinationId, then `UpdateDestinationCommand` issues the
|
|
27602
|
+
* diff with a `RedshiftDestinationUpdate` payload produced by
|
|
27603
|
+
* {@link mapRedshiftConfigToUpdate}. Handles `CopyCommand`,
|
|
27604
|
+
* `RetryOptions`, `S3Configuration` → `S3Update`,
|
|
27605
|
+
* `S3BackupConfiguration` → `S3BackupUpdate`,
|
|
27606
|
+
* `ProcessingConfiguration`, `S3BackupMode`,
|
|
27607
|
+
* `CloudWatchLoggingOptions`, `Username` / `Password` /
|
|
27608
|
+
* `RoleARN` / `ClusterJDBCURL`.
|
|
27609
|
+
*
|
|
27589
27610
|
* Other destination types (`S3DestinationConfiguration`,
|
|
27590
|
-
* `HttpEndpointDestinationConfiguration`,
|
|
27611
|
+
* `HttpEndpointDestinationConfiguration`,
|
|
27591
27612
|
* `ElasticsearchDestinationConfiguration`,
|
|
27592
27613
|
* `AmazonopensearchserviceDestinationConfiguration`,
|
|
27593
27614
|
* `SplunkDestinationConfiguration`,
|
|
27594
|
-
* `AmazonOpenSearchServerlessDestinationConfiguration
|
|
27595
|
-
*
|
|
27596
|
-
*
|
|
27597
|
-
*
|
|
27598
|
-
*
|
|
27615
|
+
* `AmazonOpenSearchServerlessDestinationConfiguration`,
|
|
27616
|
+
* `IcebergDestinationConfiguration`,
|
|
27617
|
+
* `SnowflakeDestinationConfiguration`) stay rejected with a tightened
|
|
27618
|
+
* error message naming the AWS API. Each one is a follow-up to (#549)
|
|
27619
|
+
* — AWS provides `UpdateDestination` for them too, but the per-shape
|
|
27620
|
+
* reverse-mappers are deep and each warrants its own focused PR.
|
|
27621
|
+
* Re-deploy with `cdkd deploy --replace` until they land.
|
|
27599
27622
|
*
|
|
27600
27623
|
* Destination-type SWITCHES (e.g. ExtendedS3 → Redshift) are immutable
|
|
27601
27624
|
* on AWS; cdkd surfaces `ResourceUpdateNotSupportedError` so the caller
|
|
@@ -27607,10 +27630,10 @@ var FirehoseProvider = class {
|
|
|
27607
27630
|
const prevDestKey = this.findDestinationKey(previousProperties);
|
|
27608
27631
|
if (destKey && prevDestKey && destKey !== prevDestKey) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `Switching Firehose destination type from '${prevDestKey}' to '${destKey}' is not supported in-place — AWS UpdateDestination requires the same destination type as the original CreateDeliveryStream. Re-deploy with cdkd deploy --replace.`);
|
|
27609
27632
|
const activeDest = destKey ?? prevDestKey;
|
|
27610
|
-
if (activeDest && activeDest
|
|
27633
|
+
if (activeDest && !SUPPORTED_UPDATE_DESTINATIONS.has(activeDest)) {
|
|
27611
27634
|
const nextDest = properties[activeDest] ?? {};
|
|
27612
27635
|
const prevDest = previousProperties[activeDest] ?? {};
|
|
27613
|
-
if (JSON.stringify(nextDest) !== JSON.stringify(prevDest)) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `In-place update for '${activeDest}' on AWS::KinesisFirehose::DeliveryStream is not yet implemented in cdkd (AWS exposes UpdateDestination for it; the per-shape reverse-mapper is a follow-up to #
|
|
27636
|
+
if (JSON.stringify(nextDest) !== JSON.stringify(prevDest)) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `In-place update for '${activeDest}' on AWS::KinesisFirehose::DeliveryStream is not yet implemented in cdkd (AWS exposes UpdateDestination for it; the per-shape reverse-mapper is a follow-up to #549). Re-deploy with cdkd deploy --replace.`);
|
|
27614
27637
|
}
|
|
27615
27638
|
await this.applyTagsDiff(physicalId, properties["Tags"], previousProperties["Tags"]);
|
|
27616
27639
|
if (activeDest === "ExtendedS3DestinationConfiguration") {
|
|
@@ -27618,6 +27641,11 @@ var FirehoseProvider = class {
|
|
|
27618
27641
|
const prevDest = previousProperties[activeDest] ?? {};
|
|
27619
27642
|
if (JSON.stringify(nextDest) !== JSON.stringify(prevDest)) await this.applyExtendedS3DestinationUpdate(physicalId, nextDest);
|
|
27620
27643
|
}
|
|
27644
|
+
if (activeDest === "RedshiftDestinationConfiguration") {
|
|
27645
|
+
const nextDest = properties[activeDest] ?? {};
|
|
27646
|
+
const prevDest = previousProperties[activeDest] ?? {};
|
|
27647
|
+
if (JSON.stringify(nextDest) !== JSON.stringify(prevDest)) await this.applyRedshiftDestinationUpdate(physicalId, nextDest);
|
|
27648
|
+
}
|
|
27621
27649
|
const desc = (await this.getClient().send(new DescribeDeliveryStreamCommand({ DeliveryStreamName: physicalId }))).DeliveryStreamDescription;
|
|
27622
27650
|
return {
|
|
27623
27651
|
physicalId,
|
|
@@ -27811,6 +27839,54 @@ var FirehoseProvider = class {
|
|
|
27811
27839
|
return result;
|
|
27812
27840
|
}
|
|
27813
27841
|
/**
|
|
27842
|
+
* Recover `CurrentDeliveryStreamVersionId` + `DestinationId` from
|
|
27843
|
+
* `DescribeDeliveryStream` and issue `UpdateDestination` with the new
|
|
27844
|
+
* Redshift shape. The reverse-mapper at
|
|
27845
|
+
* {@link mapRedshiftConfigToUpdate} produces the
|
|
27846
|
+
* `RedshiftDestinationUpdate` payload — only fields present in the
|
|
27847
|
+
* input are forwarded so omitted CFn keys don't clobber AWS-side
|
|
27848
|
+
* state. Mirrors {@link applyExtendedS3DestinationUpdate} (#549).
|
|
27849
|
+
*/
|
|
27850
|
+
async applyRedshiftDestinationUpdate(physicalId, nextConfig) {
|
|
27851
|
+
const desc = (await this.getClient().send(new DescribeDeliveryStreamCommand({ DeliveryStreamName: physicalId }))).DeliveryStreamDescription;
|
|
27852
|
+
const currentVersionId = desc?.VersionId;
|
|
27853
|
+
const destinationId = (desc?.Destinations?.[0])?.DestinationId;
|
|
27854
|
+
if (!currentVersionId || !destinationId) throw new ProvisioningError(`DescribeDeliveryStream for ${physicalId} did not return VersionId or DestinationId; UpdateDestination cannot proceed.`, "AWS::KinesisFirehose::DeliveryStream", physicalId);
|
|
27855
|
+
await this.getClient().send(new UpdateDestinationCommand({
|
|
27856
|
+
DeliveryStreamName: physicalId,
|
|
27857
|
+
CurrentDeliveryStreamVersionId: currentVersionId,
|
|
27858
|
+
DestinationId: destinationId,
|
|
27859
|
+
RedshiftDestinationUpdate: this.mapRedshiftConfigToUpdate(nextConfig)
|
|
27860
|
+
}));
|
|
27861
|
+
}
|
|
27862
|
+
/**
|
|
27863
|
+
* Map CFn `RedshiftDestinationConfiguration` to the
|
|
27864
|
+
* `RedshiftDestinationUpdate` shape used by AWS
|
|
27865
|
+
* `UpdateDestinationCommand` (#549). Every field is `!== undefined`
|
|
27866
|
+
* gated so omitted CFn keys do not clobber AWS-side state. The CFn
|
|
27867
|
+
* `S3Configuration` field is mapped through
|
|
27868
|
+
* {@link mapS3ConfigToUpdate} into the SDK-side `S3Update` slot;
|
|
27869
|
+
* `S3BackupConfiguration` likewise into `S3BackupUpdate`.
|
|
27870
|
+
*/
|
|
27871
|
+
mapRedshiftConfigToUpdate(config) {
|
|
27872
|
+
const result = {};
|
|
27873
|
+
const roleArn = config["RoleArn"] ?? config["RoleARN"];
|
|
27874
|
+
if (roleArn !== void 0) result.RoleARN = roleArn;
|
|
27875
|
+
const clusterJdbcUrl = config["ClusterJDBCURL"] ?? config["ClusterJdbcUrl"];
|
|
27876
|
+
if (clusterJdbcUrl !== void 0) result.ClusterJDBCURL = clusterJdbcUrl;
|
|
27877
|
+
if (config["CopyCommand"] !== void 0) result.CopyCommand = config["CopyCommand"];
|
|
27878
|
+
if (config["Username"] !== void 0) result.Username = config["Username"];
|
|
27879
|
+
if (config["Password"] !== void 0) result.Password = config["Password"];
|
|
27880
|
+
if (config["RetryOptions"] !== void 0) result.RetryOptions = config["RetryOptions"];
|
|
27881
|
+
if (config["S3Configuration"] !== void 0) result.S3Update = this.mapS3ConfigToUpdate(config["S3Configuration"]);
|
|
27882
|
+
if (config["ProcessingConfiguration"] !== void 0) result.ProcessingConfiguration = config["ProcessingConfiguration"];
|
|
27883
|
+
if (config["S3BackupMode"] !== void 0) result.S3BackupMode = config["S3BackupMode"];
|
|
27884
|
+
if (config["S3BackupConfiguration"] !== void 0) result.S3BackupUpdate = this.mapS3ConfigToUpdate(config["S3BackupConfiguration"]);
|
|
27885
|
+
if (config["CloudWatchLoggingOptions"] !== void 0) result.CloudWatchLoggingOptions = config["CloudWatchLoggingOptions"];
|
|
27886
|
+
if (config["SecretsManagerConfiguration"] !== void 0) result.SecretsManagerConfiguration = config["SecretsManagerConfiguration"];
|
|
27887
|
+
return result;
|
|
27888
|
+
}
|
|
27889
|
+
/**
|
|
27814
27890
|
* Map CFn `S3DestinationConfiguration` to the `S3DestinationUpdate`
|
|
27815
27891
|
* shape used by AWS `UpdateDestinationCommand` (#477; consumed by
|
|
27816
27892
|
* {@link mapExtendedS3ConfigToUpdate} for the `S3BackupUpdate` field).
|
|
@@ -30471,8 +30547,10 @@ var ASGProvider = class ASGProvider {
|
|
|
30471
30547
|
const lt = properties["LaunchTemplate"];
|
|
30472
30548
|
if (!lt) return void 0;
|
|
30473
30549
|
const out = {};
|
|
30474
|
-
if (lt.LaunchTemplateId !== void 0)
|
|
30475
|
-
|
|
30550
|
+
if (lt.LaunchTemplateId !== void 0) {
|
|
30551
|
+
out.LaunchTemplateId = lt.LaunchTemplateId;
|
|
30552
|
+
if (lt.LaunchTemplateName !== void 0) this.logger.debug(`buildLaunchTemplate: both LaunchTemplateId (${lt.LaunchTemplateId}) and LaunchTemplateName (${lt.LaunchTemplateName}) templated; dropping Name (#551)`);
|
|
30553
|
+
} else if (lt.LaunchTemplateName !== void 0) out.LaunchTemplateName = lt.LaunchTemplateName;
|
|
30476
30554
|
if (lt.Version !== void 0) out.Version = String(lt.Version);
|
|
30477
30555
|
if (out.LaunchTemplateId === void 0 && out.LaunchTemplateName === void 0) return;
|
|
30478
30556
|
return out;
|
|
@@ -30654,7 +30732,9 @@ var ASGProvider = class ASGProvider {
|
|
|
30654
30732
|
if (lastObserved.size === expected.size && [...expected].every((a) => lastObserved.has(a))) return;
|
|
30655
30733
|
await new Promise((r) => setTimeout(r, ASGProvider.TG_CONVERGENCE_POLL_INTERVAL_MS));
|
|
30656
30734
|
}
|
|
30657
|
-
|
|
30735
|
+
const expectedSorted = [...expected].sort();
|
|
30736
|
+
const observedSorted = [...lastObserved].sort();
|
|
30737
|
+
this.logger.warn(`applyTargetGroupArnsDiff: TG set did not converge within ${ASGProvider.TG_CONVERGENCE_TIMEOUT_MS}ms for ASG ${physicalId}. expected=${JSON.stringify(expectedSorted)} observed=${JSON.stringify(observedSorted)}`);
|
|
30658
30738
|
}
|
|
30659
30739
|
async applyMetricsCollectionDiff(physicalId, next, prev) {
|
|
30660
30740
|
if (JSON.stringify(next ?? []) === JSON.stringify(prev ?? [])) return;
|
|
@@ -55159,7 +55239,7 @@ function reorderArgs(argv) {
|
|
|
55159
55239
|
*/
|
|
55160
55240
|
async function main() {
|
|
55161
55241
|
const program = new Command();
|
|
55162
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
55242
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.143.0");
|
|
55163
55243
|
program.addCommand(createBootstrapCommand());
|
|
55164
55244
|
program.addCommand(createSynthCommand());
|
|
55165
55245
|
program.addCommand(createListCommand());
|