@go-to-k/cdkd 0.223.4 → 0.225.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { A as withErrorHandling, B as generateResourceNameWithFallback, C as StackHasActiveImportsError, F as getLiveRenderer, H as withStackName, I as PATTERN_B_NAME_PROPERTIES, L as PATTERN_B_RESOURCE_TYPES, M as getLogger, P as runStackBuffered, S as ResourceUpdateNotSupportedError, V as withSkipPrefix, _ as MissingCdkCliError, a as assertRegionMatch, b as ProvisioningError, f as LocalInvokeBuildError$1, i as resolveExplicitPhysicalId, k as normalizeAwsError, l as CdkdError, m as LocalStartServiceError, n as matchesCdkPath, o as disableInstanceApiTermination, p as LocalMigrateError, r as normalizeAwsTagsToCfn, s as isTerminationProtectionPropagationError, t as CDK_PATH_TAG, v as NestedStackChildDirectDestroyError, w as StackTerminationProtectionError, x as ResourceTimeoutError, y as PartialFailureError, z as generateResourceName } from "./import-helpers-wLipXr5g.js";
3
3
  import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-pjPwZz1r.js";
4
- import { $ as AssemblyReader, A as shouldRetainResource, B as getDefaultStateBucketName, C as applyRoleArnIfSet, D as LockManager, E as TemplateParser, F as formatDockerLoginError, G as resolveStateBucketWithDefault, H as resolveApp, I as getDockerCmd, J as CFN_TEMPLATE_BODY_LIMIT, K as resolveStateBucketWithDefaultAndSource, L as runDockerForeground, M as stringifyValue, N as WorkGraph, O as S3StateBackend, P as buildDockerImage, Q as uploadCfnTemplate, R as runDockerStreaming, S as IntrinsicFunctionResolver, T as DagBuilder, U as resolveCaptureObservedState, V as getLegacyStateBucketName, W as resolveSkipPrefix, X as MIGRATE_TMP_PREFIX, Y as CFN_TEMPLATE_URL_LIMIT, Z as findLargeInlineResources, _ as IAMRoleProvider, a as withRetry, b as findActionableSilentDrops, c as computeImplicitDeleteEdges, d as bold, f as cyan, g as yellow, h as red, i as withResourceDeadline, j as AssetPublisher, k as rebuildClientForBucketRegion, l as extractDeploymentEventError, m as green, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as isRetryableTransientError, p as gray, q as warnDeprecatedNoPrefixCliFlag, r as DeployEngine, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as resolveBucketRegion, u as formatResourceLine, v as collectInlinePolicyNamesManagedBySiblings, w as DiffCalculator, x as CloudControlProvider, y as ProviderRegistry, z as Synthesizer } from "./deploy-engine-D3oZBU4l.js";
4
+ import { $ as AssemblyReader, A as shouldRetainResource, B as getDefaultStateBucketName, C as applyRoleArnIfSet, D as LockManager, E as TemplateParser, F as formatDockerLoginError, G as resolveStateBucketWithDefault, H as resolveApp, I as getDockerCmd, J as CFN_TEMPLATE_BODY_LIMIT, K as resolveStateBucketWithDefaultAndSource, L as runDockerForeground, M as stringifyValue, N as WorkGraph, O as S3StateBackend, P as buildDockerImage, Q as uploadCfnTemplate, R as runDockerStreaming, S as IntrinsicFunctionResolver, T as DagBuilder, U as resolveCaptureObservedState, V as getLegacyStateBucketName, W as resolveSkipPrefix, X as MIGRATE_TMP_PREFIX, Y as CFN_TEMPLATE_URL_LIMIT, Z as findLargeInlineResources, _ as IAMRoleProvider, a as withRetry, b as findActionableSilentDrops, c as computeImplicitDeleteEdges, d as bold, f as cyan, g as yellow, h as red, i as withResourceDeadline, j as AssetPublisher, k as rebuildClientForBucketRegion, l as extractDeploymentEventError, m as green, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as isRetryableTransientError, p as gray, q as warnDeprecatedNoPrefixCliFlag, r as DeployEngine, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as resolveBucketRegion, u as formatResourceLine, v as collectInlinePolicyNamesManagedBySiblings, w as DiffCalculator, x as CloudControlProvider, y as ProviderRegistry, z as Synthesizer } from "./deploy-engine-D0CE-sUC.js";
5
5
  import { t as ASGProvider } from "./asg-provider-B_hrCxRx.js";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
