@aws-cdk/integ-runner 2.197.14 → 2.197.15

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.
@@ -4670,7 +4670,7 @@ var require_semver2 = __commonJS({
4670
4670
  // ../cloud-assembly-schema/cli-version.json
4671
4671
  var require_cli_version = __commonJS({
4672
4672
  "../cloud-assembly-schema/cli-version.json"(exports2, module2) {
4673
- module2.exports = { version: "2.1118.1" };
4673
+ module2.exports = { version: "2.1118.2" };
4674
4674
  }
4675
4675
  });
4676
4676
 
@@ -112855,7 +112855,7 @@ var require_dist_cjs56 = __commonJS({
112855
112855
  __name(this, "ListResourcesCommand");
112856
112856
  }
112857
112857
  };
112858
- var UpdateResourceCommand = class extends smithyClient.Command.classBuilder().ep(commonParams6).m(function(Command, cs, config, o6) {
112858
+ var UpdateResourceCommand2 = class extends smithyClient.Command.classBuilder().ep(commonParams6).m(function(Command, cs, config, o6) {
112859
112859
  return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
112860
112860
  }).s("CloudApiService", "UpdateResource", {}).n("CloudControlClient", "UpdateResourceCommand").sc(schemas_0.UpdateResource$).build() {
112861
112861
  static {
@@ -112918,7 +112918,7 @@ var require_dist_cjs56 = __commonJS({
112918
112918
  GetResourceRequestStatusCommand,
112919
112919
  ListResourceRequestsCommand,
112920
112920
  ListResourcesCommand: ListResourcesCommand2,
112921
- UpdateResourceCommand
112921
+ UpdateResourceCommand: UpdateResourceCommand2
112922
112922
  };
112923
112923
  var paginators = {
112924
112924
  paginateListResourceRequests,
@@ -112979,7 +112979,7 @@ var require_dist_cjs56 = __commonJS({
112979
112979
  exports2.ListResourcesCommand = ListResourcesCommand2;
112980
112980
  exports2.Operation = Operation;
112981
112981
  exports2.OperationStatus = OperationStatus;
112982
- exports2.UpdateResourceCommand = UpdateResourceCommand;
112982
+ exports2.UpdateResourceCommand = UpdateResourceCommand2;
112983
112983
  exports2.paginateListResourceRequests = paginateListResourceRequests;
112984
112984
  exports2.paginateListResources = paginateListResources;
112985
112985
  exports2.waitForResourceRequestSuccess = waitForResourceRequestSuccess;
@@ -118643,7 +118643,7 @@ var require_dist_cjs57 = __commonJS({
118643
118643
  __name(this, "DescribeStackSetOperationCommand");
118644
118644
  }
118645
118645
  };
118646
- var DescribeTypeCommand = class extends smithyClient.Command.classBuilder().ep(commonParams6).m(function(Command, cs, config, o6) {
118646
+ var DescribeTypeCommand2 = class extends smithyClient.Command.classBuilder().ep(commonParams6).m(function(Command, cs, config, o6) {
118647
118647
  return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
118648
118648
  }).s("CloudFormation", "DescribeType", {}).n("CloudFormationClient", "DescribeTypeCommand").sc(schemas_0.DescribeType$).build() {
118649
118649
  static {
@@ -119941,7 +119941,7 @@ var require_dist_cjs57 = __commonJS({
119941
119941
  DescribeStacksCommand: DescribeStacksCommand2,
119942
119942
  DescribeStackSetCommand,
119943
119943
  DescribeStackSetOperationCommand,
119944
- DescribeTypeCommand,
119944
+ DescribeTypeCommand: DescribeTypeCommand2,
119945
119945
  DescribeTypeRegistrationCommand,
119946
119946
  DetectStackDriftCommand: DetectStackDriftCommand2,
119947
119947
  DetectStackResourceDriftCommand: DetectStackResourceDriftCommand2,
@@ -120622,7 +120622,7 @@ var require_dist_cjs57 = __commonJS({
120622
120622
  exports2.DescribeStackSetCommand = DescribeStackSetCommand;
120623
120623
  exports2.DescribeStackSetOperationCommand = DescribeStackSetOperationCommand;
120624
120624
  exports2.DescribeStacksCommand = DescribeStacksCommand2;
120625
- exports2.DescribeTypeCommand = DescribeTypeCommand;
120625
+ exports2.DescribeTypeCommand = DescribeTypeCommand2;
120626
120626
  exports2.DescribeTypeRegistrationCommand = DescribeTypeRegistrationCommand;
120627
120627
  exports2.DetailedStatus = DetailedStatus;
120628
120628
  exports2.DetectStackDriftCommand = DetectStackDriftCommand2;
@@ -285216,7 +285216,8 @@ var init_sdk = __esm({
285216
285216
  const client = new import_client_cloudcontrol.CloudControlClient(this.config);
285217
285217
  return {
285218
285218
  listResources: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudcontrol.ListResourcesCommand(input)), "listResources"),
285219
- getResource: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudcontrol.GetResourceCommand(input)), "getResource")
285219
+ getResource: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudcontrol.GetResourceCommand(input)), "getResource"),
285220
+ updateResource: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudcontrol.UpdateResourceCommand(input)), "updateResource")
285220
285221
  };
285221
285222
  }
285222
285223
  cloudFormation() {
@@ -285242,6 +285243,7 @@ var init_sdk = __esm({
285242
285243
  describeStackResourceDrifts: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudformation.DescribeStackResourceDriftsCommand(input)), "describeStackResourceDrifts"),
285243
285244
  describeStacks: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudformation.DescribeStacksCommand(input)), "describeStacks"),
285244
285245
  describeStackResources: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudformation.DescribeStackResourcesCommand(input)), "describeStackResources"),
285246
+ describeType: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudformation.DescribeTypeCommand(input)), "describeType"),
285245
285247
  executeChangeSet: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudformation.ExecuteChangeSetCommand(input)), "executeChangeSet"),
285246
285248
  getGeneratedTemplate: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudformation.GetGeneratedTemplateCommand(input)), "getGeneratedTemplate"),
285247
285249
  getTemplate: /* @__PURE__ */ __name((input) => client.send(new import_client_cloudformation.GetTemplateCommand(input)), "getTemplate"),
@@ -285423,13 +285425,13 @@ var init_sdk = __esm({
285423
285425
  updateFunctionCode: /* @__PURE__ */ __name((input) => client.send(new import_client_lambda.UpdateFunctionCodeCommand(input)), "updateFunctionCode"),
285424
285426
  updateFunctionConfiguration: /* @__PURE__ */ __name((input) => client.send(new import_client_lambda.UpdateFunctionConfigurationCommand(input)), "updateFunctionConfiguration"),
285425
285427
  // Waiters
285426
- waitUntilFunctionUpdated: /* @__PURE__ */ __name((delaySeconds, input) => {
285428
+ waitUntilFunctionUpdated: /* @__PURE__ */ __name((minDelaySeconds, maxDelaySeconds, input) => {
285427
285429
  return (0, import_client_lambda.waitUntilFunctionUpdatedV2)(
285428
285430
  {
285429
285431
  client,
285430
- maxDelay: delaySeconds,
285431
- minDelay: delaySeconds,
285432
- maxWaitTime: delaySeconds * 60
285432
+ maxDelay: maxDelaySeconds,
285433
+ minDelay: minDelaySeconds,
285434
+ maxWaitTime: maxDelaySeconds * 60
285433
285435
  },
285434
285436
  input
285435
285437
  );
@@ -292013,7 +292015,7 @@ async function asyncGlobalReplace(str, regex, cb) {
292013
292015
  ret.push(str.slice(start));
292014
292016
  return ret.join("");
292015
292017
  }
292016
- var LazyListStackResources, LazyLookupExport, CfnEvaluationException, EvaluateCloudFormationTemplate, RESOURCE_TYPE_SPECIAL_NAMES, RESOURCE_TYPE_ATTRIBUTES_FORMATS;
292018
+ var LazyListStackResources, LazyLookupExport, CfnEvaluationException, EvaluateCloudFormationTemplate, RESOURCE_TYPE_PRIMARY_IDENTIFIERS, RESOURCE_TYPE_SPECIAL_NAMES, RESOURCE_TYPE_ATTRIBUTES_FORMATS;
292017
292019
  var init_evaluate_cloudformation_template = __esm({
292018
292020
  "../toolkit-lib/lib/api/cloudformation/evaluate-cloudformation-template.ts"() {
292019
292021
  "use strict";
@@ -292099,6 +292101,7 @@ var init_evaluate_cloudformation_template = __esm({
292099
292101
  stackResources;
292100
292102
  lookupExport;
292101
292103
  cachedUrlSuffix;
292104
+ _cloudControl;
292102
292105
  constructor(props) {
292103
292106
  this.stackArtifact = props.stackArtifact;
292104
292107
  this.stackName = props.stackName ?? props.stackArtifact.stackName;
@@ -292117,6 +292120,12 @@ var init_evaluate_cloudformation_template = __esm({
292117
292120
  this.stackResources = new LazyListStackResources(this.sdk, this.stackName);
292118
292121
  this.lookupExport = new LazyLookupExport(this.sdk);
292119
292122
  }
292123
+ get cloudControl() {
292124
+ if (!this._cloudControl) {
292125
+ this._cloudControl = this.sdk.cloudControl();
292126
+ }
292127
+ return this._cloudControl;
292128
+ }
292120
292129
  // clones current EvaluateCloudFormationTemplate object, but updates the stack name
292121
292130
  async createNestedEvaluateCloudFormationTemplate(stackName, nestedTemplate, nestedStackParameters) {
292122
292131
  const evaluatedParams = await this.evaluateCfnExpression(nestedStackParameters);
@@ -292250,6 +292259,41 @@ var init_evaluate_cloudformation_template = __esm({
292250
292259
  }
292251
292260
  return cfnExpression;
292252
292261
  }
292262
+ /**
292263
+ * Best-effort attempt to construct the Cloud Control API primary identifier for a resource.
292264
+ *
292265
+ * Cloud Control compound identifiers are pipe-delimited, ordered by the `primaryIdentifier`
292266
+ * array in the resource type schema (e.g. `DatabaseName|TableName` for `AWS::Glue::Table`).
292267
+ *
292268
+ * CloudFormation's `PhysicalResourceId` (the `physicalId` parameter here) is the `Ref` return
292269
+ * value for the resource, which is resource-type-specific and may not correspond to the Cloud
292270
+ * Control Primary Identifier.
292271
+ *
292272
+ * For properties present in the template, we resolve them directly. For properties NOT in the
292273
+ * template (e.g. service-generated read-only values), we fall back to `physicalId`. This is
292274
+ * only correct when:
292275
+ *
292276
+ * - Exactly one property in the identifier is missing from the template, AND
292277
+ * - That property happens to be the one that `Ref` returns for this resource type.
292278
+ *
292279
+ * If multiple properties are missing, `physicalId` is reused for all of them.
292280
+ */
292281
+ async evaluateCloudControlIdentifier(logicalId, resourceType, physicalId) {
292282
+ if (resourceType in RESOURCE_TYPE_PRIMARY_IDENTIFIERS) {
292283
+ const primaryProps = RESOURCE_TYPE_PRIMARY_IDENTIFIERS[resourceType];
292284
+ const parts = [];
292285
+ for (const propName of primaryProps) {
292286
+ const templateVal = this.getResourceProperty(logicalId, propName);
292287
+ if (templateVal) {
292288
+ parts.push(await this.evaluateCfnExpression(templateVal));
292289
+ } else {
292290
+ parts.push(physicalId);
292291
+ }
292292
+ }
292293
+ return parts.join("|");
292294
+ }
292295
+ return physicalId;
292296
+ }
292253
292297
  getResourceProperty(logicalId, propertyName) {
292254
292298
  return this.template.Resources?.[logicalId]?.Properties?.[propertyName];
292255
292299
  }
@@ -292336,33 +292380,43 @@ var init_evaluate_cloudformation_template = __esm({
292336
292380
  }
292337
292381
  return void 0;
292338
292382
  }
292339
- formatResourceAttribute(resource, attribute) {
292383
+ async formatResourceAttribute(resource, attribute) {
292340
292384
  const physicalId = resource.PhysicalResourceId;
292341
292385
  if (!attribute) {
292342
292386
  return physicalId;
292343
292387
  }
292344
292388
  const resourceTypeFormats = RESOURCE_TYPE_ATTRIBUTES_FORMATS[resource.ResourceType];
292345
- if (!resourceTypeFormats) {
292346
- throw new CfnEvaluationException(
292347
- `We don't support attributes of the '${resource.ResourceType}' resource. This is a CDK limitation. Please report it at https://github.com/aws/aws-cdk/issues/new/choose`
292348
- );
292389
+ if (resourceTypeFormats) {
292390
+ const attributeFormatFunc = resourceTypeFormats[attribute];
292391
+ if (attributeFormatFunc) {
292392
+ const service = this.getServiceOfResource(resource);
292393
+ const resourceTypeArnPart = this.getResourceTypeArnPartOfResource(resource);
292394
+ return attributeFormatFunc({
292395
+ partition: this.partition,
292396
+ service,
292397
+ region: this.region,
292398
+ account: this.account,
292399
+ resourceType: resourceTypeArnPart,
292400
+ resourceName: physicalId
292401
+ });
292402
+ }
292349
292403
  }
292350
- const attributeFmtFunc = resourceTypeFormats[attribute];
292351
- if (!attributeFmtFunc) {
292352
- throw new CfnEvaluationException(
292353
- `We don't support the '${attribute}' attribute of the '${resource.ResourceType}' resource. This is a CDK limitation. Please report it at https://github.com/aws/aws-cdk/issues/new/choose`
292354
- );
292404
+ try {
292405
+ const identifier = await this.evaluateCloudControlIdentifier(resource.LogicalResourceId, resource.ResourceType, physicalId);
292406
+ const response = await this.cloudControl.getResource({
292407
+ TypeName: resource.ResourceType,
292408
+ Identifier: identifier
292409
+ });
292410
+ const props = JSON.parse(response.ResourceDescription?.Properties ?? "{}");
292411
+ if (attribute in props) {
292412
+ return props[attribute];
292413
+ }
292414
+ } catch (error4) {
292415
+ throw new CfnEvaluationException(`Could not find '${attribute}' attribute of the '${resource.ResourceType}' resource becausean error occured while attempting to retrieve the information: '${error4.name}:${error4.message}'`);
292355
292416
  }
292356
- const service = this.getServiceOfResource(resource);
292357
- const resourceTypeArnPart = this.getResourceTypeArnPartOfResource(resource);
292358
- return attributeFmtFunc({
292359
- partition: this.partition,
292360
- service,
292361
- region: this.region,
292362
- account: this.account,
292363
- resourceType: resourceTypeArnPart,
292364
- resourceName: physicalId
292365
- });
292417
+ throw new CfnEvaluationException(
292418
+ `We don't support the '${attribute}' attribute of the '${resource.ResourceType}' resource. This is a CDK limitation. Please report it at https://github.com/aws/aws-cdk/issues/new/choose`
292419
+ );
292366
292420
  }
292367
292421
  getServiceOfResource(resource) {
292368
292422
  return resource.ResourceType.split("::")[1].toLowerCase();
@@ -292376,6 +292430,75 @@ var init_evaluate_cloudformation_template = __esm({
292376
292430
  );
292377
292431
  }
292378
292432
  };
292433
+ RESOURCE_TYPE_PRIMARY_IDENTIFIERS = {
292434
+ "AWS::ApiGateway::Authorizer": ["RestApiId", "AuthorizerId"],
292435
+ "AWS::ApiGateway::Deployment": ["DeploymentId", "RestApiId"],
292436
+ "AWS::ApiGateway::Model": ["RestApiId", "Name"],
292437
+ "AWS::ApiGateway::RequestValidator": ["RestApiId", "RequestValidatorId"],
292438
+ "AWS::ApiGateway::DocumentationPart": ["DocumentationPartId", "RestApiId"],
292439
+ "AWS::ApiGateway::Resource": ["RestApiId", "ResourceId"],
292440
+ "AWS::ApiGateway::Stage": ["RestApiId", "StageName"],
292441
+ "AWS::ApiGatewayV2::ApiMapping": ["ApiMappingId", "DomainName"],
292442
+ "AWS::ApiGatewayV2::Authorizer": ["AuthorizerId", "ApiId"],
292443
+ "AWS::ApiGatewayV2::Deployment": ["ApiId", "DeploymentId"],
292444
+ "AWS::ApiGatewayV2::Integration": ["ApiId", "IntegrationId"],
292445
+ "AWS::ApiGatewayV2::IntegrationResponse": ["ApiId", "IntegrationId", "IntegrationResponseId"],
292446
+ "AWS::ApiGatewayV2::Model": ["ApiId", "ModelId"],
292447
+ "AWS::ApiGatewayV2::Route": ["ApiId", "RouteId"],
292448
+ "AWS::ApiGatewayV2::RouteResponse": ["ApiId", "RouteId", "RouteResponseId"],
292449
+ "AWS::ApiGatewayV2::Stage": ["Id"],
292450
+ "AWS::AppConfig::ConfigurationProfile": ["ApplicationId", "ConfigurationProfileId"],
292451
+ "AWS::AppConfig::Environment": ["ApplicationId", "EnvironmentId"],
292452
+ "AWS::AppConfig::HostedConfigurationVersion": ["ApplicationId", "ConfigurationProfileId", "VersionNumber"],
292453
+ "AWS::AppMesh::GatewayRoute": ["Id"],
292454
+ "AWS::AppMesh::Mesh": ["Id"],
292455
+ "AWS::AppMesh::Route": ["Id"],
292456
+ "AWS::AppMesh::VirtualGateway": ["Id"],
292457
+ "AWS::AppMesh::VirtualNode": ["Id"],
292458
+ "AWS::AppMesh::VirtualRouter": ["Id"],
292459
+ "AWS::AppMesh::VirtualService": ["Id"],
292460
+ "AWS::AppSync::ApiKey": ["ApiKeyId"],
292461
+ "AWS::AppSync::GraphQLApi": ["ApiId"],
292462
+ "AWS::Batch::JobDefinition": ["JobDefinitionName"],
292463
+ "AWS::CloudWatch::InsightRule": ["Id"],
292464
+ "AWS::CodeBuild::Project": ["Id"],
292465
+ "AWS::CodeBuild::ReportGroup": ["Id"],
292466
+ "AWS::CodeDeploy::DeploymentGroup": ["ApplicationName", "DeploymentGroupName"],
292467
+ "AWS::CodePipeline::Webhook": ["Id"],
292468
+ "AWS::Cognito::UserPoolClient": ["UserPoolId", "ClientId"],
292469
+ "AWS::Cognito::UserPoolDomain": ["UserPoolId", "Domain"],
292470
+ "AWS::Cognito::UserPoolGroup": ["UserPoolId", "GroupName"],
292471
+ "AWS::Cognito::UserPoolIdentityProvider": ["UserPoolId", "ProviderName"],
292472
+ "AWS::Cognito::UserPoolResourceServer": ["UserPoolId", "Identifier"],
292473
+ "AWS::Cognito::UserPoolUser": ["UserPoolId", "Username"],
292474
+ "AWS::DAX::Cluster": ["Id"],
292475
+ "AWS::DAX::ParameterGroup": ["Id"],
292476
+ "AWS::DAX::SubnetGroup": ["Id"],
292477
+ "AWS::DMS::EventSubscription": ["Id"],
292478
+ "AWS::EC2::EIP": ["PublicIp", "AllocationId"],
292479
+ "AWS::ECS::Service": ["ServiceArn", "Cluster"],
292480
+ "AWS::ElastiCache::CacheCluster": ["Id"],
292481
+ "AWS::ElasticLoadBalancing::LoadBalancer": ["Id"],
292482
+ "AWS::ElastiCache::User": ["UserId"],
292483
+ "AWS::Elasticsearch::Domain": ["Id"],
292484
+ "AWS::Events::Rule": ["Arn"],
292485
+ "AWS::EventSchemas::RegistryPolicy": ["Id"],
292486
+ "AWS::Glue::DevEndpoint": ["Id"],
292487
+ "AWS::Glue::Workflow": ["Id"],
292488
+ "AWS::IoT::Policy": ["Id"],
292489
+ "AWS::Logs::LogStream": ["LogGroupName", "LogStreamName"],
292490
+ "AWS::Logs::SubscriptionFilter": ["FilterName", "LogGroupName"],
292491
+ "AWS::MediaConvert::JobTemplate": ["Id"],
292492
+ "AWS::MediaConvert::Preset": ["Id"],
292493
+ "AWS::MediaConvert::Queue": ["Id"],
292494
+ "AWS::Route53::RecordSet": ["Id"],
292495
+ "AWS::SageMaker::Device": ["Device/DeviceName"],
292496
+ "AWS::SecretsManager::ResourcePolicy": ["Id"],
292497
+ "AWS::SecretsManager::SecretTargetAttachment": ["Id"],
292498
+ "AWS::SES::ReceiptRuleSet": ["Id"],
292499
+ "AWS::SSM::MaintenanceWindowTarget": ["WindowId", "WindowTargetId"],
292500
+ "AWS::SSM::MaintenanceWindowTask": ["WindowId", "WindowTaskId"]
292501
+ };
292379
292502
  RESOURCE_TYPE_SPECIAL_NAMES = {
292380
292503
  "AWS::Events::EventBus": {
292381
292504
  resourceType: "event-bus"
@@ -310555,156 +310678,6 @@ var init_appsync_mapping_templates = __esm({
310555
310678
  }
310556
310679
  });
310557
310680
 
310558
- // ../toolkit-lib/lib/api/hotswap/bedrock-agentcore-runtimes.ts
310559
- async function isHotswappableBedrockAgentCoreRuntimeChange(logicalId, change, evaluateCfnTemplate) {
310560
- if (change.newValue.Type !== "AWS::BedrockAgentCore::Runtime") {
310561
- return [];
310562
- }
310563
- const ret = [];
310564
- const classifiedChanges = classifyChanges(change, [
310565
- "AgentRuntimeArtifact",
310566
- "EnvironmentVariables",
310567
- "Description"
310568
- ]);
310569
- classifiedChanges.reportNonHotswappablePropertyChanges(ret);
310570
- const namesOfHotswappableChanges = Object.keys(classifiedChanges.hotswappableProps);
310571
- if (namesOfHotswappableChanges.length === 0) {
310572
- return ret;
310573
- }
310574
- const agentRuntimeId = await evaluateCfnTemplate.findPhysicalNameFor(logicalId);
310575
- if (!agentRuntimeId) {
310576
- return ret;
310577
- }
310578
- const runtimeChange = await evaluateBedrockAgentCoreRuntimeProps(
310579
- classifiedChanges.hotswappableProps,
310580
- evaluateCfnTemplate
310581
- );
310582
- ret.push({
310583
- change: {
310584
- cause: change,
310585
- resources: [{
310586
- logicalId,
310587
- resourceType: change.newValue.Type,
310588
- physicalName: agentRuntimeId,
310589
- metadata: evaluateCfnTemplate.metadataFor(logicalId)
310590
- }]
310591
- },
310592
- hotswappable: true,
310593
- service: "bedrock-agentcore",
310594
- apply: /* @__PURE__ */ __name(async (sdk) => {
310595
- const bedrockAgentCore = sdk.bedrockAgentCoreControl();
310596
- const currentRuntime = await bedrockAgentCore.getAgentRuntime({
310597
- agentRuntimeId
310598
- });
310599
- if (!currentRuntime.agentRuntimeArtifact) {
310600
- throw new ToolkitError("RuntimeMissingArtifact", "Current runtime does not have an artifact");
310601
- }
310602
- if (!currentRuntime.roleArn) {
310603
- throw new ToolkitError("RuntimeMissingRoleArn", "Current runtime does not have a roleArn");
310604
- }
310605
- if (!currentRuntime.networkConfiguration) {
310606
- throw new ToolkitError("RuntimeMissingNetworkConfig", "Current runtime does not have a networkConfiguration");
310607
- }
310608
- await bedrockAgentCore.updateAgentRuntime({
310609
- agentRuntimeId,
310610
- agentRuntimeArtifact: runtimeChange.artifact ? toSdkAgentRuntimeArtifact(runtimeChange.artifact) : currentRuntime.agentRuntimeArtifact,
310611
- roleArn: currentRuntime.roleArn,
310612
- networkConfiguration: currentRuntime.networkConfiguration,
310613
- description: runtimeChange.description ?? currentRuntime.description,
310614
- authorizerConfiguration: currentRuntime.authorizerConfiguration,
310615
- requestHeaderConfiguration: currentRuntime.requestHeaderConfiguration,
310616
- protocolConfiguration: currentRuntime.protocolConfiguration,
310617
- lifecycleConfiguration: currentRuntime.lifecycleConfiguration,
310618
- environmentVariables: runtimeChange.environmentVariables ?? currentRuntime.environmentVariables
310619
- });
310620
- }, "apply")
310621
- });
310622
- return ret;
310623
- }
310624
- async function evaluateBedrockAgentCoreRuntimeProps(hotswappablePropChanges, evaluateCfnTemplate) {
310625
- const runtimeChange = {};
310626
- for (const updatedPropName in hotswappablePropChanges) {
310627
- const updatedProp = hotswappablePropChanges[updatedPropName];
310628
- switch (updatedPropName) {
310629
- case "AgentRuntimeArtifact":
310630
- runtimeChange.artifact = await evaluateAgentRuntimeArtifact(
310631
- updatedProp.newValue,
310632
- evaluateCfnTemplate
310633
- );
310634
- break;
310635
- case "Description":
310636
- runtimeChange.description = await evaluateCfnTemplate.evaluateCfnExpression(updatedProp.newValue);
310637
- break;
310638
- case "EnvironmentVariables":
310639
- runtimeChange.environmentVariables = await evaluateCfnTemplate.evaluateCfnExpression(updatedProp.newValue);
310640
- break;
310641
- default:
310642
- throw new ToolkitError(
310643
- "UnexpectedHotswapProperty",
310644
- "Unexpected hotswappable property for BedrockAgentCore Runtime. Please report this at github.com/aws/aws-cdk/issues/new/choose"
310645
- );
310646
- }
310647
- }
310648
- return runtimeChange;
310649
- }
310650
- async function evaluateAgentRuntimeArtifact(artifactValue, evaluateCfnTemplate) {
310651
- if (artifactValue.CodeConfiguration) {
310652
- const codeConfig = artifactValue.CodeConfiguration;
310653
- const code = codeConfig.Code;
310654
- const s3Location = code.S3 ? {
310655
- bucket: await evaluateCfnTemplate.evaluateCfnExpression(code.S3.Bucket),
310656
- prefix: await evaluateCfnTemplate.evaluateCfnExpression(code.S3.Prefix),
310657
- versionId: code.S3.VersionId ? await evaluateCfnTemplate.evaluateCfnExpression(code.S3.VersionId) : void 0
310658
- } : void 0;
310659
- return {
310660
- codeConfiguration: {
310661
- code: s3Location ? { s3: s3Location } : {},
310662
- runtime: await evaluateCfnTemplate.evaluateCfnExpression(codeConfig.Runtime),
310663
- entryPoint: await evaluateCfnTemplate.evaluateCfnExpression(codeConfig.EntryPoint)
310664
- }
310665
- };
310666
- }
310667
- if (artifactValue.ContainerConfiguration) {
310668
- return {
310669
- containerConfiguration: {
310670
- containerUri: await evaluateCfnTemplate.evaluateCfnExpression(
310671
- artifactValue.ContainerConfiguration.ContainerUri
310672
- )
310673
- }
310674
- };
310675
- }
310676
- return void 0;
310677
- }
310678
- function toSdkAgentRuntimeArtifact(artifact) {
310679
- if (artifact.codeConfiguration) {
310680
- const code = artifact.codeConfiguration.code.s3 ? { s3: artifact.codeConfiguration.code.s3 } : void 0;
310681
- return {
310682
- codeConfiguration: {
310683
- code,
310684
- runtime: artifact.codeConfiguration.runtime,
310685
- entryPoint: artifact.codeConfiguration.entryPoint
310686
- }
310687
- };
310688
- }
310689
- if (artifact.containerConfiguration) {
310690
- return {
310691
- containerConfiguration: artifact.containerConfiguration
310692
- };
310693
- }
310694
- throw new ToolkitError("RuntimeArtifactMissingConfig", "AgentRuntimeArtifact must have either codeConfiguration or containerConfiguration");
310695
- }
310696
- var init_bedrock_agentcore_runtimes = __esm({
310697
- "../toolkit-lib/lib/api/hotswap/bedrock-agentcore-runtimes.ts"() {
310698
- "use strict";
310699
- init_common3();
310700
- init_toolkit_error();
310701
- __name(isHotswappableBedrockAgentCoreRuntimeChange, "isHotswappableBedrockAgentCoreRuntimeChange");
310702
- __name(evaluateBedrockAgentCoreRuntimeProps, "evaluateBedrockAgentCoreRuntimeProps");
310703
- __name(evaluateAgentRuntimeArtifact, "evaluateAgentRuntimeArtifact");
310704
- __name(toSdkAgentRuntimeArtifact, "toSdkAgentRuntimeArtifact");
310705
- }
310706
- });
310707
-
310708
310681
  // ../toolkit-lib/lib/api/hotswap/code-build-projects.ts
310709
310682
  async function isHotswappableCodeBuildProjectChange(logicalId, change, evaluateCfnTemplate) {
310710
310683
  if (change.newValue.Type !== "AWS::CodeBuild::Project") {
@@ -310993,7 +310966,7 @@ async function isHotswappableLambdaFunctionChange(logicalId, change, evaluateCfn
310993
310966
  const operations = [];
310994
310967
  if (lambdaCodeChange.code !== void 0 || lambdaCodeChange.configurations !== void 0) {
310995
310968
  if (lambdaCodeChange.code !== void 0) {
310996
- const updateFunctionCodeResponse = await lambda.updateFunctionCode({
310969
+ await lambda.updateFunctionCode({
310997
310970
  FunctionName: functionName,
310998
310971
  S3Bucket: lambdaCodeChange.code.s3Bucket,
310999
310972
  S3Key: lambdaCodeChange.code.s3Key,
@@ -311001,7 +310974,7 @@ async function isHotswappableLambdaFunctionChange(logicalId, change, evaluateCfn
311001
310974
  ZipFile: lambdaCodeChange.code.functionCodeZip,
311002
310975
  S3ObjectVersion: lambdaCodeChange.code.s3ObjectVersion
311003
310976
  });
311004
- await waitForLambdasPropertiesUpdateToFinish(updateFunctionCodeResponse, lambda, functionName);
310977
+ await waitForLambdasPropertiesUpdateToFinish(lambda, functionName);
311005
310978
  }
311006
310979
  if (lambdaCodeChange.configurations !== void 0) {
311007
310980
  const updateRequest = {
@@ -311013,8 +310986,8 @@ async function isHotswappableLambdaFunctionChange(logicalId, change, evaluateCfn
311013
310986
  if (lambdaCodeChange.configurations.environment !== void 0) {
311014
310987
  updateRequest.Environment = lambdaCodeChange.configurations.environment;
311015
310988
  }
311016
- const updateFunctionCodeResponse = await lambda.updateFunctionConfiguration(updateRequest);
311017
- await waitForLambdasPropertiesUpdateToFinish(updateFunctionCodeResponse, lambda, functionName);
310989
+ await lambda.updateFunctionConfiguration(updateRequest);
310990
+ await waitForLambdasPropertiesUpdateToFinish(lambda, functionName);
311018
310991
  }
311019
310992
  const versions = dependencies.filter((d6) => d6.resourceType === "AWS::Lambda::Version");
311020
310993
  if (versions.length) {
@@ -311132,10 +311105,10 @@ function zipString(fileName, rawString) {
311132
311105
  void archive.finalize();
311133
311106
  });
311134
311107
  }
311135
- async function waitForLambdasPropertiesUpdateToFinish(currentFunctionConfiguration, lambda, functionName) {
311136
- const functionIsInVpcOrUsesDockerForCode = currentFunctionConfiguration.VpcConfig?.VpcId || currentFunctionConfiguration.PackageType === "Image";
311137
- const delaySeconds = functionIsInVpcOrUsesDockerForCode ? 5 : 1;
311138
- await lambda.waitUntilFunctionUpdated(delaySeconds, {
311108
+ async function waitForLambdasPropertiesUpdateToFinish(lambda, functionName) {
311109
+ const minDelaySeconds = 1;
311110
+ const maxDelaySeconds = 10;
311111
+ await lambda.waitUntilFunctionUpdated(minDelaySeconds, maxDelaySeconds, {
311139
311112
  FunctionName: functionName
311140
311113
  });
311141
311114
  }
@@ -311301,50 +311274,99 @@ var init_s3_bucket_deployments = __esm({
311301
311274
  }
311302
311275
  });
311303
311276
 
311304
- // ../toolkit-lib/lib/api/hotswap/stepfunctions-state-machines.ts
311305
- async function isHotswappableStateMachineChange(logicalId, change, evaluateCfnTemplate) {
311306
- if (change.newValue.Type !== "AWS::StepFunctions::StateMachine") {
311307
- return [];
311308
- }
311277
+ // ../toolkit-lib/lib/api/hotswap/cloud-control-resource.ts
311278
+ async function isHotswappableCloudControlChange(logicalId, change, evaluateCfnTemplate, _hotswapPropertyOverrides) {
311309
311279
  const ret = [];
311310
- const classifiedChanges = classifyChanges(change, ["DefinitionString"]);
311280
+ const changedPropNames = Object.keys(change.propertyUpdates);
311281
+ if (changedPropNames.length === 0) {
311282
+ return ret;
311283
+ }
311284
+ const classifiedChanges = classifyChanges(change, changedPropNames);
311311
311285
  classifiedChanges.reportNonHotswappablePropertyChanges(ret);
311312
- const namesOfHotswappableChanges = Object.keys(classifiedChanges.hotswappableProps);
311313
- if (namesOfHotswappableChanges.length > 0) {
311314
- const stateMachineNameInCfnTemplate = change.newValue?.Properties?.StateMachineName;
311315
- const stateMachineArn = stateMachineNameInCfnTemplate ? await evaluateCfnTemplate.evaluateCfnExpression({
311316
- "Fn::Sub": "arn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:stateMachine:" + stateMachineNameInCfnTemplate
311317
- }) : await evaluateCfnTemplate.findPhysicalNameFor(logicalId);
311318
- if (!stateMachineArn) {
311319
- return ret;
311286
+ if (classifiedChanges.namesOfHotswappableProps.length === 0) {
311287
+ return ret;
311288
+ }
311289
+ const resourceType = change.newValue.Type;
311290
+ const identifier = await resolveCloudControlIdentifier(logicalId, resourceType, evaluateCfnTemplate);
311291
+ if (!identifier) {
311292
+ ret.push(nonHotswappableChange(
311293
+ change,
311294
+ "resource-unsupported" /* RESOURCE_UNSUPPORTED */,
311295
+ "Could not determine the physical name or primary identifier of the resource, so Cloud Control API cannot hotswap it."
311296
+ ));
311297
+ return ret;
311298
+ }
311299
+ const evaluatedProps = {};
311300
+ for (const propName of classifiedChanges.namesOfHotswappableProps) {
311301
+ try {
311302
+ evaluatedProps[propName] = await evaluateCfnTemplate.evaluateCfnExpression(
311303
+ change.propertyUpdates[propName].newValue
311304
+ );
311305
+ } catch (e6) {
311306
+ if (e6 instanceof CfnEvaluationException) {
311307
+ ret.push(nonHotswappableChange(
311308
+ change,
311309
+ "resource-unsupported" /* RESOURCE_UNSUPPORTED */,
311310
+ `Property '${propName}' of resource '${logicalId}' has been replaced and could not be resolved: ${e6.message}`
311311
+ ));
311312
+ return ret;
311313
+ }
311314
+ throw e6;
311320
311315
  }
311321
- ret.push({
311322
- change: {
311323
- cause: change,
311324
- resources: [{
311325
- logicalId,
311326
- resourceType: change.newValue.Type,
311327
- physicalName: stateMachineArn?.split(":")[6],
311328
- metadata: evaluateCfnTemplate.metadataFor(logicalId)
311329
- }]
311330
- },
311331
- hotswappable: true,
311332
- service: "stepfunctions-service",
311333
- apply: /* @__PURE__ */ __name(async (sdk) => {
311334
- await sdk.stepFunctions().updateStateMachine({
311335
- stateMachineArn,
311336
- definition: await evaluateCfnTemplate.evaluateCfnExpression(change.propertyUpdates.DefinitionString.newValue)
311337
- });
311338
- }, "apply")
311339
- });
311340
311316
  }
311317
+ ret.push({
311318
+ change: {
311319
+ cause: change,
311320
+ resources: [{
311321
+ logicalId,
311322
+ resourceType,
311323
+ physicalName: identifier,
311324
+ metadata: evaluateCfnTemplate.metadataFor(logicalId)
311325
+ }]
311326
+ },
311327
+ hotswappable: true,
311328
+ service: "cloudcontrol",
311329
+ apply: /* @__PURE__ */ __name(async (sdk) => {
311330
+ const cloudControl = sdk.cloudControl();
311331
+ const patchOps = [];
311332
+ for (const propName of classifiedChanges.namesOfHotswappableProps) {
311333
+ const diff = change.propertyUpdates[propName];
311334
+ const newValue = evaluatedProps[propName];
311335
+ if (diff.isRemoval) {
311336
+ patchOps.push({ op: "remove", path: `/${propName}` });
311337
+ } else if (diff.isAddition) {
311338
+ patchOps.push({ op: "add", path: `/${propName}`, value: newValue });
311339
+ } else {
311340
+ patchOps.push({ op: "replace", path: `/${propName}`, value: newValue });
311341
+ }
311342
+ }
311343
+ if (patchOps.length === 0) {
311344
+ return;
311345
+ }
311346
+ await cloudControl.updateResource({
311347
+ TypeName: resourceType,
311348
+ Identifier: identifier,
311349
+ PatchDocument: JSON.stringify(patchOps)
311350
+ });
311351
+ }, "apply")
311352
+ });
311341
311353
  return ret;
311342
311354
  }
311343
- var init_stepfunctions_state_machines = __esm({
311344
- "../toolkit-lib/lib/api/hotswap/stepfunctions-state-machines.ts"() {
311355
+ async function resolveCloudControlIdentifier(logicalId, resourceType, evaluateCfnTemplate) {
311356
+ const cfnPhysicalId = await evaluateCfnTemplate.findPhysicalNameFor(logicalId);
311357
+ if (!cfnPhysicalId) {
311358
+ return void 0;
311359
+ }
311360
+ return evaluateCfnTemplate.evaluateCloudControlIdentifier(logicalId, resourceType, cfnPhysicalId);
311361
+ }
311362
+ var init_cloud_control_resource = __esm({
311363
+ "../toolkit-lib/lib/api/hotswap/cloud-control-resource.ts"() {
311345
311364
  "use strict";
311346
311365
  init_common3();
311347
- __name(isHotswappableStateMachineChange, "isHotswappableStateMachineChange");
311366
+ init_payloads();
311367
+ init_cloudformation2();
311368
+ __name(isHotswappableCloudControlChange, "isHotswappableCloudControlChange");
311369
+ __name(resolveCloudControlIdentifier, "resolveCloudControlIdentifier");
311348
311370
  }
311349
311371
  });
311350
311372
 
@@ -311560,6 +311582,8 @@ async function classifyResourceChanges(stackChanges, evaluateCfnTemplate, sdk, n
311560
311582
  const promises3 = [];
311561
311583
  const hotswappableResources = new Array();
311562
311584
  const nonHotswappableResources = new Array();
311585
+ const nestedStackTasks = [];
311586
+ const limit = pLimit2(10);
311563
311587
  for (const logicalId of Object.keys(stackChanges.outputs.changes)) {
311564
311588
  nonHotswappableResources.push({
311565
311589
  hotswappable: false,
@@ -311576,16 +311600,14 @@ async function classifyResourceChanges(stackChanges, evaluateCfnTemplate, sdk, n
311576
311600
  }
311577
311601
  for (const [logicalId, change] of Object.entries(resourceDifferences)) {
311578
311602
  if (change.newValue?.Type === "AWS::CloudFormation::Stack" && change.oldValue?.Type === "AWS::CloudFormation::Stack") {
311579
- const nestedHotswappableResources = await findNestedHotswappableChanges(
311603
+ nestedStackTasks.push(limit(() => findNestedHotswappableChanges(
311580
311604
  logicalId,
311581
311605
  change,
311582
311606
  nestedStackNames,
311583
311607
  evaluateCfnTemplate,
311584
311608
  sdk,
311585
311609
  hotswapPropertyOverrides
311586
- );
311587
- hotswappableResources.push(...nestedHotswappableResources.hotswappable);
311588
- nonHotswappableResources.push(...nestedHotswappableResources.nonHotswappable);
311610
+ )));
311589
311611
  continue;
311590
311612
  }
311591
311613
  const hotswappableChangeCandidate = isCandidateForHotswapping(logicalId, change, evaluateCfnTemplate);
@@ -311604,9 +311626,14 @@ async function classifyResourceChanges(stackChanges, evaluateCfnTemplate, sdk, n
311604
311626
  nonHotswappableResources.push(nonHotswappableResource(hotswappableChangeCandidate));
311605
311627
  }
311606
311628
  }
311629
+ const nestedResults = await Promise.all(nestedStackTasks);
311630
+ for (const nested of nestedResults) {
311631
+ hotswappableResources.push(...nested.hotswappable);
311632
+ nonHotswappableResources.push(...nested.nonHotswappable);
311633
+ }
311607
311634
  const changesDetectionResults = [];
311608
- for (const detectorResultPromises of promises3) {
311609
- const hotswapDetectionResults = await Promise.all(await detectorResultPromises());
311635
+ const detectorResults = await Promise.all(promises3.map((fn) => limit(fn)));
311636
+ for (const hotswapDetectionResults of detectorResults) {
311610
311637
  changesDetectionResults.push(hotswapDetectionResults);
311611
311638
  }
311612
311639
  for (const resourceDetectionResults of changesDetectionResults) {
@@ -311876,16 +311903,15 @@ var init_hotswap_deployments = __esm({
311876
311903
  init_util();
311877
311904
  init_cloudformation2();
311878
311905
  init_appsync_mapping_templates();
311879
- init_bedrock_agentcore_runtimes();
311880
311906
  init_code_build_projects();
311881
311907
  init_common3();
311882
311908
  init_ecs_services();
311883
311909
  init_lambda_functions();
311884
311910
  init_s3_bucket_deployments();
311885
- init_stepfunctions_state_machines();
311886
311911
  init_toolkit_error();
311887
311912
  init_private();
311888
311913
  init_plugin2();
311914
+ init_cloud_control_resource();
311889
311915
  pLimit2 = require_p_limit();
311890
311916
  RESOURCE_DETECTORS = {
311891
311917
  // Lambda
@@ -311897,10 +311923,8 @@ var init_hotswap_deployments = __esm({
311897
311923
  "AWS::AppSync::FunctionConfiguration": isHotswappableAppSyncChange,
311898
311924
  "AWS::AppSync::GraphQLSchema": isHotswappableAppSyncChange,
311899
311925
  "AWS::AppSync::ApiKey": isHotswappableAppSyncChange,
311900
- "AWS::BedrockAgentCore::Runtime": isHotswappableBedrockAgentCoreRuntimeChange,
311901
311926
  "AWS::ECS::TaskDefinition": isHotswappableEcsServiceChange,
311902
311927
  "AWS::CodeBuild::Project": isHotswappableCodeBuildProjectChange,
311903
- "AWS::StepFunctions::StateMachine": isHotswappableStateMachineChange,
311904
311928
  "Custom::CDKBucketDeployment": isHotswappableS3BucketDeploymentChange,
311905
311929
  "AWS::IAM::Policy": /* @__PURE__ */ __name(async (logicalId, change, evaluateCfnTemplate) => {
311906
311930
  if (await skipChangeForS3DeployCustomResourcePolicy(logicalId, change, evaluateCfnTemplate)) {
@@ -311908,7 +311932,23 @@ var init_hotswap_deployments = __esm({
311908
311932
  }
311909
311933
  return [nonHotswappableResource(change)];
311910
311934
  }, "AWS::IAM::Policy"),
311911
- "AWS::CDK::Metadata": /* @__PURE__ */ __name(async () => [], "AWS::CDK::Metadata")
311935
+ "AWS::CDK::Metadata": /* @__PURE__ */ __name(async () => [], "AWS::CDK::Metadata"),
311936
+ // Resources that use CCAPIS
311937
+ "AWS::ApiGateway::RestApi": isHotswappableCloudControlChange,
311938
+ "AWS::ApiGateway::Deployment": isHotswappableCloudControlChange,
311939
+ "AWS::ApiGateway::Method": isHotswappableCloudControlChange,
311940
+ "AWS::ApiGatewayV2::Api": isHotswappableCloudControlChange,
311941
+ "AWS::ApiGatewayV2::Integration": isHotswappableCloudControlChange,
311942
+ "AWS::Bedrock::Agent": isHotswappableCloudControlChange,
311943
+ "AWS::Events::Rule": isHotswappableCloudControlChange,
311944
+ "AWS::DynamoDB::Table": isHotswappableCloudControlChange,
311945
+ "AWS::DynamoDB::GlobalTable": isHotswappableCloudControlChange,
311946
+ "AWS::SQS::Queue": isHotswappableCloudControlChange,
311947
+ "AWS::CloudWatch::Alarm": isHotswappableCloudControlChange,
311948
+ "AWS::CloudWatch::CompositeAlarm": isHotswappableCloudControlChange,
311949
+ "AWS::CloudWatch::Dashboard": isHotswappableCloudControlChange,
311950
+ "AWS::StepFunctions::StateMachine": isHotswappableCloudControlChange,
311951
+ "AWS::BedrockAgentCore::Runtime": isHotswappableCloudControlChange
311912
311952
  };
311913
311953
  __name(tryHotswapDeployment, "tryHotswapDeployment");
311914
311954
  __name(hotswapDeployment, "hotswapDeployment");
package/package.json CHANGED
@@ -66,11 +66,11 @@
66
66
  "@aws-cdk/aws-service-spec": "^0.1.171",
67
67
  "@aws-cdk/cdk-assets-lib": "1.4.3",
68
68
  "@aws-cdk/cloud-assembly-api": "2.2.2",
69
- "@aws-cdk/cloud-assembly-schema": ">=53.15.0",
69
+ "@aws-cdk/cloud-assembly-schema": ">=53.16.0",
70
70
  "@aws-cdk/cloudformation-diff": "2.187.1",
71
- "@aws-cdk/toolkit-lib": "1.21.3",
71
+ "@aws-cdk/toolkit-lib": "1.22.0",
72
72
  "@aws-sdk/client-cloudformation": "^3",
73
- "aws-cdk": "2.1118.1",
73
+ "aws-cdk": "2.1118.2",
74
74
  "chalk": "^4",
75
75
  "chokidar": "^4",
76
76
  "fs-extra": "^11",
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@aws-cdk/aws-service-spec": "0.1.171",
83
- "aws-cdk": "2.1118.1"
83
+ "aws-cdk": "2.1118.2"
84
84
  },
85
85
  "keywords": [
86
86
  "aws",
@@ -102,7 +102,7 @@
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "version": "2.197.14",
105
+ "version": "2.197.15",
106
106
  "packageManager": "yarn@4.13.0",
107
107
  "types": "lib/index.d.ts",
108
108
  "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"yarn projen\"."