@go-to-k/cdkd 0.50.10 → 0.50.11

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
@@ -21988,7 +21988,7 @@ var ApiGatewayProvider = class _ApiGatewayProvider {
21988
21988
  * the IAM trust relationship hasn't fully propagated yet.
21989
21989
  */
21990
21990
  async updateAccountWithRetry(cloudWatchRoleArn, logicalId, _resourceType) {
21991
- const patchOperations = cloudWatchRoleArn ? [
21991
+ const patchOperations = cloudWatchRoleArn !== void 0 ? [
21992
21992
  {
21993
21993
  op: "replace",
21994
21994
  path: "/cloudwatchRoleArn",
@@ -22932,7 +22932,10 @@ var ApiGatewayProvider = class _ApiGatewayProvider {
22932
22932
  if (resp.authorizationType !== void 0) {
22933
22933
  result["AuthorizationType"] = resp.authorizationType;
22934
22934
  }
22935
- result["AuthorizerId"] = resp.authorizerId ?? "";
22935
+ const authType = resp.authorizationType;
22936
+ if (authType === "CUSTOM" || authType === "COGNITO_USER_POOLS") {
22937
+ result["AuthorizerId"] = resp.authorizerId ?? "";
22938
+ }
22936
22939
  result["Integration"] = resp.methodIntegration ?? {};
22937
22940
  result["MethodResponses"] = resp.methodResponses ?? {};
22938
22941
  return result;
@@ -23568,7 +23571,12 @@ var ApiGatewayV2Provider = class {
23568
23571
  if (resp.ProtocolType !== void 0)
23569
23572
  result["ProtocolType"] = resp.ProtocolType;
23570
23573
  result["Description"] = resp.Description ?? "";
23571
- result["CorsConfiguration"] = resp.CorsConfiguration ?? {};
23574
+ if (resp.ProtocolType === "HTTP") {
23575
+ result["CorsConfiguration"] = resp.CorsConfiguration ?? {};
23576
+ }
23577
+ if (resp.ProtocolType === "WEBSOCKET" && resp.RouteSelectionExpression !== void 0) {
23578
+ result["RouteSelectionExpression"] = resp.RouteSelectionExpression;
23579
+ }
23572
23580
  const tags = normalizeAwsTagsToCfn(resp.Tags);
23573
23581
  result["Tags"] = tags;
23574
23582
  return result;
@@ -23609,7 +23617,10 @@ var ApiGatewayV2Provider = class {
23609
23617
  const result = { ApiId: apiId };
23610
23618
  if (resp.IntegrationType !== void 0)
23611
23619
  result["IntegrationType"] = resp.IntegrationType;
23612
- result["IntegrationUri"] = resp.IntegrationUri ?? "";
23620
+ const uriRequired = resp.IntegrationType === "AWS" || resp.IntegrationType === "AWS_PROXY" || resp.IntegrationType === "HTTP" || resp.IntegrationType === "HTTP_PROXY";
23621
+ if (uriRequired) {
23622
+ result["IntegrationUri"] = resp.IntegrationUri ?? "";
23623
+ }
23613
23624
  result["IntegrationMethod"] = resp.IntegrationMethod ?? "";
23614
23625
  result["PayloadFormatVersion"] = resp.PayloadFormatVersion ?? "";
23615
23626
  return result;
@@ -23631,8 +23642,11 @@ var ApiGatewayV2Provider = class {
23631
23642
  if (resp.RouteKey !== void 0)
23632
23643
  result["RouteKey"] = resp.RouteKey;
23633
23644
  result["Target"] = resp.Target ?? "";
23634
- result["AuthorizationType"] = resp.AuthorizationType ?? "";
23635
- result["AuthorizerId"] = resp.AuthorizerId ?? "";
23645
+ result["AuthorizationType"] = resp.AuthorizationType ?? "NONE";
23646
+ if (resp.AuthorizationType && resp.AuthorizationType !== "NONE") {
23647
+ result["AuthorizerId"] = resp.AuthorizerId ?? "";
23648
+ result["AuthorizationScopes"] = resp.AuthorizationScopes ? [...resp.AuthorizationScopes] : [];
23649
+ }
23636
23650
  return result;
23637
23651
  } catch (err) {
23638
23652
  if (err instanceof NotFoundException4)
@@ -23653,9 +23667,12 @@ var ApiGatewayV2Provider = class {
23653
23667
  result["AuthorizerType"] = resp.AuthorizerType;
23654
23668
  result["Name"] = resp.Name ?? "";
23655
23669
  result["IdentitySource"] = resp.IdentitySource ? [...resp.IdentitySource] : [];
23656
- result["JwtConfiguration"] = resp.JwtConfiguration ?? {};
23657
- result["AuthorizerUri"] = resp.AuthorizerUri ?? "";
23658
- result["AuthorizerPayloadFormatVersion"] = resp.AuthorizerPayloadFormatVersion ?? "";
23670
+ if (resp.AuthorizerType === "JWT") {
23671
+ result["JwtConfiguration"] = resp.JwtConfiguration ?? {};
23672
+ } else if (resp.AuthorizerType === "REQUEST") {
23673
+ result["AuthorizerUri"] = resp.AuthorizerUri ?? "";
23674
+ result["AuthorizerPayloadFormatVersion"] = resp.AuthorizerPayloadFormatVersion ?? "";
23675
+ }
23659
23676
  return result;
23660
23677
  } catch (err) {
23661
23678
  if (err instanceof NotFoundException4)
@@ -25583,23 +25600,14 @@ var ECSProvider = class {
25583
25600
  );
25584
25601
  }
25585
25602
  }
25586
- async updateTaskDefinition(logicalId, physicalId, resourceType, properties) {
25587
- this.logger.debug(`Updating ECS task definition ${logicalId}: ${physicalId}`);
25588
- const result = await this.createTaskDefinition(logicalId, resourceType, properties);
25589
- try {
25590
- const client = this.getClient();
25591
- await client.send(new DeregisterTaskDefinitionCommand({ taskDefinition: physicalId }));
25592
- this.logger.debug(`Deregistered old task definition revision: ${physicalId}`);
25593
- } catch (error) {
25594
- this.logger.debug(
25595
- `Failed to deregister old task definition ${physicalId}: ${error instanceof Error ? error.message : String(error)}`
25596
- );
25597
- }
25598
- return {
25599
- physicalId: result.physicalId,
25600
- wasReplaced: false,
25601
- attributes: result.attributes ?? {}
25602
- };
25603
+ async updateTaskDefinition(logicalId, _physicalId, _resourceType, _properties) {
25604
+ return Promise.reject(
25605
+ new ResourceUpdateNotSupportedError(
25606
+ "AWS::ECS::TaskDefinition",
25607
+ logicalId,
25608
+ "TaskDefinition revisions are immutable; re-deploy with cdkd deploy --replace, or destroy + redeploy the stack"
25609
+ )
25610
+ );
25603
25611
  }
25604
25612
  async deleteTaskDefinition(logicalId, physicalId, resourceType, context) {
25605
25613
  this.logger.debug(`Deleting ECS task definition ${logicalId}: ${physicalId}`);
@@ -26138,11 +26146,19 @@ var ECSProvider = class {
26138
26146
  if (s.networkConfiguration)
26139
26147
  result["NetworkConfiguration"] = s.networkConfiguration;
26140
26148
  result["LoadBalancers"] = s.loadBalancers ?? [];
26141
- result["CapacityProviderStrategy"] = s.capacityProviderStrategy ?? [];
26149
+ if (s.capacityProviderStrategy && s.capacityProviderStrategy.length > 0) {
26150
+ result["CapacityProviderStrategy"] = s.capacityProviderStrategy;
26151
+ } else if (!s.launchType) {
26152
+ result["CapacityProviderStrategy"] = [];
26153
+ }
26142
26154
  if (s.deploymentConfiguration)
26143
26155
  result["DeploymentConfiguration"] = s.deploymentConfiguration;
26144
26156
  result["PlacementConstraints"] = s.placementConstraints ?? [];
26145
- result["PlacementStrategy"] = s.placementStrategy ?? [];
26157
+ if (s.launchType === "EC2" || s.launchType === "EXTERNAL") {
26158
+ result["PlacementStrategy"] = s.placementStrategy ?? [];
26159
+ } else if (s.placementStrategy && s.placementStrategy.length > 0) {
26160
+ result["PlacementStrategy"] = s.placementStrategy;
26161
+ }
26146
26162
  result["ServiceRegistries"] = s.serviceRegistries ?? [];
26147
26163
  const tags = normalizeAwsTagsToCfn(s.tags);
26148
26164
  result["Tags"] = tags;
@@ -31806,7 +31822,9 @@ var AppSyncProvider = class {
31806
31822
  if (ds.type !== void 0)
31807
31823
  result["Type"] = ds.type;
31808
31824
  result["Description"] = ds.description ?? "";
31809
- result["ServiceRoleArn"] = ds.serviceRoleArn ?? "";
31825
+ if (ds.serviceRoleArn !== void 0 && ds.serviceRoleArn !== "") {
31826
+ result["ServiceRoleArn"] = ds.serviceRoleArn;
31827
+ }
31810
31828
  if (ds.dynamodbConfig) {
31811
31829
  const dynamo = {};
31812
31830
  if (ds.dynamodbConfig.tableName !== void 0)
@@ -31852,24 +31870,29 @@ var AppSyncProvider = class {
31852
31870
  result["TypeName"] = resolver.typeName;
31853
31871
  if (resolver.fieldName !== void 0)
31854
31872
  result["FieldName"] = resolver.fieldName;
31855
- result["DataSourceName"] = resolver.dataSourceName ?? "";
31856
- result["RequestMappingTemplate"] = resolver.requestMappingTemplate ?? "";
31857
- result["ResponseMappingTemplate"] = resolver.responseMappingTemplate ?? "";
31858
31873
  if (resolver.kind !== void 0)
31859
31874
  result["Kind"] = resolver.kind;
31860
- result["PipelineConfig"] = {
31861
- Functions: resolver.pipelineConfig?.functions ? [...resolver.pipelineConfig.functions] : []
31862
- };
31863
- {
31864
- const runtime = {};
31865
- if (resolver.runtime?.name !== void 0)
31866
- runtime["Name"] = resolver.runtime.name;
31867
- if (resolver.runtime?.runtimeVersion !== void 0) {
31875
+ const kind = resolver.kind ?? "UNIT";
31876
+ if (kind === "PIPELINE") {
31877
+ result["PipelineConfig"] = {
31878
+ Functions: resolver.pipelineConfig?.functions ? [...resolver.pipelineConfig.functions] : []
31879
+ };
31880
+ } else {
31881
+ if (resolver.dataSourceName !== void 0 && resolver.dataSourceName !== "") {
31882
+ result["DataSourceName"] = resolver.dataSourceName;
31883
+ }
31884
+ }
31885
+ if (resolver.runtime?.name) {
31886
+ result["Code"] = resolver.code ?? "";
31887
+ const runtime = { Name: resolver.runtime.name };
31888
+ if (resolver.runtime.runtimeVersion !== void 0) {
31868
31889
  runtime["RuntimeVersion"] = resolver.runtime.runtimeVersion;
31869
31890
  }
31870
31891
  result["Runtime"] = runtime;
31892
+ } else {
31893
+ result["RequestMappingTemplate"] = resolver.requestMappingTemplate ?? "";
31894
+ result["ResponseMappingTemplate"] = resolver.responseMappingTemplate ?? "";
31871
31895
  }
31872
- result["Code"] = resolver.code ?? "";
31873
31896
  return result;
31874
31897
  }
31875
31898
  async readApiKey(physicalId) {
@@ -36982,7 +37005,9 @@ var S3TablesProvider = class {
36982
37005
  import {
36983
37006
  ECRClient as ECRClient2,
36984
37007
  CreateRepositoryCommand,
37008
+ DeleteLifecyclePolicyCommand,
36985
37009
  DeleteRepositoryCommand,
37010
+ DeleteRepositoryPolicyCommand,
36986
37011
  DescribeRepositoriesCommand,
36987
37012
  GetLifecyclePolicyCommand,
36988
37013
  PutLifecyclePolicyCommand,
@@ -37132,19 +37157,42 @@ var ECRProvider = class {
37132
37157
  })
37133
37158
  );
37134
37159
  this.logger.debug(`Updated lifecycle policy for ${physicalId}`);
37160
+ } else if (oldLifecycle?.LifecyclePolicyText) {
37161
+ try {
37162
+ await this.getClient().send(
37163
+ new DeleteLifecyclePolicyCommand({ repositoryName: physicalId })
37164
+ );
37165
+ this.logger.debug(`Deleted lifecycle policy for ${physicalId}`);
37166
+ } catch (err) {
37167
+ if (!(err instanceof LifecyclePolicyNotFoundException))
37168
+ throw err;
37169
+ }
37135
37170
  }
37136
37171
  }
37137
37172
  const newPolicy = properties["RepositoryPolicyText"];
37138
37173
  const oldPolicy = previousProperties["RepositoryPolicyText"];
37139
- if (JSON.stringify(newPolicy) !== JSON.stringify(oldPolicy) && newPolicy) {
37140
- const policyText = typeof newPolicy === "string" ? newPolicy : JSON.stringify(newPolicy);
37141
- await this.getClient().send(
37142
- new SetRepositoryPolicyCommand({
37143
- repositoryName: physicalId,
37144
- policyText
37145
- })
37146
- );
37147
- this.logger.debug(`Updated repository policy for ${physicalId}`);
37174
+ if (JSON.stringify(newPolicy) !== JSON.stringify(oldPolicy)) {
37175
+ if (newPolicy !== void 0 && newPolicy !== null && newPolicy !== "") {
37176
+ const policyText = typeof newPolicy === "string" ? newPolicy : JSON.stringify(newPolicy);
37177
+ await this.getClient().send(
37178
+ new SetRepositoryPolicyCommand({
37179
+ repositoryName: physicalId,
37180
+ policyText
37181
+ })
37182
+ );
37183
+ this.logger.debug(`Updated repository policy for ${physicalId}`);
37184
+ } else if (oldPolicy !== void 0 && oldPolicy !== null && oldPolicy !== "") {
37185
+ try {
37186
+ await this.getClient().send(
37187
+ new DeleteRepositoryPolicyCommand({ repositoryName: physicalId })
37188
+ );
37189
+ this.logger.debug(`Deleted repository policy for ${physicalId}`);
37190
+ } catch (err) {
37191
+ const code = err?.name ?? err?.__type ?? "";
37192
+ if (!code.includes("RepositoryPolicyNotFound"))
37193
+ throw err;
37194
+ }
37195
+ }
37148
37196
  }
37149
37197
  const newTags = properties["Tags"];
37150
37198
  const oldTags = previousProperties["Tags"];
@@ -37275,10 +37323,9 @@ var ECRProvider = class {
37275
37323
  ScanOnPush: r.imageScanningConfiguration?.scanOnPush ?? false
37276
37324
  };
37277
37325
  {
37278
- const enc = {
37279
- EncryptionType: r.encryptionConfiguration?.encryptionType ?? "AES256"
37280
- };
37281
- if (r.encryptionConfiguration?.kmsKey !== void 0) {
37326
+ const encType = r.encryptionConfiguration?.encryptionType ?? "AES256";
37327
+ const enc = { EncryptionType: encType };
37328
+ if (encType === "KMS" && r.encryptionConfiguration?.kmsKey) {
37282
37329
  enc["KmsKey"] = r.encryptionConfiguration.kmsKey;
37283
37330
  }
37284
37331
  result["EncryptionConfiguration"] = enc;
@@ -43737,7 +43784,7 @@ function reorderArgs(argv) {
43737
43784
  }
43738
43785
  async function main() {
43739
43786
  const program = new Command14();
43740
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.50.10");
43787
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.50.11");
43741
43788
  program.addCommand(createBootstrapCommand());
43742
43789
  program.addCommand(createSynthCommand());
43743
43790
  program.addCommand(createListCommand());