7
7
  import { randomBytes, randomUUID } from "node:crypto";
@@ -30,7 +30,7 @@ import { basename, dirname, isAbsolute, join, resolve } from "node:path";
30
30
  import { execFile, spawn } from "node:child_process";
31
31
  import { tmpdir } from "node:os";
32
32
  import { AssociateVPCWithHostedZoneCommand, ChangeResourceRecordSetsCommand, ChangeTagsForResourceCommand, CreateHostedZoneCommand, CreateQueryLoggingConfigCommand, DeleteHostedZoneCommand, DeleteQueryLoggingConfigCommand, DisassociateVPCFromHostedZoneCommand, GetHostedZoneCommand, ListHostedZonesByNameCommand, ListHostedZonesCommand, ListQueryLoggingConfigsCommand, ListResourceRecordSetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$6, Route53Client, UpdateHostedZoneCommentCommand, UpdateHostedZoneFeaturesCommand } from "@aws-sdk/client-route-53";
33
- import { AddTagsCommand, CreateListenerCommand, CreateLoadBalancerCommand, CreateTargetGroupCommand, DeleteListenerCommand, DeleteLoadBalancerCommand, DeleteTargetGroupCommand, DescribeListenersCommand, DescribeLoadBalancerAttributesCommand, DescribeLoadBalancersCommand, DescribeTagsCommand, DescribeTargetGroupsCommand, ElasticLoadBalancingV2Client, ModifyListenerCommand, ModifyLoadBalancerAttributesCommand, ModifyTargetGroupCommand, RemoveTagsCommand, SetIpAddressTypeCommand, SetSecurityGroupsCommand, SetSubnetsCommand } from "@aws-sdk/client-elastic-load-balancing-v2";
33
+ import { AddTagsCommand, CreateListenerCommand, CreateLoadBalancerCommand, CreateTargetGroupCommand, DeleteListenerCommand, DeleteLoadBalancerCommand, DeleteTargetGroupCommand, DescribeListenerAttributesCommand, DescribeListenersCommand, DescribeLoadBalancerAttributesCommand, DescribeLoadBalancersCommand, DescribeTagsCommand, DescribeTargetGroupsCommand, ElasticLoadBalancingV2Client, ModifyListenerAttributesCommand, ModifyListenerCommand, ModifyLoadBalancerAttributesCommand, ModifyTargetGroupCommand, RemoveTagsCommand, SetIpAddressTypeCommand, SetSecurityGroupsCommand, SetSubnetsCommand } from "@aws-sdk/client-elastic-load-balancing-v2";
34
34
  import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, EnableKeyCommand, EnableKeyRotationCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, KMSClient, ListAliasesCommand, ListKeysCommand, ListResourceTagsCommand, NotFoundException as NotFoundException$2, PutKeyPolicyCommand, ScheduleKeyDeletionCommand, TagResourceCommand as TagResourceCommand$9, UntagResourceCommand as UntagResourceCommand$9, UpdateAliasCommand, UpdateKeyDescriptionCommand } from "@aws-sdk/client-kms";
35
35
  import { CreateRepositoryCommand, DeleteLifecyclePolicyCommand, DeleteRepositoryCommand, DeleteRepositoryPolicyCommand, DescribeRepositoriesCommand, ECRClient, GetAuthorizationTokenCommand, GetLifecyclePolicyCommand, LifecyclePolicyNotFoundException, ListTagsForResourceCommand as ListTagsForResourceCommand$7, PutImageScanningConfigurationCommand, PutImageTagMutabilityCommand, PutLifecyclePolicyCommand, RepositoryNotFoundException, SetRepositoryPolicyCommand, TagResourceCommand as TagResourceCommand$10 } from "@aws-sdk/client-ecr";
36
36
  import graphlib from "graphlib";
