@go-to-k/cdkd 0.101.0 → 0.101.2

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
@@ -11,7 +11,7 @@ import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk
11
11
  import { AssociateRouteTableCommand, AttachInternetGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAvailabilityZonesCommand, DescribeInstanceAttributeCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DetachInternetGatewayCommand, DisassociateRouteTableCommand, EC2Client, ModifyInstanceAttributeCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ReplaceNetworkAclAssociationCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, TerminateInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
12
12
  import { CreateTableCommand, DeleteTableCommand, DescribeTableCommand, DynamoDBClient, ListTablesCommand, ListTagsOfResourceCommand, ResourceNotFoundException as ResourceNotFoundException$1, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateTableCommand } from "@aws-sdk/client-dynamodb";
13
13
  import { CloudFormationClient, CreateChangeSetCommand, DeleteChangeSetCommand, DeleteStackCommand, DescribeChangeSetCommand, DescribeStackEventsCommand, DescribeStackResourcesCommand, DescribeStacksCommand, DescribeTypeCommand, ExecuteChangeSetCommand, GetTemplateCommand, UpdateStackCommand, waitUntilChangeSetCreateComplete, waitUntilStackDeleteComplete, waitUntilStackImportComplete, waitUntilStackUpdateComplete } from "@aws-sdk/client-cloudformation";
14
- import { APIGatewayClient, CreateAuthorizerCommand, CreateDeploymentCommand, CreateResourceCommand, CreateStageCommand, DeleteAuthorizerCommand, DeleteDeploymentCommand, DeleteMethodCommand, DeleteResourceCommand, DeleteStageCommand, GetAccountCommand, GetAuthorizerCommand, GetDeploymentCommand, GetMethodCommand, GetResourceCommand, GetStageCommand, NotFoundException as NotFoundException$1, PutIntegrationCommand, PutMethodCommand, PutMethodResponseCommand, TagResourceCommand as TagResourceCommand$3, UntagResourceCommand as UntagResourceCommand$3, UpdateAccountCommand, UpdateAuthorizerCommand, UpdateMethodCommand, UpdateStageCommand } from "@aws-sdk/client-api-gateway";
14
+ import { APIGatewayClient, CreateAuthorizerCommand, CreateDeploymentCommand, CreateResourceCommand, CreateStageCommand, DeleteAuthorizerCommand, DeleteDeploymentCommand, DeleteMethodCommand, DeleteResourceCommand, DeleteStageCommand, GetAccountCommand, GetAuthorizerCommand, GetDeploymentCommand, GetMethodCommand, GetResourceCommand, GetStageCommand, NotFoundException as NotFoundException$1, PutIntegrationCommand, PutIntegrationResponseCommand, PutMethodCommand, PutMethodResponseCommand, TagResourceCommand as TagResourceCommand$3, UntagResourceCommand as UntagResourceCommand$3, UpdateAccountCommand, UpdateAuthorizerCommand, UpdateMethodCommand, UpdateStageCommand } from "@aws-sdk/client-api-gateway";
15
15
  import { CreateEventBusCommand, DeleteEventBusCommand, DeleteRuleCommand, DescribeEventBusCommand, DescribeRuleCommand, EventBridgeClient, ListEventBusesCommand, ListRulesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$1, ListTargetsByRuleCommand, PutRuleCommand, PutTargetsCommand, RemoveTargetsCommand, ResourceNotFoundException as ResourceNotFoundException$2, TagResourceCommand as TagResourceCommand$4, UntagResourceCommand as UntagResourceCommand$4, UpdateEventBusCommand } from "@aws-sdk/client-eventbridge";
16
16
  import { CreateSecretCommand, DeleteSecretCommand, DescribeSecretCommand, GetSecretValueCommand, ListSecretsCommand, RemoveRegionsFromReplicationCommand, ReplicateSecretToRegionsCommand, ResourceNotFoundException as ResourceNotFoundException$3, SecretsManagerClient, TagResourceCommand as TagResourceCommand$5, UntagResourceCommand as UntagResourceCommand$5, UpdateSecretCommand } from "@aws-sdk/client-secrets-manager";
17
17
  import { AddTagsToResourceCommand, DeleteParameterCommand, DescribeParametersCommand, GetParameterCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$2, ParameterNotFound, PutParameterCommand, RemoveTagsFromResourceCommand, SSMClient } from "@aws-sdk/client-ssm";
@@ -11757,6 +11757,12 @@ var ApiGatewayProvider = class ApiGatewayProvider {
11757
11757
  "HttpMethod",
11758
11758
  "AuthorizationType",
11759
11759
  "AuthorizerId",
11760
+ "ApiKeyRequired",
11761
+ "OperationName",
11762
+ "RequestParameters",
11763
+ "RequestModels",
11764
+ "RequestValidatorId",
11765
+ "AuthorizationScopes",
11760
11766
  "Integration",
11761
11767
  "MethodResponses"
11762
11768
  ])]