@@ -1553,7 +1553,7 @@ const FLUSH_INTERVAL_MS = 2e3;
1553
1553
  const FLUSH_EVENT_THRESHOLD = 50;
1554
1554
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
1555
1555
  function getCdkdVersion() {
1556
- return "0.223.4";
1556
+ return "0.225.0";
1557
1557
  }
1558
1558
  /**
1559
1559
  * Generate a time-sortable unique run id, e.g.
@@ -17323,6 +17323,7 @@ var ApiGatewayV2Provider = class {
17323
17323
  "IdentitySource",
17324
17324
  "JwtConfiguration",
17325
17325
  "AuthorizerUri",
17326
+ "AuthorizerCredentialsArn",
17326
17327
  "AuthorizerPayloadFormatVersion",
17327
17328
  "AuthorizerResultTtlInSeconds",
17328
17329
  "EnableSimpleResponses",
@@ -17618,6 +17619,7 @@ var ApiGatewayV2Provider = class {
17618
17619
  IdentitySource: properties["IdentitySource"] ? typeof properties["IdentitySource"] === "string" ? [properties["IdentitySource"]] : properties["IdentitySource"] : void 0,
17619
17620
  JwtConfiguration: properties["JwtConfiguration"],
17620
17621
  AuthorizerUri: properties["AuthorizerUri"],
17622
+ AuthorizerCredentialsArn: properties["AuthorizerCredentialsArn"],
17621
17623
  AuthorizerPayloadFormatVersion: properties["AuthorizerPayloadFormatVersion"],
17622
17624
  AuthorizerResultTtlInSeconds: properties["AuthorizerResultTtlInSeconds"],
17623
17625
  EnableSimpleResponses: properties["EnableSimpleResponses"],
@@ -17775,6 +17777,7 @@ var ApiGatewayV2Provider = class {
17775
17777
  else if (resp.AuthorizerType === "REQUEST") {
17776
17778
  result["AuthorizerUri"] = resp.AuthorizerUri ?? "";
17777
17779
  result["AuthorizerPayloadFormatVersion"] = resp.AuthorizerPayloadFormatVersion ?? "";
17780
+ if (resp.AuthorizerCredentialsArn !== void 0) result["AuthorizerCredentialsArn"] = resp.AuthorizerCredentialsArn;
17778
17781
  if (resp.AuthorizerResultTtlInSeconds !== void 0) result["AuthorizerResultTtlInSeconds"] = resp.AuthorizerResultTtlInSeconds;
17779
17782
  if (resp.EnableSimpleResponses !== void 0) result["EnableSimpleResponses"] = resp.EnableSimpleResponses;
17780
17783
  if (resp.IdentityValidationExpression !== void 0) result["IdentityValidationExpression"] = resp.IdentityValidationExpression;
@@ -18071,7 +18074,7 @@ var ApiGatewayV2Provider = class {
18071
18074
  /**
18072
18075
  * `UpdateAuthorizer` keys on `(ApiId, AuthorizerId)`. Mutable fields
18073
18076
  * cdkd manages: `AuthorizerType` / `Name` / `IdentitySource` /
18074
- * `JwtConfiguration` / `AuthorizerUri` /
18077
+ * `JwtConfiguration` / `AuthorizerUri` / `AuthorizerCredentialsArn` /
18075
18078
  * `AuthorizerPayloadFormatVersion` / `AuthorizerResultTtlInSeconds` /
18076
18079
  * `EnableSimpleResponses`.
18077
18080
  */
@@ -18108,6 +18111,10 @@ var ApiGatewayV2Provider = class {
18108
18111
  input.AuthorizerUri = properties["AuthorizerUri"];
18109
18112
  changed = true;
18110
18113
  }
18114
+ if (properties["AuthorizerCredentialsArn"] !== void 0 && properties["AuthorizerCredentialsArn"] !== previousProperties["AuthorizerCredentialsArn"]) {
18115
+ input.AuthorizerCredentialsArn = properties["AuthorizerCredentialsArn"];
18116
+ changed = true;
18117
+ }
18111
18118
  if (properties["AuthorizerPayloadFormatVersion"] !== void 0 && properties["AuthorizerPayloadFormatVersion"] !== previousProperties["AuthorizerPayloadFormatVersion"]) {
18112
18119
  input.AuthorizerPayloadFormatVersion = properties["AuthorizerPayloadFormatVersion"];
18113
18120
  changed = true;
@@ -20743,7 +20750,8 @@ var ELBv2Provider = class {
20743
20750
  "Protocol",
20744
20751
  "SslPolicy",
20745
20752
  "AlpnPolicy",
20746
- "MutualAuthentication"
20753
+ "MutualAuthentication",
20754
+ "ListenerAttributes"
20747
20755
  ])]
20748
20756
  ]);
20749
20757
  getClient() {
@@ -21035,10 +21043,29 @@ var ELBv2Provider = class {
21035
21043
  ...tags.length > 0 && { Tags: tags }
21036
21044
  }))).Listeners?.[0];
21037
21045
  if (!listener || !listener.ListenerArn) throw new Error("CreateListener did not return Listener ARN");
21038
- this.logger.debug(`Successfully created Listener ${logicalId}: ${listener.ListenerArn}`);
21046
+ const listenerArn = listener.ListenerArn;
21047
+ this.logger.debug(`Successfully created Listener ${logicalId}: ${listenerArn}`);
21048
+ try {
21049
+ const listenerAttributes = this.normalizeAttributes(properties["ListenerAttributes"]);
21050
+ if (listenerAttributes.length > 0) {
21051
+ await withRetry(() => this.getClient().send(new ModifyListenerAttributesCommand({
21052
+ ListenerArn: listenerArn,
21053
+ Attributes: listenerAttributes
21054
+ })), logicalId, { logger: this.logger });
21055
+ this.logger.debug(`Applied ${listenerAttributes.length} ListenerAttribute(s) for ${logicalId}`);
21056
+ }
21057
+ } catch (innerError) {
21058
+ try {
21059
+ await this.getClient().send(new DeleteListenerCommand({ ListenerArn: listenerArn }));
21060
+ this.logger.debug(`Cleaned up partially-created Listener ${logicalId} (${listenerArn}) after attributes-wiring failure`);
21061
+ } catch (cleanupError) {
21062
+ this.logger.warn(`Failed to clean up partially-created Listener ${logicalId} (${listenerArn}): ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}. Manual deletion may be required before the next deploy: aws elbv2 delete-listener --listener-arn ${listenerArn}`);
21063
+ }
21064
+ throw innerError;
21065
+ }
21039
21066
  return {
21040
- physicalId: listener.ListenerArn,
21041
- attributes: { ListenerArn: listener.ListenerArn }
21067
+ physicalId: listenerArn,
21068
+ attributes: { ListenerArn: listenerArn }
21042
21069
  };
21043
21070
  } catch (error) {
21044
21071
  const cause = error instanceof Error ? error : void 0;
@@ -21062,6 +21089,26 @@ var ELBv2Provider = class {
21062
21089
  ...alpnPolicy && alpnPolicy.length > 0 && { AlpnPolicy: alpnPolicy },
21063
21090
  ...mutualAuth !== void 0 && { MutualAuthentication: mutualAuth }
21064
21091
  }));
21092
+ const newAttrs = this.normalizeAttributes(properties["ListenerAttributes"]);
21093
+ const oldAttrs = this.normalizeAttributes(previousProperties["ListenerAttributes"]);
21094
+ const newAttrMap = new Map(newAttrs.map((a) => [a.Key, a.Value]));
21095
+ const oldAttrMap = new Map(oldAttrs.map((a) => [a.Key, a.Value]));
21096
+ const submittedAttrs = [];
21097
+ for (const [k, v] of newAttrMap) if (oldAttrMap.get(k) !== v) submittedAttrs.push({
21098
+ Key: k,
21099
+ Value: v
21100
+ });
21101
+ for (const [k] of oldAttrMap) if (!newAttrMap.has(k)) submittedAttrs.push({
21102
+ Key: k,
21103
+ Value: ""
21104
+ });
21105
+ if (submittedAttrs.length > 0) {
21106
+ await withRetry(() => this.getClient().send(new ModifyListenerAttributesCommand({
21107
+ ListenerArn: physicalId,
21108
+ Attributes: submittedAttrs
21109
+ })), logicalId, { logger: this.logger });
21110
+ this.logger.debug(`Applied ${submittedAttrs.length} ListenerAttributes change(s) for ${logicalId}`);
21111
+ }
21065
21112
  await this.applyTagDiff(physicalId, previousProperties["Tags"], properties["Tags"]);