@@ -12317,8 +12323,32 @@ var ApiGatewayProvider = class ApiGatewayProvider {
12317
12323
  /**
12318
12324
  * Create an API Gateway Method
12319
12325
  *
12320
- * Creates a method on a resource and optionally sets up the integration.
12326
+ * Creates a method on a resource and optionally sets up the integration
12327
+ * (and per-status-code integration responses) plus method responses.
12321
12328
  * PhysicalId format: `{restApiId}|{resourceId}|{httpMethod}`
12329
+ *
12330
+ * All mutable Method-level fields supported by `PutMethodRequest` are
12331
+ * forwarded (`ApiKeyRequired`, `OperationName`, `RequestParameters`,
12332
+ * `RequestModels`, `RequestValidatorId`, `AuthorizationScopes`).
12333
+ *
12334
+ * All mutable Integration-level fields supported by
12335
+ * `PutIntegrationRequest` are forwarded (`ConnectionType`,
12336
+ * `ConnectionId`, `Credentials`, `RequestParameters`, `RequestTemplates`,
12337
+ * `PassthroughBehavior`, `ContentHandling`, `TimeoutInMillis`,
12338
+ * `CacheNamespace`, `CacheKeyParameters`, `TlsConfig`,
12339
+ * `ResponseTransferMode`). Pre-fix only `Type` / `IntegrationHttpMethod`
12340
+ * / `Uri` were forwarded — silently dropping every other field. This
12341
+ * surfaced as e.g. `responseTransferMode: 'STREAM'` being lost,
12342
+ * producing the AWS rejection
12343
+ * "Invalid ResponseTransferMode. Cannot use ResponseTransferMode
12344
+ * BUFFERED for Lambda functions invoked by InvokeWithResponseStream
12345
+ * for AWS_PROXY integrations."
12346
+ * when CDK's `LambdaIntegration({ responseTransferMode: STREAM })` was
12347
+ * used together with the streaming `response-streaming-invocations` URI.
12348
+ *
12349
+ * `IntegrationResponses` (the CFn array shape under `Integration`) is
12350
+ * applied via per-entry `PutIntegrationResponseCommand` calls after the
12351
+ * integration itself is put in place.
12322
12352
  */
12323
12353
  async createMethod(logicalId, resourceType, properties) {
12324
12354
  this.logger.debug(`Creating API Gateway Method ${logicalId}`);
@@ -12327,6 +12357,12 @@ var ApiGatewayProvider = class ApiGatewayProvider {
12327
12357
  const httpMethod = properties["HttpMethod"];
12328
12358
  const authorizationType = properties["AuthorizationType"] ?? "NONE";
12329
12359
  const authorizerId = properties["AuthorizerId"];
12360
+ const apiKeyRequired = properties["ApiKeyRequired"];
12361
+ const operationName = properties["OperationName"];
12362
+ const methodRequestParameters = properties["RequestParameters"];
12363
+ const requestModels = properties["RequestModels"];
12364
+ const requestValidatorId = properties["RequestValidatorId"];
12365
+ const authorizationScopes = properties["AuthorizationScopes"];
12330
12366
  if (!restApiId || !resourceId || !httpMethod) throw new ProvisioningError(`RestApiId, ResourceId, and HttpMethod are required for API Gateway Method ${logicalId}`, resourceType, logicalId);
12331
12367
  try {
12332
12368
  await this.apiGatewayClient.send(new PutMethodCommand({
@@ -12334,17 +12370,51 @@ var ApiGatewayProvider = class ApiGatewayProvider {
12334
12370
  resourceId,
12335
12371
  httpMethod,
12336
12372
  authorizationType,
12337
- authorizerId
12373
+ authorizerId,
12374
+ apiKeyRequired,
12375
+ operationName,
12376
+ requestParameters: methodRequestParameters,
12377
+ requestModels,
12378
+ requestValidatorId,
12379
+ authorizationScopes
12338
12380
  }));
12339
12381
  const integration = properties["Integration"];
12340
- if (integration) await this.apiGatewayClient.send(new PutIntegrationCommand({
12341
- restApiId,
12342
- resourceId,
12343
- httpMethod,
12344
- type: integration["Type"],
12345
- integrationHttpMethod: integration["IntegrationHttpMethod"],
12346
- uri: integration["Uri"]
12347
- }));
12382
+ if (integration) {
12383
+ await this.apiGatewayClient.send(new PutIntegrationCommand({
12384
+ restApiId,
12385
+ resourceId,
12386
+ httpMethod,
12387
+ type: integration["Type"],
12388
+ integrationHttpMethod: integration["IntegrationHttpMethod"],
12389
+ uri: integration["Uri"],
12390
+ connectionType: integration["ConnectionType"],
12391
+ connectionId: integration["ConnectionId"],
12392
+ credentials: integration["Credentials"],
12393
+ requestParameters: integration["RequestParameters"],
12394
+ requestTemplates: integration["RequestTemplates"],
12395
+ passthroughBehavior: integration["PassthroughBehavior"],
12396
+ contentHandling: integration["ContentHandling"],
12397
+ timeoutInMillis: integration["TimeoutInMillis"],
12398
+ cacheNamespace: integration["CacheNamespace"],
12399
+ cacheKeyParameters: integration["CacheKeyParameters"],
12400
+ tlsConfig: integration["TlsConfig"] ? { insecureSkipVerification: integration["TlsConfig"]["InsecureSkipVerification"] } : void 0,
12401
+ responseTransferMode: integration["ResponseTransferMode"]
12402
+ }));
12403
+ const integrationResponses = integration["IntegrationResponses"];
12404
+ if (integrationResponses) for (const ir of integrationResponses) {
12405
+ const statusCode = String(ir["StatusCode"]);
12406
+ await this.apiGatewayClient.send(new PutIntegrationResponseCommand({
12407
+ restApiId,
12408
+ resourceId,
12409
+ httpMethod,
12410
+ statusCode,
12411
+ selectionPattern: ir["SelectionPattern"],
12412
+ responseParameters: ir["ResponseParameters"],
12413
+ responseTemplates: ir["ResponseTemplates"],
12414
+ contentHandling: ir["ContentHandling"]
12415
+ }));
12416
+ }
12417
+ }
12348
12418
  const methodResponses = properties["MethodResponses"];
12349
12419
  if (methodResponses) for (const resp of methodResponses) {
12350
12420
  const statusCode = String(resp["StatusCode"]);
@@ -12381,6 +12451,10 @@ var ApiGatewayProvider = class ApiGatewayProvider {
12381
12451
  * `/requestParameters/method.request.querystring.foo`
12382
12452
  * `/requestModels/application~1json` (slashes escaped per RFC 6901).
12383
12453
  *
12454
+ * `AuthorizationScopes` is an array — AWS accepts a comma-joined
12455
+ * `replace /authorizationScopes` op (same pattern as Authorizer's
12456
+ * `ProviderARNs`).
12457
+ *
12384
12458
  * `HttpMethod`, `ResourceId`, `RestApiId` are immutable (replacement
12385
12459
  * layer handles them via DELETE + CREATE).
12386
12460
  *
@@ -12436,6 +12510,13 @@ var ApiGatewayProvider = class ApiGatewayProvider {
12436
12510
  }
12437
12511
  appendMapPatchOps(patchOperations, "/requestParameters", properties["RequestParameters"] ?? {}, previousProperties["RequestParameters"] ?? {});
12438
12512
  appendMapPatchOps(patchOperations, "/requestModels", properties["RequestModels"] ?? {}, previousProperties["RequestModels"] ?? {});
12513
+ const newScopes = properties["AuthorizationScopes"];
12514
+ const prevScopes = previousProperties["AuthorizationScopes"];
12515
+ if ((newScopes?.length ?? 0) !== (prevScopes?.length ?? 0) || (newScopes ?? []).some((s, i) => s !== prevScopes?.[i])) patchOperations.push({
12516
+ op: "replace",
12517
+ path: "/authorizationScopes",
12518
+ value: (newScopes ?? []).join(",")
12519
+ });
12439
12520
  if (patchOperations.length === 0) {
12440
12521
  this.logger.debug(`No changes detected for API Gateway Method ${logicalId}`);
12441
12522
  return {
@@ -42616,7 +42697,7 @@ function reorderArgs(argv) {
42616
42697
  */
42617
42698
  async function main() {
42618
42699
  const program = new Command();
42619
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.101.0");
42700
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.101.2");
42620
42701
  program.addCommand(createBootstrapCommand());
42621
42702
  program.addCommand(createSynthCommand());
42622
42703
  program.addCommand(createListCommand());