21066
21113
  this.logger.debug(`Successfully updated Listener ${logicalId}`);
21067
21114
  return {
@@ -21098,6 +21145,38 @@ var ELBv2Provider = class {
21098
21145
  return properties["Tags"];
21099
21146
  }
21100
21147
  /**
21148
+ * Normalize a CFn `ListenerAttributes` value (an array of `{ Key, Value }`
21149
+ * objects) into the SDK's `Attributes` shape. CFn emits the `Value` as a
21150
+ * string (e.g. `"3600"`, `"false"`) — pass it through verbatim; the
21151
+ * `ModifyListenerAttributes` API takes string Key/Value pairs. Entries
21152
+ * missing a `Key` are dropped (an empty `Value` is a valid "clear the
21153
+ * override" signal, so only `Key` is required). Returns `[]` for an
21154
+ * absent / non-array value so callers can branch on `.length`.
21155
+ *
21156
+ * Values are coerced only from `string` / `number` / `boolean` — never
21157
+ * `String()`-coerced from an arbitrary object (which would yield
21158
+ * `[object Object]`); CFn emits these as strings already, so a non-scalar
21159
+ * value is malformed input and is dropped rather than silently stringified.
21160
+ */
21161
+ normalizeAttributes(raw) {
21162
+ if (!Array.isArray(raw)) return [];
21163
+ const out = [];
21164
+ for (const entry of raw) {
21165
+ if (entry === null || typeof entry !== "object") continue;
21166
+ const e = entry;
21167
+ if (typeof e.Key !== "string") continue;
21168
+ let value;
21169
+ if (e.Value === void 0 || e.Value === null) value = "";
21170
+ else if (typeof e.Value === "string" || typeof e.Value === "number" || typeof e.Value === "boolean") value = String(e.Value);
21171
+ else continue;
21172
+ out.push({
21173
+ Key: e.Key,
21174
+ Value: value
21175
+ });
21176
+ }
21177
+ return out;
21178
+ }
21179
+ /**
21101
21180
  * Apply a diff between old and new CFn-shape Tags arrays via ELBv2's
21102
21181
  * `AddTags` / `RemoveTags` APIs. Both accept `ResourceArns: [arn]`
21103
21182
  * (single ARN), `Tags: [{Key, Value}]` for AddTags, and
@@ -21260,6 +21339,14 @@ var ELBv2Provider = class {
21260
21339
  result["DefaultActions"] = (listener.DefaultActions ?? []).map((a) => a);
21261
21340
  result["AlpnPolicy"] = listener.AlpnPolicy ?? [];
21262
21341
  result["MutualAuthentication"] = listener.MutualAuthentication ?? {};
21342
+ try {
21343
+ result["ListenerAttributes"] = ((await this.getClient().send(new DescribeListenerAttributesCommand({ ListenerArn: physicalId }))).Attributes ?? []).filter((a) => typeof a.Key === "string" && typeof a.Value === "string").map((a) => ({
21344
+ Key: a.Key,
21345
+ Value: a.Value
21346
+ })).sort((a, b) => a.Key.localeCompare(b.Key));
21347
+ } catch (err) {
21348
+ if (this.isNotFoundError(err)) return void 0;
21349
+ }
21263
21350
  await this.attachTags(result, physicalId);
21264
21351
  return result;
21265
21352
  }
@@ -54528,7 +54615,7 @@ function reorderArgs(argv) {
54528
54615
  async function main() {
54529
54616
  installPipeCloseHandler();
54530
54617
  const program = new Command();
54531
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.223.4");
54618
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.225.0");
54532
54619
  program.addCommand(createBootstrapCommand());
54533
54620
  program.addCommand(createSynthCommand());
54534
54621
  program.addCommand(createListCommand());