@go-to-k/cdkd 0.242.0 → 0.244.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 +1235 -109
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-7FfFEJkw.js → deploy-engine-3KNTmr1u.js} +85 -18
- package/dist/{deploy-engine-7FfFEJkw.js.map → deploy-engine-3KNTmr1u.js.map} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -2
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, f as withSkipPrefix, i as runStackBuffered, n as getLogger, o as PATTERN_B_NAME_OPTIONS, p as withStackName, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-BzO-joNR.js";
|
|
3
3
|
import { A as withErrorHandling, C as StackHasActiveImportsError, S as ResourceUpdateNotSupportedError, _ as MissingCdkCliError, a as normalizeAwsTagsToCfn, b as ProvisioningError, f as LocalInvokeBuildError$1, i as matchesCdkPath, k as normalizeAwsError, l as CdkdError, m as LocalStartServiceError, n as isTerminationProtectionPropagationError, o as resolveExplicitPhysicalId, p as LocalMigrateError, r as CDK_PATH_TAG, s as assertRegionMatch, t as disableInstanceApiTermination, v as NestedStackChildDirectDestroyError, w as StackTerminationProtectionError, x as ResourceTimeoutError, y as PartialFailureError } from "./ec2-termination-protection-q-WGWgxa.js";
|
|
4
4
|
import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-B15NAPbL.js";
|
|
5
|
-
import { $ as getDockerCmd, A as DiffCalculator, B as buildAssetRedirectMap, C as findActionableSilentDrops, Ct as resolveBucketRegion, D as refStateLookupFromResource, E as cfnRefValueFromPhysicalId, F as rebuildClientForBucketRegion, G as BOOTSTRAP_MARKER_PREFIX, H as loadPublishableAssetManifest, I as shouldRetainResource, J as parseBootstrapMarker, K as ensureAssetStorage, L as AssetPublisher, M as TemplateParser, N as LockManager, O as WAFv2WebACLProvider, P as S3StateBackend, Q as formatDockerLoginError, R as stringifyValue, S as ProviderRegistry, T as IntrinsicFunctionResolver, U as rewriteTemplateAssetReferences, V as createAssetRedirectResolver, W as AssetModeResolver, X as validateContainerRepoName, Y as validateAssetBucketName, Z as buildDockerImage, _ as green, _t as CFN_TEMPLATE_URL_LIMIT, a as withRetry, at as synthesisStatusMessage, b as IAMRoleProvider, bt as uploadCfnTemplate, c as computeImplicitDeleteEdges, ct as resolveApp, d as isStatefulRecreateTargetSync, dt as resolveSkipPrefix, et as runDockerForeground, f as renderStatefulReason, ft as resolveStateBucketWithDefault, g as gray, gt as CFN_TEMPLATE_BODY_LIMIT, h as cyan, ht as warnDeprecatedNoPrefixCliFlag, i as withResourceDeadline, it as Synthesizer, j as DagBuilder, k as applyRoleArnIfSet, l as extractDeploymentEventError, lt as resolveAutoAssetStorage, m as bold, mt as resolveUseCdkBootstrapAssets, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as AssetManifestLoader, o as isRetryableTransientError, ot as getDefaultStateBucketName, p as formatResourceLine, pt as resolveStateBucketWithDefaultAndSource, q as getBootstrapMarkerKey, r as DeployEngine, rt as getDockerImageBySourceHash, s as IMPLICIT_DELETE_DEPENDENCIES, st as getLegacyStateBucketName, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as runDockerStreaming, u as MULTI_REGION_RECREATE_BLOCKED_TYPES, ut as resolveCaptureObservedState, v as red, vt as MIGRATE_TMP_PREFIX, w as CloudControlProvider, x as collectInlinePolicyNamesManagedBySiblings, xt as AssemblyReader, y as yellow, yt as findLargeInlineResources, z as WorkGraph } from "./deploy-engine-
|
|
5
|
+
import { $ as getDockerCmd, A as DiffCalculator, B as buildAssetRedirectMap, C as findActionableSilentDrops, Ct as resolveBucketRegion, D as refStateLookupFromResource, E as cfnRefValueFromPhysicalId, F as rebuildClientForBucketRegion, G as BOOTSTRAP_MARKER_PREFIX, H as loadPublishableAssetManifest, I as shouldRetainResource, J as parseBootstrapMarker, K as ensureAssetStorage, L as AssetPublisher, M as TemplateParser, N as LockManager, O as WAFv2WebACLProvider, P as S3StateBackend, Q as formatDockerLoginError, R as stringifyValue, S as ProviderRegistry, T as IntrinsicFunctionResolver, U as rewriteTemplateAssetReferences, V as createAssetRedirectResolver, W as AssetModeResolver, X as validateContainerRepoName, Y as validateAssetBucketName, Z as buildDockerImage, _ as green, _t as CFN_TEMPLATE_URL_LIMIT, a as withRetry, at as synthesisStatusMessage, b as IAMRoleProvider, bt as uploadCfnTemplate, c as computeImplicitDeleteEdges, ct as resolveApp, d as isStatefulRecreateTargetSync, dt as resolveSkipPrefix, et as runDockerForeground, f as renderStatefulReason, ft as resolveStateBucketWithDefault, g as gray, gt as CFN_TEMPLATE_BODY_LIMIT, h as cyan, ht as warnDeprecatedNoPrefixCliFlag, i as withResourceDeadline, it as Synthesizer, j as DagBuilder, k as applyRoleArnIfSet, l as extractDeploymentEventError, lt as resolveAutoAssetStorage, m as bold, mt as resolveUseCdkBootstrapAssets, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as AssetManifestLoader, o as isRetryableTransientError, ot as getDefaultStateBucketName, p as formatResourceLine, pt as resolveStateBucketWithDefaultAndSource, q as getBootstrapMarkerKey, r as DeployEngine, rt as getDockerImageBySourceHash, s as IMPLICIT_DELETE_DEPENDENCIES, st as getLegacyStateBucketName, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as runDockerStreaming, u as MULTI_REGION_RECREATE_BLOCKED_TYPES, ut as resolveCaptureObservedState, v as red, vt as MIGRATE_TMP_PREFIX, w as CloudControlProvider, x as collectInlinePolicyNamesManagedBySiblings, xt as AssemblyReader, y as yellow, yt as findLargeInlineResources, z as WorkGraph } from "./deploy-engine-3KNTmr1u.js";
|
|
6
6
|
import { t as expectedOwnerParam } from "./expected-bucket-owner-BjEfUnkA.js";
|
|
7
7
|
import { t as ASGProvider } from "./asg-provider-Dbl1_mwT.js";
|
|
8
8
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -23,7 +23,7 @@ import { AddTagsToResourceCommand, DeleteParameterCommand, DescribeParametersCom
|
|
|
23
23
|
import { CloudFrontClient, CreateCloudFrontOriginAccessIdentityCommand, CreateDistributionCommand, CreateDistributionWithTagsCommand, DeleteCloudFrontOriginAccessIdentityCommand, DeleteDistributionCommand, GetCloudFrontOriginAccessIdentityCommand, GetDistributionCommand, GetDistributionConfigCommand, ListDistributionsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$3, NoSuchCloudFrontOriginAccessIdentity, NoSuchDistribution, TagResourceCommand as TagResourceCommand$6, UntagResourceCommand as UntagResourceCommand$6, UpdateCloudFrontOriginAccessIdentityCommand, UpdateDistributionCommand } from "@aws-sdk/client-cloudfront";
|
|
24
24
|
import { CloudWatchClient, DeleteAlarmsCommand, DescribeAlarmsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$4, PutMetricAlarmCommand, TagResourceCommand as TagResourceCommand$7, UntagResourceCommand as UntagResourceCommand$7 } from "@aws-sdk/client-cloudwatch";
|
|
25
25
|
import { AssociateKmsKeyCommand, CloudWatchLogsClient, CreateLogGroupCommand, DeleteDataProtectionPolicyCommand, DeleteIndexPolicyCommand, DeleteLogGroupCommand, DeleteRetentionPolicyCommand, DescribeIndexPoliciesCommand, DescribeLogGroupsCommand, DisassociateKmsKeyCommand, GetDataProtectionPolicyCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$5, PutBearerTokenAuthenticationCommand, PutDataProtectionPolicyCommand, PutIndexPolicyCommand, PutLogGroupDeletionProtectionCommand, PutRetentionPolicyCommand, ResourceAlreadyExistsException, ResourceNotFoundException as ResourceNotFoundException$4, TagResourceCommand as TagResourceCommand$8, UntagResourceCommand as UntagResourceCommand$8 } from "@aws-sdk/client-cloudwatch-logs";
|
|
26
|
-
import { BedrockAgentCoreControlClient, CreateAgentRuntimeCommand, DeleteAgentRuntimeCommand, GetAgentRuntimeCommand, ResourceNotFoundException as ResourceNotFoundException$5, UpdateAgentRuntimeCommand } from "@aws-sdk/client-bedrock-agentcore-control";
|
|
26
|
+
import { BedrockAgentCoreControlClient, CreateAgentRuntimeCommand, CreateEvaluatorCommand, DeleteAgentRuntimeCommand, DeleteEvaluatorCommand, GetAgentRuntimeCommand, GetBrowserCommand, GetCodeInterpreterCommand, GetEvaluatorCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$6, ResourceNotFoundException as ResourceNotFoundException$5, TagResourceCommand as TagResourceCommand$9, UntagResourceCommand as UntagResourceCommand$9, UpdateAgentRuntimeCommand, UpdateEvaluatorCommand } from "@aws-sdk/client-bedrock-agentcore-control";
|
|
27
27
|
import { ACMClient, AddTagsToCertificateCommand, DeleteCertificateCommand, DescribeCertificateCommand, ListCertificatesCommand, ListTagsForCertificateCommand, RemoveTagsFromCertificateCommand, RequestCertificateCommand, ResourceNotFoundException as ResourceNotFoundException$6, UpdateCertificateOptionsCommand } from "@aws-sdk/client-acm";
|
|
28
28
|
import * as fs from "node:fs";
|
|
29
29
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -31,14 +31,14 @@ import * as path from "node:path";
|
|
|
31
31
|
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
32
32
|
import { execFile, spawn } from "node:child_process";
|
|
33
33
|
import { tmpdir } from "node:os";
|
|
34
|
-
import { AssociateVPCWithHostedZoneCommand, ChangeResourceRecordSetsCommand, ChangeTagsForResourceCommand, CreateHostedZoneCommand, CreateQueryLoggingConfigCommand, DeleteHostedZoneCommand, DeleteQueryLoggingConfigCommand, DisassociateVPCFromHostedZoneCommand, GetHostedZoneCommand, ListHostedZonesByNameCommand, ListHostedZonesCommand, ListQueryLoggingConfigsCommand, ListResourceRecordSetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
34
|
+
import { AssociateVPCWithHostedZoneCommand, ChangeResourceRecordSetsCommand, ChangeTagsForResourceCommand, CreateHostedZoneCommand, CreateQueryLoggingConfigCommand, DeleteHostedZoneCommand, DeleteQueryLoggingConfigCommand, DisassociateVPCFromHostedZoneCommand, GetHostedZoneCommand, ListHostedZonesByNameCommand, ListHostedZonesCommand, ListQueryLoggingConfigsCommand, ListResourceRecordSetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$7, Route53Client, UpdateHostedZoneCommentCommand, UpdateHostedZoneFeaturesCommand } from "@aws-sdk/client-route-53";
|
|
35
35
|
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";
|
|
36
|
-
import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, EnableKeyCommand, EnableKeyRotationCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, KMSClient, ListAliasesCommand, ListKeysCommand, ListResourceTagsCommand, NotFoundException as NotFoundException$2, PutKeyPolicyCommand, ScheduleKeyDeletionCommand, TagResourceCommand as TagResourceCommand$
|
|
36
|
+
import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, EnableKeyCommand, EnableKeyRotationCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, KMSClient, ListAliasesCommand, ListKeysCommand, ListResourceTagsCommand, NotFoundException as NotFoundException$2, PutKeyPolicyCommand, ScheduleKeyDeletionCommand, TagResourceCommand as TagResourceCommand$10, UntagResourceCommand as UntagResourceCommand$10, UpdateAliasCommand, UpdateKeyDescriptionCommand } from "@aws-sdk/client-kms";
|
|
37
37
|
import { join as join$1 } from "path";
|
|
38
|
-
import { BatchDeleteImageCommand, CreateRepositoryCommand, DeleteLifecyclePolicyCommand, DeleteRepositoryCommand, DeleteRepositoryPolicyCommand, DescribeImagesCommand as DescribeImagesCommand$1, DescribeRepositoriesCommand, ECRClient, GetAuthorizationTokenCommand, GetLifecyclePolicyCommand, LifecyclePolicyNotFoundException, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
38
|
+
import { BatchDeleteImageCommand, CreateRepositoryCommand, DeleteLifecyclePolicyCommand, DeleteRepositoryCommand, DeleteRepositoryPolicyCommand, DescribeImagesCommand as DescribeImagesCommand$1, DescribeRepositoriesCommand, ECRClient, GetAuthorizationTokenCommand, GetLifecyclePolicyCommand, LifecyclePolicyNotFoundException, ListTagsForResourceCommand as ListTagsForResourceCommand$8, PutImageScanningConfigurationCommand, PutImageTagMutabilityCommand, PutLifecyclePolicyCommand, RepositoryNotFoundException, SetRepositoryPolicyCommand, TagResourceCommand as TagResourceCommand$11, UntagResourceCommand as UntagResourceCommand$11 } from "@aws-sdk/client-ecr";
|
|
39
39
|
import graphlib from "graphlib";
|
|
40
|
-
import { AddTagsToResourceCommand as AddTagsToResourceCommand$1, CreateDBClusterCommand, CreateDBInstanceCommand, CreateDBProxyCommand, CreateDBProxyEndpointCommand, CreateDBSubnetGroupCommand, DBProxyEndpointNotFoundFault, DBProxyNotFoundFault, DBProxyTargetGroupNotFoundFault, DBProxyTargetNotFoundFault, DeleteDBClusterCommand, DeleteDBInstanceCommand, DeleteDBProxyCommand, DeleteDBProxyEndpointCommand, DeleteDBSubnetGroupCommand, DeregisterDBProxyTargetsCommand, DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeDBProxiesCommand, DescribeDBProxyEndpointsCommand, DescribeDBProxyTargetGroupsCommand, DescribeDBProxyTargetsCommand, DescribeDBSubnetGroupsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
41
|
-
import { AddTagsToResourceCommand as AddTagsToResourceCommand$2, CreateCacheClusterCommand, CreateCacheSubnetGroupCommand, DeleteCacheClusterCommand, DeleteCacheSubnetGroupCommand, DescribeCacheClustersCommand, DescribeCacheSubnetGroupsCommand, ElastiCacheClient, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
40
|
+
import { AddTagsToResourceCommand as AddTagsToResourceCommand$1, CreateDBClusterCommand, CreateDBInstanceCommand, CreateDBProxyCommand, CreateDBProxyEndpointCommand, CreateDBSubnetGroupCommand, DBProxyEndpointNotFoundFault, DBProxyNotFoundFault, DBProxyTargetGroupNotFoundFault, DBProxyTargetNotFoundFault, DeleteDBClusterCommand, DeleteDBInstanceCommand, DeleteDBProxyCommand, DeleteDBProxyEndpointCommand, DeleteDBSubnetGroupCommand, DeregisterDBProxyTargetsCommand, DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeDBProxiesCommand, DescribeDBProxyEndpointsCommand, DescribeDBProxyTargetGroupsCommand, DescribeDBProxyTargetsCommand, DescribeDBSubnetGroupsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$9, ModifyDBClusterCommand, ModifyDBInstanceCommand, ModifyDBProxyCommand, ModifyDBProxyEndpointCommand, ModifyDBProxyTargetGroupCommand, ModifyDBSubnetGroupCommand, RDSClient, RegisterDBProxyTargetsCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$1 } from "@aws-sdk/client-rds";
|
|
41
|
+
import { AddTagsToResourceCommand as AddTagsToResourceCommand$2, CreateCacheClusterCommand, CreateCacheSubnetGroupCommand, DeleteCacheClusterCommand, DeleteCacheSubnetGroupCommand, DescribeCacheClustersCommand, DescribeCacheSubnetGroupsCommand, ElastiCacheClient, ListTagsForResourceCommand as ListTagsForResourceCommand$10, ModifyCacheClusterCommand, ModifyCacheSubnetGroupCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$2 } from "@aws-sdk/client-elasticache";
|
|
42
42
|
import { Command, Option } from "commander";
|
|
43
43
|
import * as readline$1 from "node:readline/promises";
|
|
44
44
|
import readline from "node:readline/promises";
|
|
@@ -46,26 +46,27 @@ import { writeFileSync as writeFileSync$1 } from "fs";
|
|
|
46
46
|
import * as zlib from "node:zlib";
|
|
47
47
|
import { ApplicationAutoScalingClient, DeleteScalingPolicyCommand, DeregisterScalableTargetCommand, DescribeScalableTargetsCommand, DescribeScalingPoliciesCommand, PutScalingPolicyCommand, RegisterScalableTargetCommand } from "@aws-sdk/client-application-auto-scaling";
|
|
48
48
|
import { ApiGatewayV2Client, CreateApiCommand, CreateAuthorizerCommand as CreateAuthorizerCommand$1, CreateIntegrationCommand, CreateRouteCommand as CreateRouteCommand$1, CreateStageCommand as CreateStageCommand$1, DeleteApiCommand, DeleteAuthorizerCommand as DeleteAuthorizerCommand$1, DeleteIntegrationCommand, DeleteRouteCommand as DeleteRouteCommand$1, DeleteStageCommand as DeleteStageCommand$1, GetApiCommand, GetApisCommand, GetAuthorizerCommand as GetAuthorizerCommand$1, GetIntegrationCommand, GetRouteCommand, GetStageCommand as GetStageCommand$1, NotFoundException as NotFoundException$3, UpdateApiCommand, UpdateAuthorizerCommand as UpdateAuthorizerCommand$1, UpdateIntegrationCommand, UpdateRouteCommand, UpdateStageCommand as UpdateStageCommand$1 } from "@aws-sdk/client-apigatewayv2";
|
|
49
|
-
import { CreateStateMachineCommand, DeleteStateMachineCommand, DescribeStateMachineCommand, ListStateMachinesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
50
|
-
import { CreateClusterCommand, CreateServiceCommand, DeleteClusterCommand, DeleteServiceCommand, DeregisterTaskDefinitionCommand, DescribeClustersCommand, DescribeServicesCommand, DescribeTaskDefinitionCommand, ECSClient, ListClustersCommand, ListServicesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
51
|
-
import { AddTagsToResourceCommand as AddTagsToResourceCommand$3, CreateDBClusterCommand as CreateDBClusterCommand$1, CreateDBInstanceCommand as CreateDBInstanceCommand$1, CreateDBSubnetGroupCommand as CreateDBSubnetGroupCommand$1, DeleteDBClusterCommand as DeleteDBClusterCommand$1, DeleteDBInstanceCommand as DeleteDBInstanceCommand$1, DeleteDBSubnetGroupCommand as DeleteDBSubnetGroupCommand$1, DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$1, DocDBClient, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
52
|
-
import { AddTagsToResourceCommand as AddTagsToResourceCommand$4, CreateDBClusterCommand as CreateDBClusterCommand$2, CreateDBInstanceCommand as CreateDBInstanceCommand$2, CreateDBSubnetGroupCommand as CreateDBSubnetGroupCommand$2, DeleteDBClusterCommand as DeleteDBClusterCommand$2, DeleteDBInstanceCommand as DeleteDBInstanceCommand$2, DeleteDBSubnetGroupCommand as DeleteDBSubnetGroupCommand$2, DescribeDBClustersCommand as DescribeDBClustersCommand$2, DescribeDBInstancesCommand as DescribeDBInstancesCommand$2, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$2, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
53
|
-
import { AddCustomAttributesCommand, CognitoIdentityProviderClient, CreateUserPoolCommand, DeleteUserPoolCommand, DescribeUserPoolCommand, GetUserPoolMfaConfigCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
54
|
-
import { CreateHttpNamespaceCommand, CreatePrivateDnsNamespaceCommand, CreatePublicDnsNamespaceCommand, CreateServiceCommand as CreateServiceCommand$1, DeleteNamespaceCommand, DeleteServiceAttributesCommand, DeleteServiceCommand as DeleteServiceCommand$1, GetNamespaceCommand, GetOperationCommand, GetServiceAttributesCommand, GetServiceCommand, ListNamespacesCommand, ListServicesCommand as ListServicesCommand$1, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
55
|
-
import { AppSyncClient, CreateApiKeyCommand, CreateDataSourceCommand, CreateGraphqlApiCommand, CreateResolverCommand, DeleteApiKeyCommand, DeleteDataSourceCommand, DeleteGraphqlApiCommand, DeleteResolverCommand, GetDataSourceCommand, GetGraphqlApiCommand, GetIntrospectionSchemaCommand, GetResolverCommand, ListApiKeysCommand, ListGraphqlApisCommand, NotFoundException as NotFoundException$4, StartSchemaCreationCommand, TagResourceCommand as TagResourceCommand$
|
|
49
|
+
import { CreateStateMachineCommand, DeleteStateMachineCommand, DescribeStateMachineCommand, ListStateMachinesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$11, SFNClient, StateMachineDoesNotExist, TagResourceCommand as TagResourceCommand$12, UntagResourceCommand as UntagResourceCommand$12, UpdateStateMachineCommand } from "@aws-sdk/client-sfn";
|
|
50
|
+
import { CreateClusterCommand, CreateServiceCommand, DeleteClusterCommand, DeleteServiceCommand, DeregisterTaskDefinitionCommand, DescribeClustersCommand, DescribeServicesCommand, DescribeTaskDefinitionCommand, ECSClient, ListClustersCommand, ListServicesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$12, PutClusterCapacityProvidersCommand, RegisterTaskDefinitionCommand, TagResourceCommand as TagResourceCommand$13, UntagResourceCommand as UntagResourceCommand$13, UpdateClusterCommand, UpdateServiceCommand } from "@aws-sdk/client-ecs";
|
|
51
|
+
import { AddTagsToResourceCommand as AddTagsToResourceCommand$3, CreateDBClusterCommand as CreateDBClusterCommand$1, CreateDBInstanceCommand as CreateDBInstanceCommand$1, CreateDBSubnetGroupCommand as CreateDBSubnetGroupCommand$1, DeleteDBClusterCommand as DeleteDBClusterCommand$1, DeleteDBInstanceCommand as DeleteDBInstanceCommand$1, DeleteDBSubnetGroupCommand as DeleteDBSubnetGroupCommand$1, DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$1, DocDBClient, ListTagsForResourceCommand as ListTagsForResourceCommand$13, ModifyDBClusterCommand as ModifyDBClusterCommand$1, ModifyDBInstanceCommand as ModifyDBInstanceCommand$1, ModifyDBSubnetGroupCommand as ModifyDBSubnetGroupCommand$1, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$3 } from "@aws-sdk/client-docdb";
|
|
52
|
+
import { AddTagsToResourceCommand as AddTagsToResourceCommand$4, CreateDBClusterCommand as CreateDBClusterCommand$2, CreateDBInstanceCommand as CreateDBInstanceCommand$2, CreateDBSubnetGroupCommand as CreateDBSubnetGroupCommand$2, DeleteDBClusterCommand as DeleteDBClusterCommand$2, DeleteDBInstanceCommand as DeleteDBInstanceCommand$2, DeleteDBSubnetGroupCommand as DeleteDBSubnetGroupCommand$2, DescribeDBClustersCommand as DescribeDBClustersCommand$2, DescribeDBInstancesCommand as DescribeDBInstancesCommand$2, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$2, ListTagsForResourceCommand as ListTagsForResourceCommand$14, ModifyDBClusterCommand as ModifyDBClusterCommand$2, ModifyDBInstanceCommand as ModifyDBInstanceCommand$2, ModifyDBSubnetGroupCommand as ModifyDBSubnetGroupCommand$2, NeptuneClient, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$4 } from "@aws-sdk/client-neptune";
|
|
53
|
+
import { AddCustomAttributesCommand, CognitoIdentityProviderClient, CreateUserPoolCommand, DeleteUserPoolCommand, DescribeUserPoolCommand, GetUserPoolMfaConfigCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$15, ListUserPoolsCommand, ResourceNotFoundException as ResourceNotFoundException$7, SetUserPoolMfaConfigCommand, UpdateUserPoolCommand } from "@aws-sdk/client-cognito-identity-provider";
|
|
54
|
+
import { CreateHttpNamespaceCommand, CreatePrivateDnsNamespaceCommand, CreatePublicDnsNamespaceCommand, CreateServiceCommand as CreateServiceCommand$1, DeleteNamespaceCommand, DeleteServiceAttributesCommand, DeleteServiceCommand as DeleteServiceCommand$1, GetNamespaceCommand, GetOperationCommand, GetServiceAttributesCommand, GetServiceCommand, ListNamespacesCommand, ListServicesCommand as ListServicesCommand$1, ListTagsForResourceCommand as ListTagsForResourceCommand$16, NamespaceNotFound, ServiceDiscoveryClient, ServiceNotFound, TagResourceCommand as TagResourceCommand$14, UntagResourceCommand as UntagResourceCommand$14, UpdateHttpNamespaceCommand, UpdatePrivateDnsNamespaceCommand, UpdatePublicDnsNamespaceCommand, UpdateServiceAttributesCommand, UpdateServiceCommand as UpdateServiceCommand$1 } from "@aws-sdk/client-servicediscovery";
|
|
55
|
+
import { AppSyncClient, CreateApiKeyCommand, CreateDataSourceCommand, CreateGraphqlApiCommand, CreateResolverCommand, DeleteApiKeyCommand, DeleteDataSourceCommand, DeleteGraphqlApiCommand, DeleteResolverCommand, GetDataSourceCommand, GetGraphqlApiCommand, GetIntrospectionSchemaCommand, GetResolverCommand, ListApiKeysCommand, ListGraphqlApisCommand, NotFoundException as NotFoundException$4, StartSchemaCreationCommand, TagResourceCommand as TagResourceCommand$15, UntagResourceCommand as UntagResourceCommand$15, UpdateApiKeyCommand, UpdateDataSourceCommand, UpdateGraphqlApiCommand, UpdateResolverCommand } from "@aws-sdk/client-appsync";
|
|
56
56
|
import { parse, print } from "graphql";
|
|
57
57
|
import { CrawlerRunningException, CreateConnectionCommand, CreateCrawlerCommand, CreateDatabaseCommand, CreateJobCommand, CreateSecurityConfigurationCommand, CreateTableCommand as CreateTableCommand$1, CreateTriggerCommand, CreateWorkflowCommand, DeleteConnectionCommand, DeleteCrawlerCommand, DeleteDatabaseCommand, DeleteJobCommand, DeleteSecurityConfigurationCommand, DeleteTableCommand as DeleteTableCommand$1, DeleteTriggerCommand, DeleteWorkflowCommand, EntityNotFoundException, GetConnectionCommand, GetCrawlerCommand, GetDatabaseCommand, GetDatabasesCommand, GetJobCommand, GetSecurityConfigurationCommand, GetSecurityConfigurationsCommand, GetTableCommand, GetTablesCommand, GetTagsCommand, GetTriggerCommand, GetWorkflowCommand, GlueClient, ListWorkflowsCommand, StartCrawlerScheduleCommand, StartTriggerCommand, StopCrawlerCommand, StopCrawlerScheduleCommand, StopTriggerCommand, UpdateConnectionCommand, UpdateCrawlerCommand, UpdateDatabaseCommand, UpdateJobCommand, UpdateTableCommand as UpdateTableCommand$1, UpdateTriggerCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
|
|
58
|
-
import { BudgetsClient, CreateBudgetCommand, CreateNotificationCommand, CreateSubscriberCommand, DeleteBudgetCommand, DeleteNotificationCommand, DeleteSubscriberCommand, DescribeBudgetCommand, DescribeBudgetsCommand, DuplicateRecordException, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
59
|
-
import { AddTagsToStreamCommand, CreateStreamCommand, DecreaseStreamRetentionPeriodCommand, DeleteStreamCommand, DeregisterStreamConsumerCommand, DescribeStreamCommand, DescribeStreamConsumerCommand, DescribeStreamSummaryCommand, IncreaseStreamRetentionPeriodCommand, KinesisClient, ListStreamsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
58
|
+
import { BudgetsClient, CreateBudgetCommand, CreateNotificationCommand, CreateSubscriberCommand, DeleteBudgetCommand, DeleteNotificationCommand, DeleteSubscriberCommand, DescribeBudgetCommand, DescribeBudgetsCommand, DuplicateRecordException, ListTagsForResourceCommand as ListTagsForResourceCommand$17, NotFoundException as NotFoundException$5, TagResourceCommand as TagResourceCommand$16, UntagResourceCommand as UntagResourceCommand$16, UpdateBudgetCommand } from "@aws-sdk/client-budgets";
|
|
59
|
+
import { AddTagsToStreamCommand, CreateStreamCommand, DecreaseStreamRetentionPeriodCommand, DeleteStreamCommand, DeregisterStreamConsumerCommand, DescribeStreamCommand, DescribeStreamConsumerCommand, DescribeStreamSummaryCommand, IncreaseStreamRetentionPeriodCommand, KinesisClient, ListStreamsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$18, ListTagsForStreamCommand, RegisterStreamConsumerCommand, RemoveTagsFromStreamCommand, ResourceNotFoundException as ResourceNotFoundException$8, StartStreamEncryptionCommand, StopStreamEncryptionCommand, TagResourceCommand as TagResourceCommand$17, UntagResourceCommand as UntagResourceCommand$17, UpdateShardCountCommand, UpdateStreamModeCommand } from "@aws-sdk/client-kinesis";
|
|
60
60
|
import { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, ResourceNotFoundException as ResourceNotFoundException$9, SchedulerClient, UpdateScheduleCommand } from "@aws-sdk/client-scheduler";
|
|
61
61
|
import { AccessPointNotFound, CreateAccessPointCommand, CreateFileSystemCommand, CreateMountTargetCommand, DeleteAccessPointCommand, DeleteFileSystemCommand, DeleteMountTargetCommand, DescribeAccessPointsCommand, DescribeBackupPolicyCommand, DescribeFileSystemPolicyCommand, DescribeFileSystemsCommand, DescribeLifecycleConfigurationCommand, DescribeMountTargetSecurityGroupsCommand, DescribeMountTargetsCommand, EFSClient, FileSystemNotFound, ModifyMountTargetSecurityGroupsCommand, MountTargetNotFound, PutBackupPolicyCommand, PutFileSystemPolicyCommand, PutLifecycleConfigurationCommand, UpdateFileSystemCommand, UpdateFileSystemProtectionCommand } from "@aws-sdk/client-efs";
|
|
62
|
+
import { CreateFileSystemCommand as CreateFileSystemCommand$1, CreateFileSystemFromBackupCommand, DeleteFileSystemCommand as DeleteFileSystemCommand$1, DescribeFileSystemsCommand as DescribeFileSystemsCommand$1, FSxClient, FileSystemNotFound as FileSystemNotFound$1, TagResourceCommand as TagResourceCommand$18, UntagResourceCommand as UntagResourceCommand$18, UpdateFileSystemCommand as UpdateFileSystemCommand$1 } from "@aws-sdk/client-fsx";
|
|
62
63
|
import { CreateDeliveryStreamCommand, DeleteDeliveryStreamCommand, DescribeDeliveryStreamCommand, FirehoseClient, ListDeliveryStreamsCommand, ListTagsForDeliveryStreamCommand, ResourceNotFoundException as ResourceNotFoundException$10, TagDeliveryStreamCommand, UntagDeliveryStreamCommand, UpdateDestinationCommand } from "@aws-sdk/client-firehose";
|
|
63
64
|
import { AddTagsCommand as AddTagsCommand$1, CloudTrailClient, CreateTrailCommand, DeleteTrailCommand, GetEventSelectorsCommand, GetInsightSelectorsCommand, GetTrailCommand, GetTrailStatusCommand, ListTagsCommand as ListTagsCommand$1, ListTrailsCommand, PutEventSelectorsCommand, PutInsightSelectorsCommand, RemoveTagsCommand as RemoveTagsCommand$1, StartLoggingCommand, StopLoggingCommand, TrailNotFoundException, UpdateTrailCommand } from "@aws-sdk/client-cloudtrail";
|
|
64
65
|
import { BatchGetProjectsCommand, CodeBuildClient, CreateProjectCommand, DeleteProjectCommand, ListProjectsCommand, ResourceNotFoundException as ResourceNotFoundException$11, UpdateProjectCommand } from "@aws-sdk/client-codebuild";
|
|
65
|
-
import { CodeCommitClient, CreateRepositoryCommand as CreateRepositoryCommand$1, DeleteRepositoryCommand as DeleteRepositoryCommand$1, GetRepositoryCommand, ListRepositoriesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
66
|
-
import { CreateLifecyclePolicyCommand, DLMClient, DeleteLifecyclePolicyCommand as DeleteLifecyclePolicyCommand$1, GetLifecyclePoliciesCommand, GetLifecyclePolicyCommand as GetLifecyclePolicyCommand$1, ResourceNotFoundException as ResourceNotFoundException$12, TagResourceCommand as TagResourceCommand$
|
|
67
|
-
import { CreateVectorBucketCommand, DeleteIndexCommand, DeleteVectorBucketCommand, GetVectorBucketCommand, ListIndexesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
68
|
-
import { CreateNamespaceCommand, CreateTableBucketCommand, CreateTableCommand as CreateTableCommand$2, DeleteNamespaceCommand as DeleteNamespaceCommand$1, DeleteTableBucketCommand, DeleteTableCommand as DeleteTableCommand$2, GetTableBucketCommand, GetTableCommand as GetTableCommand$1, ListNamespacesCommand as ListNamespacesCommand$1, ListTableBucketsCommand, ListTablesCommand as ListTablesCommand$1, ListTagsForResourceCommand as ListTagsForResourceCommand$
|
|
66
|
+
import { CodeCommitClient, CreateRepositoryCommand as CreateRepositoryCommand$1, DeleteRepositoryCommand as DeleteRepositoryCommand$1, GetRepositoryCommand, ListRepositoriesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$19, RepositoryDoesNotExistException, TagResourceCommand as TagResourceCommand$19, UntagResourceCommand as UntagResourceCommand$19, UpdateRepositoryDescriptionCommand, UpdateRepositoryEncryptionKeyCommand, UpdateRepositoryNameCommand } from "@aws-sdk/client-codecommit";
|
|
67
|
+
import { CreateLifecyclePolicyCommand, DLMClient, DeleteLifecyclePolicyCommand as DeleteLifecyclePolicyCommand$1, GetLifecyclePoliciesCommand, GetLifecyclePolicyCommand as GetLifecyclePolicyCommand$1, ResourceNotFoundException as ResourceNotFoundException$12, TagResourceCommand as TagResourceCommand$20, UntagResourceCommand as UntagResourceCommand$20, UpdateLifecyclePolicyCommand } from "@aws-sdk/client-dlm";
|
|
68
|
+
import { CreateVectorBucketCommand, DeleteIndexCommand, DeleteVectorBucketCommand, GetVectorBucketCommand, ListIndexesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$20, ListVectorBucketsCommand, S3VectorsClient, TagResourceCommand as TagResourceCommand$21, UntagResourceCommand as UntagResourceCommand$21 } from "@aws-sdk/client-s3vectors";
|
|
69
|
+
import { CreateNamespaceCommand, CreateTableBucketCommand, CreateTableCommand as CreateTableCommand$2, DeleteNamespaceCommand as DeleteNamespaceCommand$1, DeleteTableBucketCommand, DeleteTableCommand as DeleteTableCommand$2, GetTableBucketCommand, GetTableCommand as GetTableCommand$1, ListNamespacesCommand as ListNamespacesCommand$1, ListTableBucketsCommand, ListTablesCommand as ListTablesCommand$1, ListTagsForResourceCommand as ListTagsForResourceCommand$21, NotFoundException as NotFoundException$6, S3TablesClient, TagResourceCommand as TagResourceCommand$22, UntagResourceCommand as UntagResourceCommand$22 } from "@aws-sdk/client-s3tables";
|
|
69
70
|
import { Document, Pair, Scalar, YAMLMap, YAMLSeq, parse as parse$1, stringify } from "yaml";
|
|
70
71
|
import { createLocalStartAgentCoreCommand, createLocalStartCloudFrontCommand, createLocalStateProvider, getEmbedConfig, isCfnFlagPresent, listTargets, rejectExplicitCfnStackWithMultipleStacks, resolveCfnFallbackRegion, setEmbedConfig, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync } from "cdk-local";
|
|
71
72
|
import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, EcsTaskResolutionError, HOST_GATEWAY_MIN_VERSION, LocalInvokeBuildError, MCP_CONTAINER_PORT, MCP_PATH, a2aInvokeOnce, addAlbSpecificOptions, addCommonEcsServiceOptions, addStartServiceSpecificOptions, albStrategy, architectureToPlatform, attachAuthorizers, attachStageContext, availableApiIdentifiers, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildStageMap, classifySourceChange, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, filterRoutesByApiIdentifier, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, materializeLayerFromArn, mcpInvokeOnce, parseConnectionsPath, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readMtlsMaterialsFromDisk, resolveAgentCoreTarget, resolveEnvVars, resolveHostGatewayExtraHosts, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, runEcsServiceEmulator, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing } from "cdk-local/internal";
|
|
@@ -1888,7 +1889,7 @@ const FLUSH_INTERVAL_MS = 2e3;
|
|
|
1888
1889
|
const FLUSH_EVENT_THRESHOLD = 50;
|
|
1889
1890
|
/** Build-time cdkd version, with a dev fallback for non-built contexts. */
|
|
1890
1891
|
function getCdkdVersion() {
|
|
1891
|
-
return "0.
|
|
1892
|
+
return "0.244.0";
|
|
1892
1893
|
}
|
|
1893
1894
|
/**
|
|
1894
1895
|
* Generate a time-sortable unique run id, e.g.
|
|
@@ -20364,37 +20365,43 @@ var CloudFrontDistributionProvider = class {
|
|
|
20364
20365
|
};
|
|
20365
20366
|
|
|
20366
20367
|
//#endregion
|
|
20367
|
-
//#region src/provisioning/providers/agentcore-
|
|
20368
|
+
//#region src/provisioning/providers/agentcore-case-convert.ts
|
|
20368
20369
|
/**
|
|
20369
|
-
*
|
|
20370
|
+
* PascalCase <-> camelCase key conversion helpers shared by the
|
|
20371
|
+
* BedrockAgentCore SDK Providers (`agentcore-runtime-provider.ts`,
|
|
20372
|
+
* `agentcore-browser-provider.ts`, `agentcore-code-interpreter-provider.ts`,
|
|
20373
|
+
* `agentcore-evaluator-provider.ts`).
|
|
20370
20374
|
*
|
|
20371
|
-
*
|
|
20372
|
-
*
|
|
20373
|
-
*
|
|
20374
|
-
*
|
|
20375
|
-
*
|
|
20376
|
-
*
|
|
20377
|
-
* 6. CC API ClientToken caches the failure result, making it worse
|
|
20375
|
+
* CloudFormation templates carry PascalCase property keys while the
|
|
20376
|
+
* `bedrock-agentcore-control` SDK expects camelCase input shapes (and
|
|
20377
|
+
* returns camelCase output shapes). The BedrockAgentCore CFn schemas mirror
|
|
20378
|
+
* the SDK shapes 1:1 modulo casing, so a mechanical first-letter case flip
|
|
20379
|
+
* round-trips cleanly — including union members (`LlmAsAJudge` <->
|
|
20380
|
+
* `llmAsAJudge`, `CodeBased` <-> `codeBased`).
|
|
20378
20381
|
*
|
|
20379
|
-
*
|
|
20380
|
-
* -
|
|
20381
|
-
* -
|
|
20382
|
-
*
|
|
20383
|
-
* -
|
|
20382
|
+
* `preserveKeys` opts specific keys out of DEEP conversion: the key itself
|
|
20383
|
+
* is still case-flipped, but its VALUE subtree is copied verbatim. Needed
|
|
20384
|
+
* for free-form JSON document properties whose inner keys are user-defined
|
|
20385
|
+
* model/request fields, NOT CFn property names — e.g. the Evaluator's
|
|
20386
|
+
* `AdditionalModelRequestFields` (model-specific request fields like
|
|
20387
|
+
* `top_k` that must reach the service byte-identical).
|
|
20384
20388
|
*/
|
|
20385
20389
|
/**
|
|
20386
20390
|
* Recursively convert PascalCase object keys to camelCase.
|
|
20387
20391
|
* Only converts keys of plain objects; string values, arrays of strings,
|
|
20388
20392
|
* and other primitives are left untouched.
|
|
20393
|
+
*
|
|
20394
|
+
* @param preserveKeys - PascalCase key names whose value subtree is copied
|
|
20395
|
+
* verbatim (the key itself is still converted to camelCase).
|
|
20389
20396
|
*/
|
|
20390
|
-
function pascalToCamelCaseKeys(value) {
|
|
20397
|
+
function pascalToCamelCaseKeys(value, preserveKeys) {
|
|
20391
20398
|
if (value === null || value === void 0) return value;
|
|
20392
|
-
if (Array.isArray(value)) return value.map(pascalToCamelCaseKeys);
|
|
20399
|
+
if (Array.isArray(value)) return value.map((item) => pascalToCamelCaseKeys(item, preserveKeys));
|
|
20393
20400
|
if (typeof value === "object") {
|
|
20394
20401
|
const result = {};
|
|
20395
20402
|
for (const [key, val] of Object.entries(value)) {
|
|
20396
20403
|
const camelKey = key.charAt(0).toLowerCase() + key.slice(1);
|
|
20397
|
-
result[camelKey] = pascalToCamelCaseKeys(val);
|
|
20404
|
+
result[camelKey] = preserveKeys?.has(key) ? val : pascalToCamelCaseKeys(val, preserveKeys);
|
|
20398
20405
|
}
|
|
20399
20406
|
return result;
|
|
20400
20407
|
}
|
|
@@ -20402,22 +20409,46 @@ function pascalToCamelCaseKeys(value) {
|
|
|
20402
20409
|
}
|
|
20403
20410
|
/**
|
|
20404
20411
|
* Recursively convert camelCase object keys to PascalCase. Inverse of
|
|
20405
|
-
* `pascalToCamelCaseKeys`. Used by `readCurrentState` to
|
|
20406
|
-
* SDK responses back into the CFn property names cdkd state
|
|
20412
|
+
* `pascalToCamelCaseKeys`. Used by `readCurrentState` implementations to
|
|
20413
|
+
* re-shape AWS SDK responses back into the CFn property names cdkd state
|
|
20414
|
+
* stores.
|
|
20415
|
+
*
|
|
20416
|
+
* @param preserveKeys - camelCase key names whose value subtree is copied
|
|
20417
|
+
* verbatim (the key itself is still converted to PascalCase).
|
|
20407
20418
|
*/
|
|
20408
|
-
function camelToPascalCaseKeys(value) {
|
|
20419
|
+
function camelToPascalCaseKeys(value, preserveKeys) {
|
|
20409
20420
|
if (value === null || value === void 0) return value;
|
|
20410
|
-
if (Array.isArray(value)) return value.map(camelToPascalCaseKeys);
|
|
20421
|
+
if (Array.isArray(value)) return value.map((item) => camelToPascalCaseKeys(item, preserveKeys));
|
|
20411
20422
|
if (typeof value === "object") {
|
|
20412
20423
|
const result = {};
|
|
20413
20424
|
for (const [key, val] of Object.entries(value)) {
|
|
20414
20425
|
const pascalKey = key.charAt(0).toUpperCase() + key.slice(1);
|
|
20415
|
-
result[pascalKey] = camelToPascalCaseKeys(val);
|
|
20426
|
+
result[pascalKey] = preserveKeys?.has(key) ? val : camelToPascalCaseKeys(val, preserveKeys);
|
|
20416
20427
|
}
|
|
20417
20428
|
return result;
|
|
20418
20429
|
}
|
|
20419
20430
|
return value;
|
|
20420
20431
|
}
|
|
20432
|
+
|
|
20433
|
+
//#endregion
|
|
20434
|
+
//#region src/provisioning/providers/agentcore-runtime-provider.ts
|
|
20435
|
+
/**
|
|
20436
|
+
* SDK Provider for AWS::BedrockAgentCore::Runtime
|
|
20437
|
+
*
|
|
20438
|
+
* Uses direct SDK calls instead of Cloud Control API because:
|
|
20439
|
+
* 1. CC API CREATE is async - it returns IN_PROGRESS, then polls for completion
|
|
20440
|
+
* 2. IAM role propagation to BedrockAgentCore is very slow (30-60+ seconds)
|
|
20441
|
+
* 3. When CC API polling returns FAILED (role validation), cdkd retries CREATE
|
|
20442
|
+
* 4. But the first CREATE actually succeeded asynchronously in the background
|
|
20443
|
+
* 5. The retry then fails with "already exists"
|
|
20444
|
+
* 6. CC API ClientToken caches the failure result, making it worse
|
|
20445
|
+
*
|
|
20446
|
+
* With direct SDK calls, we can:
|
|
20447
|
+
* - Call CreateAgentRuntime synchronously
|
|
20448
|
+
* - Get immediate error responses for IAM propagation issues
|
|
20449
|
+
* - Retry with proper exponential backoff
|
|
20450
|
+
* - Avoid the async CREATE + polling + retry conflict
|
|
20451
|
+
*/
|
|
20421
20452
|
/**
|
|
20422
20453
|
* AWS BedrockAgentCore Runtime Provider
|
|
20423
20454
|
*
|
|
@@ -20627,6 +20658,502 @@ var AgentCoreRuntimeProvider = class {
|
|
|
20627
20658
|
}
|
|
20628
20659
|
};
|
|
20629
20660
|
|
|
20661
|
+
//#endregion
|
|
20662
|
+
//#region src/provisioning/providers/agentcore-browser-provider.ts
|
|
20663
|
+
/**
|
|
20664
|
+
* SDK Provider for AWS::BedrockAgentCore::Browser (adopt-only singleton).
|
|
20665
|
+
*
|
|
20666
|
+
* The CloudFormation registry schema declares this type as a READ-ONLY
|
|
20667
|
+
* resource "representing the default service-managed browser"
|
|
20668
|
+
* (`aws.browser.v1`): every schema property (`BrowserArn` / `BrowserId` /
|
|
20669
|
+
* `Name` / `Status`) is read-only, the only handlers are read/list, and the
|
|
20670
|
+
* `BrowserId` pattern is hard-locked to `^aws\.browser\.v1$`. The registry
|
|
20671
|
+
* marks it `NON_PROVISIONABLE`, so Cloud Control cannot deploy it and cdkd's
|
|
20672
|
+
* pre-flight used to reject it (issue #1038).
|
|
20673
|
+
*
|
|
20674
|
+
* cdkd therefore provisions it as an ADOPT operation, not a create:
|
|
20675
|
+
* - `create` verifies the AWS-managed default browser exists in the deploy
|
|
20676
|
+
* region via `GetBrowser` and records its ARN as the physical id (the
|
|
20677
|
+
* type's primaryIdentifier, matching CFn `Ref` semantics).
|
|
20678
|
+
* - `update` is a no-op (no writable properties exist).
|
|
20679
|
+
* - `delete` is a no-op — the default browser is AWS-owned and must never
|
|
20680
|
+
* be deleted when a stack is destroyed.
|
|
20681
|
+
* - `getAttribute` serves the read-only attributes live from `GetBrowser`.
|
|
20682
|
+
*
|
|
20683
|
+
* Custom, user-created browsers are a DIFFERENT CFn type
|
|
20684
|
+
* (`AWS::BedrockAgentCore::BrowserCustom`, FULLY_MUTABLE) which Cloud
|
|
20685
|
+
* Control handles; the `CreateBrowser` / `DeleteBrowser` control-plane ops
|
|
20686
|
+
* belong to that type's lifecycle, not this one's.
|
|
20687
|
+
*/
|
|
20688
|
+
/** The only valid browser id for this type per the CFn schema pattern. */
|
|
20689
|
+
const DEFAULT_BROWSER_ID = "aws.browser.v1";
|
|
20690
|
+
/**
|
|
20691
|
+
* AWS BedrockAgentCore default-Browser Provider (adopt-only).
|
|
20692
|
+
*/
|
|
20693
|
+
var AgentCoreBrowserProvider = class {
|
|
20694
|
+
client;
|
|
20695
|
+
logger = getLogger().child("AgentCoreBrowserProvider");
|
|
20696
|
+
handledProperties = new Map([["AWS::BedrockAgentCore::Browser", /* @__PURE__ */ new Set([])]]);
|
|
20697
|
+
constructor() {
|
|
20698
|
+
const awsClients = getAwsClients();
|
|
20699
|
+
this.client = awsClients.bedrockAgentCoreControl;
|
|
20700
|
+
}
|
|
20701
|
+
/**
|
|
20702
|
+
* "Create" = adopt the AWS-managed default browser: verify it exists in
|
|
20703
|
+
* the deploy region and record its ARN (the CFn primaryIdentifier) as the
|
|
20704
|
+
* physical id. Nothing is created in AWS.
|
|
20705
|
+
*/
|
|
20706
|
+
async create(logicalId, resourceType, _properties) {
|
|
20707
|
+
this.logger.debug(`Adopting AWS-managed default browser for ${logicalId}`);
|
|
20708
|
+
try {
|
|
20709
|
+
const response = await this.client.send(new GetBrowserCommand({ browserId: DEFAULT_BROWSER_ID }));
|
|
20710
|
+
const browserArn = response.browserArn;
|
|
20711
|
+
this.logger.debug(`Adopted default browser ${DEFAULT_BROWSER_ID} (${browserArn})`);
|
|
20712
|
+
return {
|
|
20713
|
+
physicalId: browserArn,
|
|
20714
|
+
attributes: {
|
|
20715
|
+
BrowserArn: browserArn,
|
|
20716
|
+
BrowserId: response.browserId ?? "aws.browser.v1",
|
|
20717
|
+
Name: response.name ?? "",
|
|
20718
|
+
Status: response.status ?? ""
|
|
20719
|
+
}
|
|
20720
|
+
};
|
|
20721
|
+
} catch (error) {
|
|
20722
|
+
const cause = error instanceof Error ? error : void 0;
|
|
20723
|
+
throw new ProvisioningError(`Failed to adopt the AWS-managed default browser for ${logicalId}: ${error instanceof Error ? error.message : String(error)}. Bedrock AgentCore may not be available in this region.`, resourceType, logicalId, void 0, cause);
|
|
20724
|
+
}
|
|
20725
|
+
}
|
|
20726
|
+
/**
|
|
20727
|
+
* Every property on this type is read-only, so there is nothing to
|
|
20728
|
+
* update — keep the existing physical id.
|
|
20729
|
+
*/
|
|
20730
|
+
async update(logicalId, physicalId, _resourceType, _properties, _previousProperties) {
|
|
20731
|
+
this.logger.debug(`No-op update for default browser ${logicalId}`);
|
|
20732
|
+
return {
|
|
20733
|
+
physicalId,
|
|
20734
|
+
wasReplaced: false,
|
|
20735
|
+
attributes: {}
|
|
20736
|
+
};
|
|
20737
|
+
}
|
|
20738
|
+
/**
|
|
20739
|
+
* The default browser is AWS-owned; destroying a stack must never delete
|
|
20740
|
+
* it. Pure no-op.
|
|
20741
|
+
*/
|
|
20742
|
+
async delete(logicalId, _physicalId, _resourceType) {
|
|
20743
|
+
this.logger.debug(`No-op delete for AWS-managed default browser ${logicalId}`);
|
|
20744
|
+
}
|
|
20745
|
+
/**
|
|
20746
|
+
* Get resource attribute (for Fn::GetAtt resolution). The CFn read-only
|
|
20747
|
+
* attribute set is BrowserArn / BrowserId / Name / Status.
|
|
20748
|
+
*/
|
|
20749
|
+
async getAttribute(physicalId, _resourceType, attributeName) {
|
|
20750
|
+
if (attributeName === "BrowserArn") return physicalId;
|
|
20751
|
+
if (attributeName === "BrowserId") return DEFAULT_BROWSER_ID;
|
|
20752
|
+
if (attributeName === "Name" || attributeName === "Status") {
|
|
20753
|
+
const response = await this.client.send(new GetBrowserCommand({ browserId: DEFAULT_BROWSER_ID }));
|
|
20754
|
+
return attributeName === "Name" ? response.name : response.status;
|
|
20755
|
+
}
|
|
20756
|
+
throw new Error(`Unsupported attribute: ${attributeName} for AWS::BedrockAgentCore::Browser`);
|
|
20757
|
+
}
|
|
20758
|
+
/** No managed properties → nothing can drift. */
|
|
20759
|
+
async readCurrentState() {
|
|
20760
|
+
return {};
|
|
20761
|
+
}
|
|
20762
|
+
/**
|
|
20763
|
+
* Import: the type is a singleton pointing at the AWS-managed default
|
|
20764
|
+
* browser, so auto-lookup is trivial — resolve it live via `GetBrowser`
|
|
20765
|
+
* (no `--resource` override needed; a supplied override is ignored in
|
|
20766
|
+
* favor of the live ARN, which is the only valid physical id).
|
|
20767
|
+
*/
|
|
20768
|
+
async import(_input) {
|
|
20769
|
+
const response = await this.client.send(new GetBrowserCommand({ browserId: DEFAULT_BROWSER_ID }));
|
|
20770
|
+
return {
|
|
20771
|
+
physicalId: response.browserArn,
|
|
20772
|
+
attributes: {
|
|
20773
|
+
BrowserArn: response.browserArn,
|
|
20774
|
+
BrowserId: response.browserId ?? "aws.browser.v1",
|
|
20775
|
+
Name: response.name ?? "",
|
|
20776
|
+
Status: response.status ?? ""
|
|
20777
|
+
}
|
|
20778
|
+
};
|
|
20779
|
+
}
|
|
20780
|
+
};
|
|
20781
|
+
|
|
20782
|
+
//#endregion
|
|
20783
|
+
//#region src/provisioning/providers/agentcore-code-interpreter-provider.ts
|
|
20784
|
+
/**
|
|
20785
|
+
* SDK Provider for AWS::BedrockAgentCore::CodeInterpreter (adopt-only
|
|
20786
|
+
* singleton).
|
|
20787
|
+
*
|
|
20788
|
+
* The CloudFormation registry schema declares this type as a READ-ONLY
|
|
20789
|
+
* resource "representing the AWS-managed default code interpreter
|
|
20790
|
+
* (aws.codeinterpreter.v1)": every schema property (`CodeInterpreterArn` /
|
|
20791
|
+
* `CodeInterpreterId` / `Status`) is read-only, the only handlers are
|
|
20792
|
+
* read/list, and the `CodeInterpreterId` pattern is hard-locked to
|
|
20793
|
+
* `^aws\.codeinterpreter\.v1$`. The registry marks it `NON_PROVISIONABLE`,
|
|
20794
|
+
* so Cloud Control cannot deploy it and cdkd's pre-flight used to reject it
|
|
20795
|
+
* (issue #1039).
|
|
20796
|
+
*
|
|
20797
|
+
* cdkd therefore provisions it as an ADOPT operation, not a create — see
|
|
20798
|
+
* `agentcore-browser-provider.ts` (the exactly-parallel sibling) for the
|
|
20799
|
+
* full rationale. Custom, user-created code interpreters are a DIFFERENT
|
|
20800
|
+
* CFn type (`AWS::BedrockAgentCore::CodeInterpreterCustom`, FULLY_MUTABLE)
|
|
20801
|
+
* which Cloud Control handles.
|
|
20802
|
+
*/
|
|
20803
|
+
/** The only valid code interpreter id for this type per the CFn schema pattern. */
|
|
20804
|
+
const DEFAULT_CODE_INTERPRETER_ID = "aws.codeinterpreter.v1";
|
|
20805
|
+
/**
|
|
20806
|
+
* AWS BedrockAgentCore default-CodeInterpreter Provider (adopt-only).
|
|
20807
|
+
*/
|
|
20808
|
+
var AgentCoreCodeInterpreterProvider = class {
|
|
20809
|
+
client;
|
|
20810
|
+
logger = getLogger().child("AgentCoreCodeInterpreterProvider");
|
|
20811
|
+
handledProperties = new Map([["AWS::BedrockAgentCore::CodeInterpreter", /* @__PURE__ */ new Set([])]]);
|
|
20812
|
+
constructor() {
|
|
20813
|
+
const awsClients = getAwsClients();
|
|
20814
|
+
this.client = awsClients.bedrockAgentCoreControl;
|
|
20815
|
+
}
|
|
20816
|
+
/**
|
|
20817
|
+
* "Create" = adopt the AWS-managed default code interpreter: verify it
|
|
20818
|
+
* exists in the deploy region and record its ARN (the CFn
|
|
20819
|
+
* primaryIdentifier) as the physical id. Nothing is created in AWS.
|
|
20820
|
+
*/
|
|
20821
|
+
async create(logicalId, resourceType, _properties) {
|
|
20822
|
+
this.logger.debug(`Adopting AWS-managed default code interpreter for ${logicalId}`);
|
|
20823
|
+
try {
|
|
20824
|
+
const response = await this.client.send(new GetCodeInterpreterCommand({ codeInterpreterId: DEFAULT_CODE_INTERPRETER_ID }));
|
|
20825
|
+
const codeInterpreterArn = response.codeInterpreterArn;
|
|
20826
|
+
this.logger.debug(`Adopted default code interpreter ${DEFAULT_CODE_INTERPRETER_ID} (${codeInterpreterArn})`);
|
|
20827
|
+
return {
|
|
20828
|
+
physicalId: codeInterpreterArn,
|
|
20829
|
+
attributes: {
|
|
20830
|
+
CodeInterpreterArn: codeInterpreterArn,
|
|
20831
|
+
CodeInterpreterId: response.codeInterpreterId ?? "aws.codeinterpreter.v1",
|
|
20832
|
+
Status: response.status ?? ""
|
|
20833
|
+
}
|
|
20834
|
+
};
|
|
20835
|
+
} catch (error) {
|
|
20836
|
+
const cause = error instanceof Error ? error : void 0;
|
|
20837
|
+
throw new ProvisioningError(`Failed to adopt the AWS-managed default code interpreter for ${logicalId}: ${error instanceof Error ? error.message : String(error)}. Bedrock AgentCore may not be available in this region.`, resourceType, logicalId, void 0, cause);
|
|
20838
|
+
}
|
|
20839
|
+
}
|
|
20840
|
+
/**
|
|
20841
|
+
* Every property on this type is read-only, so there is nothing to
|
|
20842
|
+
* update — keep the existing physical id.
|
|
20843
|
+
*/
|
|
20844
|
+
async update(logicalId, physicalId, _resourceType, _properties, _previousProperties) {
|
|
20845
|
+
this.logger.debug(`No-op update for default code interpreter ${logicalId}`);
|
|
20846
|
+
return {
|
|
20847
|
+
physicalId,
|
|
20848
|
+
wasReplaced: false,
|
|
20849
|
+
attributes: {}
|
|
20850
|
+
};
|
|
20851
|
+
}
|
|
20852
|
+
/**
|
|
20853
|
+
* The default code interpreter is AWS-owned; destroying a stack must
|
|
20854
|
+
* never delete it. Pure no-op.
|
|
20855
|
+
*/
|
|
20856
|
+
async delete(logicalId, _physicalId, _resourceType) {
|
|
20857
|
+
this.logger.debug(`No-op delete for AWS-managed default code interpreter ${logicalId}`);
|
|
20858
|
+
}
|
|
20859
|
+
/**
|
|
20860
|
+
* Get resource attribute (for Fn::GetAtt resolution). The CFn read-only
|
|
20861
|
+
* attribute set is CodeInterpreterArn / CodeInterpreterId / Status.
|
|
20862
|
+
*/
|
|
20863
|
+
async getAttribute(physicalId, _resourceType, attributeName) {
|
|
20864
|
+
if (attributeName === "CodeInterpreterArn") return physicalId;
|
|
20865
|
+
if (attributeName === "CodeInterpreterId") return DEFAULT_CODE_INTERPRETER_ID;
|
|
20866
|
+
if (attributeName === "Status") return (await this.client.send(new GetCodeInterpreterCommand({ codeInterpreterId: DEFAULT_CODE_INTERPRETER_ID }))).status;
|
|
20867
|
+
throw new Error(`Unsupported attribute: ${attributeName} for AWS::BedrockAgentCore::CodeInterpreter`);
|
|
20868
|
+
}
|
|
20869
|
+
/** No managed properties → nothing can drift. */
|
|
20870
|
+
async readCurrentState() {
|
|
20871
|
+
return {};
|
|
20872
|
+
}
|
|
20873
|
+
/**
|
|
20874
|
+
* Import: the type is a singleton pointing at the AWS-managed default
|
|
20875
|
+
* code interpreter, so auto-lookup is trivial — resolve it live via
|
|
20876
|
+
* `GetCodeInterpreter` (no `--resource` override needed; a supplied
|
|
20877
|
+
* override is ignored in favor of the live ARN, which is the only valid
|
|
20878
|
+
* physical id).
|
|
20879
|
+
*/
|
|
20880
|
+
async import(_input) {
|
|
20881
|
+
const response = await this.client.send(new GetCodeInterpreterCommand({ codeInterpreterId: DEFAULT_CODE_INTERPRETER_ID }));
|
|
20882
|
+
return {
|
|
20883
|
+
physicalId: response.codeInterpreterArn,
|
|
20884
|
+
attributes: {
|
|
20885
|
+
CodeInterpreterArn: response.codeInterpreterArn,
|
|
20886
|
+
CodeInterpreterId: response.codeInterpreterId ?? "aws.codeinterpreter.v1",
|
|
20887
|
+
Status: response.status ?? ""
|
|
20888
|
+
}
|
|
20889
|
+
};
|
|
20890
|
+
}
|
|
20891
|
+
};
|
|
20892
|
+
|
|
20893
|
+
//#endregion
|
|
20894
|
+
//#region src/provisioning/providers/agentcore-evaluator-provider.ts
|
|
20895
|
+
/**
|
|
20896
|
+
* SDK Provider for AWS::BedrockAgentCore::Evaluator
|
|
20897
|
+
*
|
|
20898
|
+
* Provisions custom evaluators (LLM-as-a-Judge or code-based Lambda
|
|
20899
|
+
* configs) for AgentCore quality evaluations via the
|
|
20900
|
+
* `bedrock-agentcore-control` control plane (issue #1058).
|
|
20901
|
+
*
|
|
20902
|
+
* Uses direct SDK calls (`CreateEvaluator` / `UpdateEvaluator` /
|
|
20903
|
+
* `DeleteEvaluator` / `GetEvaluator`) instead of Cloud Control for the same
|
|
20904
|
+
* reasons as the sibling `agentcore-runtime-provider.ts`: synchronous
|
|
20905
|
+
* responses, immediate error surfaces, and no CC-API polling overhead.
|
|
20906
|
+
*
|
|
20907
|
+
* CFn <-> SDK mapping notes (verified against the registry schema and
|
|
20908
|
+
* `@aws-sdk/client-bedrock-agentcore-control` typings):
|
|
20909
|
+
* - The physical id is the Evaluator ARN (the type's primaryIdentifier, so
|
|
20910
|
+
* `Ref` matches CloudFormation); the SDK ops take the evaluator ID, which
|
|
20911
|
+
* is the ARN's final `evaluator/<id>` path segment.
|
|
20912
|
+
* - `EvaluatorConfig` is a union (`LlmAsAJudge` | `CodeBased`) whose member
|
|
20913
|
+
* and field names map 1:1 to the SDK's camelCase shapes — EXCEPT the
|
|
20914
|
+
* free-form `AdditionalModelRequestFields` document, whose inner keys are
|
|
20915
|
+
* model-specific request fields (e.g. `top_k`) and must be passed
|
|
20916
|
+
* verbatim (see `agentcore-case-convert.ts`).
|
|
20917
|
+
* - CFn `Tags` is a `[{Key, Value}]` list; the SDK's create/tag ops take a
|
|
20918
|
+
* `Record<string, string>` map. `UpdateEvaluator` does not accept tags,
|
|
20919
|
+
* so tag changes go through `TagResource` / `UntagResource`.
|
|
20920
|
+
* - `EvaluatorName` is the type's only createOnly property; a name change
|
|
20921
|
+
* is classified as replacement by the deploy engine's registry-schema
|
|
20922
|
+
* createOnly fallback (`create-only-properties.ts`) — no per-provider
|
|
20923
|
+
* replacement logic needed.
|
|
20924
|
+
*/
|
|
20925
|
+
/**
|
|
20926
|
+
* The `EvaluatorConfig` subtree keys whose values are free-form JSON
|
|
20927
|
+
* documents (user/model-defined keys) that must NOT be case-converted.
|
|
20928
|
+
*/
|
|
20929
|
+
const CFN_PRESERVE_KEYS = new Set(["AdditionalModelRequestFields"]);
|
|
20930
|
+
const SDK_PRESERVE_KEYS = new Set(["additionalModelRequestFields"]);
|
|
20931
|
+
/**
|
|
20932
|
+
* Extract the evaluator ID from an evaluator ARN
|
|
20933
|
+
* (`arn:...:evaluator/<id>` → `<id>`). Falls back to the input verbatim
|
|
20934
|
+
* when it does not look like an ARN (already an ID).
|
|
20935
|
+
*/
|
|
20936
|
+
function evaluatorIdFromArn(arnOrId) {
|
|
20937
|
+
const idx = arnOrId.indexOf(":evaluator/");
|
|
20938
|
+
return idx >= 0 ? arnOrId.slice(idx + 11) : arnOrId;
|
|
20939
|
+
}
|
|
20940
|
+
/** CFn `[{Key, Value}]` tag list → SDK `Record<string, string>` map. */
|
|
20941
|
+
function cfnTagListToMap(tags) {
|
|
20942
|
+
const map = {};
|
|
20943
|
+
if (Array.isArray(tags)) {
|
|
20944
|
+
for (const tag of tags) if (tag !== null && typeof tag === "object" && typeof tag["Key"] === "string") map[tag["Key"]] = String(tag["Value"] ?? "");
|
|
20945
|
+
}
|
|
20946
|
+
return map;
|
|
20947
|
+
}
|
|
20948
|
+
/** SDK `Record<string, string>` tag map → CFn `[{Key, Value}]` list. */
|
|
20949
|
+
function tagMapToCfnList(tags) {
|
|
20950
|
+
return Object.entries(tags).map(([Key, Value]) => ({
|
|
20951
|
+
Key,
|
|
20952
|
+
Value
|
|
20953
|
+
}));
|
|
20954
|
+
}
|
|
20955
|
+
/**
|
|
20956
|
+
* AWS BedrockAgentCore Evaluator Provider
|
|
20957
|
+
*/
|
|
20958
|
+
var AgentCoreEvaluatorProvider = class {
|
|
20959
|
+
client;
|
|
20960
|
+
logger = getLogger().child("AgentCoreEvaluatorProvider");
|
|
20961
|
+
handledProperties = new Map([["AWS::BedrockAgentCore::Evaluator", new Set([
|
|
20962
|
+
"EvaluatorName",
|
|
20963
|
+
"Description",
|
|
20964
|
+
"EvaluatorConfig",
|
|
20965
|
+
"Level",
|
|
20966
|
+
"KmsKeyArn",
|
|
20967
|
+
"Tags"
|
|
20968
|
+
])]]);
|
|
20969
|
+
constructor() {
|
|
20970
|
+
const awsClients = getAwsClients();
|
|
20971
|
+
this.client = awsClients.bedrockAgentCoreControl;
|
|
20972
|
+
}
|
|
20973
|
+
/**
|
|
20974
|
+
* Create a BedrockAgentCore Evaluator
|
|
20975
|
+
*/
|
|
20976
|
+
async create(logicalId, resourceType, properties) {
|
|
20977
|
+
this.logger.debug(`Creating BedrockAgentCore Evaluator ${logicalId}`);
|
|
20978
|
+
const evaluatorName = properties["EvaluatorName"];
|
|
20979
|
+
if (!evaluatorName) throw new ProvisioningError(`EvaluatorName is required for ${logicalId}`, resourceType, logicalId);
|
|
20980
|
+
if (properties["EvaluatorConfig"] === void 0) throw new ProvisioningError(`EvaluatorConfig is required for ${logicalId}`, resourceType, logicalId);
|
|
20981
|
+
if (properties["Level"] === void 0) throw new ProvisioningError(`Level is required for ${logicalId}`, resourceType, logicalId);
|
|
20982
|
+
try {
|
|
20983
|
+
const input = {
|
|
20984
|
+
evaluatorName,
|
|
20985
|
+
evaluatorConfig: pascalToCamelCaseKeys(properties["EvaluatorConfig"], CFN_PRESERVE_KEYS),
|
|
20986
|
+
level: properties["Level"]
|
|
20987
|
+
};
|
|
20988
|
+
if (properties["Description"] !== void 0) input["description"] = properties["Description"];
|
|
20989
|
+
if (properties["KmsKeyArn"] !== void 0) input["kmsKeyArn"] = properties["KmsKeyArn"];
|
|
20990
|
+
if (properties["Tags"] !== void 0) {
|
|
20991
|
+
const tags = cfnTagListToMap(properties["Tags"]);
|
|
20992
|
+
if (Object.keys(tags).length > 0) input["tags"] = tags;
|
|
20993
|
+
}
|
|
20994
|
+
const response = await this.client.send(new CreateEvaluatorCommand(input));
|
|
20995
|
+
const evaluatorArn = response.evaluatorArn;
|
|
20996
|
+
const evaluatorId = response.evaluatorId;
|
|
20997
|
+
this.logger.debug(`Created BedrockAgentCore Evaluator: ${evaluatorId} (${evaluatorArn})`);
|
|
20998
|
+
return {
|
|
20999
|
+
physicalId: evaluatorArn,
|
|
21000
|
+
attributes: {
|
|
21001
|
+
EvaluatorArn: evaluatorArn,
|
|
21002
|
+
EvaluatorId: evaluatorId,
|
|
21003
|
+
Status: response.status ?? "",
|
|
21004
|
+
CreatedAt: response.createdAt?.toISOString() ?? ""
|
|
21005
|
+
}
|
|
21006
|
+
};
|
|
21007
|
+
} catch (error) {
|
|
21008
|
+
const cause = error instanceof Error ? error : void 0;
|
|
21009
|
+
throw new ProvisioningError(`Failed to create BedrockAgentCore Evaluator ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
|
|
21010
|
+
}
|
|
21011
|
+
}
|
|
21012
|
+
/**
|
|
21013
|
+
* Update a BedrockAgentCore Evaluator.
|
|
21014
|
+
*
|
|
21015
|
+
* `UpdateEvaluator` covers Description / EvaluatorConfig / Level /
|
|
21016
|
+
* KmsKeyArn; tag changes are applied via TagResource / UntagResource
|
|
21017
|
+
* (the update op does not accept tags). `EvaluatorName` is createOnly —
|
|
21018
|
+
* the deploy engine replaces the resource instead of calling this.
|
|
21019
|
+
*/
|
|
21020
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
21021
|
+
this.logger.debug(`Updating BedrockAgentCore Evaluator ${logicalId}: ${physicalId}`);
|
|
21022
|
+
try {
|
|
21023
|
+
const input = { evaluatorId: evaluatorIdFromArn(physicalId) };
|
|
21024
|
+
if (properties["Description"] !== void 0) input["description"] = properties["Description"];
|
|
21025
|
+
if (properties["EvaluatorConfig"] !== void 0) input["evaluatorConfig"] = pascalToCamelCaseKeys(properties["EvaluatorConfig"], CFN_PRESERVE_KEYS);
|
|
21026
|
+
if (properties["Level"] !== void 0) input["level"] = properties["Level"];
|
|
21027
|
+
if (properties["KmsKeyArn"] !== void 0) input["kmsKeyArn"] = properties["KmsKeyArn"];
|
|
21028
|
+
const response = await this.client.send(new UpdateEvaluatorCommand(input));
|
|
21029
|
+
await this.syncTags(physicalId, properties["Tags"], previousProperties["Tags"]);
|
|
21030
|
+
const evaluatorArn = response.evaluatorArn ?? physicalId;
|
|
21031
|
+
this.logger.debug(`Successfully updated BedrockAgentCore Evaluator ${logicalId}`);
|
|
21032
|
+
return {
|
|
21033
|
+
physicalId: evaluatorArn,
|
|
21034
|
+
wasReplaced: false,
|
|
21035
|
+
attributes: {
|
|
21036
|
+
EvaluatorArn: evaluatorArn,
|
|
21037
|
+
EvaluatorId: response.evaluatorId ?? evaluatorIdFromArn(evaluatorArn),
|
|
21038
|
+
Status: response.status ?? "",
|
|
21039
|
+
UpdatedAt: response.updatedAt?.toISOString() ?? ""
|
|
21040
|
+
}
|
|
21041
|
+
};
|
|
21042
|
+
} catch (error) {
|
|
21043
|
+
const cause = error instanceof Error ? error : void 0;
|
|
21044
|
+
throw new ProvisioningError(`Failed to update BedrockAgentCore Evaluator ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
21045
|
+
}
|
|
21046
|
+
}
|
|
21047
|
+
/**
|
|
21048
|
+
* Apply CFn tag-list changes via TagResource / UntagResource.
|
|
21049
|
+
*/
|
|
21050
|
+
async syncTags(evaluatorArn, nextTagsRaw, previousTagsRaw) {
|
|
21051
|
+
const nextTags = cfnTagListToMap(nextTagsRaw);
|
|
21052
|
+
const previousTags = cfnTagListToMap(previousTagsRaw);
|
|
21053
|
+
const removedKeys = Object.keys(previousTags).filter((key) => !(key in nextTags));
|
|
21054
|
+
const upserts = {};
|
|
21055
|
+
for (const [key, value] of Object.entries(nextTags)) if (previousTags[key] !== value) upserts[key] = value;
|
|
21056
|
+
if (removedKeys.length > 0) await this.client.send(new UntagResourceCommand$9({
|
|
21057
|
+
resourceArn: evaluatorArn,
|
|
21058
|
+
tagKeys: removedKeys
|
|
21059
|
+
}));
|
|
21060
|
+
if (Object.keys(upserts).length > 0) await this.client.send(new TagResourceCommand$9({
|
|
21061
|
+
resourceArn: evaluatorArn,
|
|
21062
|
+
tags: upserts
|
|
21063
|
+
}));
|
|
21064
|
+
}
|
|
21065
|
+
/**
|
|
21066
|
+
* Delete a BedrockAgentCore Evaluator
|
|
21067
|
+
*/
|
|
21068
|
+
async delete(logicalId, physicalId, resourceType, _properties, context) {
|
|
21069
|
+
this.logger.debug(`Deleting BedrockAgentCore Evaluator ${logicalId}: ${physicalId}`);
|
|
21070
|
+
try {
|
|
21071
|
+
await this.client.send(new DeleteEvaluatorCommand({ evaluatorId: evaluatorIdFromArn(physicalId) }));
|
|
21072
|
+
this.logger.debug(`Successfully deleted BedrockAgentCore Evaluator ${logicalId}`);
|
|
21073
|
+
} catch (error) {
|
|
21074
|
+
if (error instanceof ResourceNotFoundException$5) {
|
|
21075
|
+
assertRegionMatch(await this.client.config.region(), context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
21076
|
+
this.logger.debug(`Evaluator ${physicalId} does not exist, skipping deletion`);
|
|
21077
|
+
return;
|
|
21078
|
+
}
|
|
21079
|
+
const cause = error instanceof Error ? error : void 0;
|
|
21080
|
+
throw new ProvisioningError(`Failed to delete BedrockAgentCore Evaluator ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
21081
|
+
}
|
|
21082
|
+
}
|
|
21083
|
+
/**
|
|
21084
|
+
* Get resource attribute (for Fn::GetAtt resolution). The CFn read-only
|
|
21085
|
+
* attribute set is EvaluatorArn / EvaluatorId / Status / CreatedAt /
|
|
21086
|
+
* UpdatedAt.
|
|
21087
|
+
*/
|
|
21088
|
+
async getAttribute(physicalId, _resourceType, attributeName) {
|
|
21089
|
+
if (attributeName === "EvaluatorArn") return physicalId;
|
|
21090
|
+
if (attributeName === "EvaluatorId") return evaluatorIdFromArn(physicalId);
|
|
21091
|
+
if (attributeName === "Status" || attributeName === "CreatedAt" || attributeName === "UpdatedAt") {
|
|
21092
|
+
const response = await this.client.send(new GetEvaluatorCommand({ evaluatorId: evaluatorIdFromArn(physicalId) }));
|
|
21093
|
+
if (attributeName === "Status") return response.status;
|
|
21094
|
+
if (attributeName === "CreatedAt") return response.createdAt?.toISOString();
|
|
21095
|
+
return response.updatedAt?.toISOString();
|
|
21096
|
+
}
|
|
21097
|
+
throw new Error(`Unsupported attribute: ${attributeName} for AWS::BedrockAgentCore::Evaluator`);
|
|
21098
|
+
}
|
|
21099
|
+
/**
|
|
21100
|
+
* Read the AWS-current Evaluator configuration in CFn-property shape.
|
|
21101
|
+
*
|
|
21102
|
+
* Issues `GetEvaluator` + `ListTagsForResource` and surfaces the keys
|
|
21103
|
+
* `create()` accepts, re-shaped to PascalCase (the free-form
|
|
21104
|
+
* `additionalModelRequestFields` document is passed through verbatim).
|
|
21105
|
+
* Returns `undefined` when the evaluator is gone
|
|
21106
|
+
* (`ResourceNotFoundException`).
|
|
21107
|
+
*/
|
|
21108
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
21109
|
+
let resp;
|
|
21110
|
+
try {
|
|
21111
|
+
resp = await this.client.send(new GetEvaluatorCommand({ evaluatorId: evaluatorIdFromArn(physicalId) }));
|
|
21112
|
+
} catch (err) {
|
|
21113
|
+
if (err instanceof ResourceNotFoundException$5) return void 0;
|
|
21114
|
+
throw err;
|
|
21115
|
+
}
|
|
21116
|
+
const result = {};
|
|
21117
|
+
if (resp.evaluatorName !== void 0) result["EvaluatorName"] = resp.evaluatorName;
|
|
21118
|
+
result["Description"] = resp.description ?? "";
|
|
21119
|
+
if (resp.evaluatorConfig !== void 0) result["EvaluatorConfig"] = camelToPascalCaseKeys(resp.evaluatorConfig, SDK_PRESERVE_KEYS);
|
|
21120
|
+
if (resp.level !== void 0) result["Level"] = resp.level;
|
|
21121
|
+
if (resp.kmsKeyArn !== void 0) result["KmsKeyArn"] = resp.kmsKeyArn;
|
|
21122
|
+
try {
|
|
21123
|
+
result["Tags"] = tagMapToCfnList((await this.client.send(new ListTagsForResourceCommand$6({ resourceArn: physicalId }))).tags ?? {});
|
|
21124
|
+
} catch (err) {
|
|
21125
|
+
this.logger.debug(`Failed to read tags for evaluator ${physicalId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
21126
|
+
}
|
|
21127
|
+
return result;
|
|
21128
|
+
}
|
|
21129
|
+
/**
|
|
21130
|
+
* Adopt an existing BedrockAgentCore Evaluator into cdkd state.
|
|
21131
|
+
*
|
|
21132
|
+
* **Explicit override only.** Pass `--resource <logicalId>=<value>` where
|
|
21133
|
+
* `<value>` is the evaluator ARN or the bare evaluator ID; an ID is
|
|
21134
|
+
* resolved to the canonical ARN (the physical id shape `create()`
|
|
21135
|
+
* records) via `GetEvaluator`.
|
|
21136
|
+
*/
|
|
21137
|
+
async import(input) {
|
|
21138
|
+
if (!input.knownPhysicalId) return null;
|
|
21139
|
+
if (input.knownPhysicalId.includes(":evaluator/")) return {
|
|
21140
|
+
physicalId: input.knownPhysicalId,
|
|
21141
|
+
attributes: {
|
|
21142
|
+
EvaluatorArn: input.knownPhysicalId,
|
|
21143
|
+
EvaluatorId: evaluatorIdFromArn(input.knownPhysicalId)
|
|
21144
|
+
}
|
|
21145
|
+
};
|
|
21146
|
+
const response = await this.client.send(new GetEvaluatorCommand({ evaluatorId: input.knownPhysicalId }));
|
|
21147
|
+
return {
|
|
21148
|
+
physicalId: response.evaluatorArn,
|
|
21149
|
+
attributes: {
|
|
21150
|
+
EvaluatorArn: response.evaluatorArn,
|
|
21151
|
+
EvaluatorId: response.evaluatorId ?? input.knownPhysicalId
|
|
21152
|
+
}
|
|
21153
|
+
};
|
|
21154
|
+
}
|
|
21155
|
+
};
|
|
21156
|
+
|
|
20630
21157
|
//#endregion
|
|
20631
21158
|
//#region src/provisioning/providers/stepfunctions-provider.ts
|
|
20632
21159
|
/**
|
|
@@ -20823,7 +21350,7 @@ var StepFunctionsProvider = class {
|
|
|
20823
21350
|
result["EncryptionConfiguration"] = ec;
|
|
20824
21351
|
}
|
|
20825
21352
|
try {
|
|
20826
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
21353
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$11({ resourceArn: physicalId }))).tags);
|
|
20827
21354
|
} catch (err) {
|
|
20828
21355
|
if (!(err instanceof StateMachineDoesNotExist)) throw err;
|
|
20829
21356
|
}
|
|
@@ -20861,7 +21388,7 @@ var StepFunctionsProvider = class {
|
|
|
20861
21388
|
const list = await this.getClient().send(new ListStateMachinesCommand({ ...nextToken && { nextToken } }));
|
|
20862
21389
|
for (const sm of list.stateMachines ?? []) {
|
|
20863
21390
|
if (!sm.stateMachineArn) continue;
|
|
20864
|
-
const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$
|
|
21391
|
+
const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$11({ resourceArn: sm.stateMachineArn }));
|
|
20865
21392
|
if (this.tagsMatchCdkPath(tagsResp.tags, input.cdkPath)) return {
|
|
20866
21393
|
physicalId: sm.stateMachineArn,
|
|
20867
21394
|
attributes: {}
|
|
@@ -20892,14 +21419,14 @@ var StepFunctionsProvider = class {
|
|
|
20892
21419
|
const tagsToRemove = [];
|
|
20893
21420
|
for (const k of oldMap.keys()) if (!newMap.has(k)) tagsToRemove.push(k);
|
|
20894
21421
|
if (tagsToRemove.length > 0) {
|
|
20895
|
-
await this.getClient().send(new UntagResourceCommand$
|
|
21422
|
+
await this.getClient().send(new UntagResourceCommand$12({
|
|
20896
21423
|
resourceArn: stateMachineArn,
|
|
20897
21424
|
tagKeys: tagsToRemove
|
|
20898
21425
|
}));
|
|
20899
21426
|
this.logger.debug(`Removed ${tagsToRemove.length} tag(s) from SFN state machine ${stateMachineArn}`);
|
|
20900
21427
|
}
|
|
20901
21428
|
if (tagsToAdd.length > 0) {
|
|
20902
|
-
await this.getClient().send(new TagResourceCommand$
|
|
21429
|
+
await this.getClient().send(new TagResourceCommand$12({
|
|
20903
21430
|
resourceArn: stateMachineArn,
|
|
20904
21431
|
tags: tagsToAdd
|
|
20905
21432
|
}));
|
|
@@ -21519,14 +22046,14 @@ var ECSProvider = class {
|
|
|
21519
22046
|
const tagsToRemove = [];
|
|
21520
22047
|
for (const k of oldMap.keys()) if (!newMap.has(k)) tagsToRemove.push(k);
|
|
21521
22048
|
if (tagsToRemove.length > 0) {
|
|
21522
|
-
await this.getClient().send(new UntagResourceCommand$
|
|
22049
|
+
await this.getClient().send(new UntagResourceCommand$13({
|
|
21523
22050
|
resourceArn,
|
|
21524
22051
|
tagKeys: tagsToRemove
|
|
21525
22052
|
}));
|
|
21526
22053
|
this.logger.debug(`Removed ${tagsToRemove.length} tag(s) from ECS resource ${resourceArn}`);
|
|
21527
22054
|
}
|
|
21528
22055
|
if (tagsToAdd.length > 0) {
|
|
21529
|
-
await this.getClient().send(new TagResourceCommand$
|
|
22056
|
+
await this.getClient().send(new TagResourceCommand$13({
|
|
21530
22057
|
resourceArn,
|
|
21531
22058
|
tags: tagsToAdd
|
|
21532
22059
|
}));
|
|
@@ -22097,7 +22624,7 @@ var ECSProvider = class {
|
|
|
22097
22624
|
do {
|
|
22098
22625
|
const list = await this.getClient().send(new ListClustersCommand({ ...nextToken && { nextToken } }));
|
|
22099
22626
|
for (const arn of list.clusterArns ?? []) {
|
|
22100
|
-
const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$
|
|
22627
|
+
const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$12({ resourceArn: arn }));
|
|
22101
22628
|
if (this.tagsMatchCdkPath(tagsResp.tags, input.cdkPath)) return {
|
|
22102
22629
|
physicalId: arn.substring(arn.lastIndexOf("/") + 1),
|
|
22103
22630
|
attributes: {}
|
|
@@ -22124,7 +22651,7 @@ var ECSProvider = class {
|
|
|
22124
22651
|
...svcToken && { nextToken: svcToken }
|
|
22125
22652
|
}));
|
|
22126
22653
|
for (const svcArn of svcList.serviceArns ?? []) {
|
|
22127
|
-
const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$
|
|
22654
|
+
const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$12({ resourceArn: svcArn }));
|
|
22128
22655
|
if (this.tagsMatchCdkPath(tagsResp.tags, input.cdkPath)) return {
|
|
22129
22656
|
physicalId: `${clusterArn}|${svcArn.substring(svcArn.lastIndexOf("/") + 1)}`,
|
|
22130
22657
|
attributes: {}
|
|
@@ -23622,7 +24149,7 @@ var RDSProvider = class {
|
|
|
23622
24149
|
*/
|
|
23623
24150
|
async attachTags(result, arn) {
|
|
23624
24151
|
try {
|
|
23625
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
24152
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$9({ ResourceName: arn }))).TagList);
|
|
23626
24153
|
} catch (err) {
|
|
23627
24154
|
this.logger.debug(`RDS ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
23628
24155
|
}
|
|
@@ -23645,7 +24172,7 @@ var RDSProvider = class {
|
|
|
23645
24172
|
const list = await this.getClient().send(new DescribeDBInstancesCommand({ ...marker && { Marker: marker } }));
|
|
23646
24173
|
for (const inst of list.DBInstances ?? []) {
|
|
23647
24174
|
if (!inst.DBInstanceIdentifier || !inst.DBInstanceArn) continue;
|
|
23648
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
24175
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$9({ ResourceName: inst.DBInstanceArn }))).TagList, input.cdkPath)) return {
|
|
23649
24176
|
physicalId: inst.DBInstanceIdentifier,
|
|
23650
24177
|
attributes: {}
|
|
23651
24178
|
};
|
|
@@ -23672,7 +24199,7 @@ var RDSProvider = class {
|
|
|
23672
24199
|
const list = await this.getClient().send(new DescribeDBClustersCommand({ ...marker && { Marker: marker } }));
|
|
23673
24200
|
for (const c of list.DBClusters ?? []) {
|
|
23674
24201
|
if (!c.DBClusterIdentifier || !c.DBClusterArn) continue;
|
|
23675
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
24202
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$9({ ResourceName: c.DBClusterArn }))).TagList, input.cdkPath)) return {
|
|
23676
24203
|
physicalId: c.DBClusterIdentifier,
|
|
23677
24204
|
attributes: {}
|
|
23678
24205
|
};
|
|
@@ -23699,7 +24226,7 @@ var RDSProvider = class {
|
|
|
23699
24226
|
const list = await this.getClient().send(new DescribeDBSubnetGroupsCommand({ ...marker && { Marker: marker } }));
|
|
23700
24227
|
for (const sg of list.DBSubnetGroups ?? []) {
|
|
23701
24228
|
if (!sg.DBSubnetGroupName || !sg.DBSubnetGroupArn) continue;
|
|
23702
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
24229
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$9({ ResourceName: sg.DBSubnetGroupArn }))).TagList, input.cdkPath)) return {
|
|
23703
24230
|
physicalId: sg.DBSubnetGroupName,
|
|
23704
24231
|
attributes: {}
|
|
23705
24232
|
};
|
|
@@ -23929,7 +24456,7 @@ var RDSDBProxyProvider = class {
|
|
|
23929
24456
|
for (const proxy of describe.DBProxies ?? []) {
|
|
23930
24457
|
if (!proxy.DBProxyArn) continue;
|
|
23931
24458
|
try {
|
|
23932
|
-
if (matchesCdkPath((await client.send(new ListTagsForResourceCommand$
|
|
24459
|
+
if (matchesCdkPath((await client.send(new ListTagsForResourceCommand$9({ ResourceName: proxy.DBProxyArn }))).TagList ?? [], input.cdkPath)) return this.buildImportResult(proxy.DBProxyName ?? "");
|
|
23933
24460
|
} catch (error) {
|
|
23934
24461
|
this.logger.debug(`ListTagsForResource failed for ${proxy.DBProxyName}: ${error instanceof Error ? error.message : String(error)}`);
|
|
23935
24462
|
}
|
|
@@ -23972,7 +24499,7 @@ var RDSDBProxyProvider = class {
|
|
|
23972
24499
|
}))
|
|
23973
24500
|
};
|
|
23974
24501
|
if (p.DBProxyArn) try {
|
|
23975
|
-
result["Tags"] = normalizeAwsTagsToCfn((await client.send(new ListTagsForResourceCommand$
|
|
24502
|
+
result["Tags"] = normalizeAwsTagsToCfn((await client.send(new ListTagsForResourceCommand$9({ ResourceName: p.DBProxyArn }))).TagList ?? []);
|
|
23976
24503
|
} catch (error) {
|
|
23977
24504
|
this.logger.debug(`ListTagsForResource failed for ${physicalId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
23978
24505
|
result["Tags"] = [];
|
|
@@ -24271,7 +24798,7 @@ var RDSDBProxyEndpointProvider = class {
|
|
|
24271
24798
|
for (const ep of describe.DBProxyEndpoints ?? []) {
|
|
24272
24799
|
if (!ep.DBProxyEndpointArn) continue;
|
|
24273
24800
|
try {
|
|
24274
|
-
if (matchesCdkPath((await client.send(new ListTagsForResourceCommand$
|
|
24801
|
+
if (matchesCdkPath((await client.send(new ListTagsForResourceCommand$9({ ResourceName: ep.DBProxyEndpointArn }))).TagList ?? [], input.cdkPath)) return this.buildImportResult(ep.DBProxyEndpointName ?? "");
|
|
24275
24802
|
} catch (error) {
|
|
24276
24803
|
this.logger.debug(`ListTagsForResource failed for ${ep.DBProxyEndpointName}: ${error instanceof Error ? error.message : String(error)}`);
|
|
24277
24804
|
}
|
|
@@ -24299,7 +24826,7 @@ var RDSDBProxyEndpointProvider = class {
|
|
|
24299
24826
|
TargetRole: e.TargetRole ?? "READ_WRITE"
|
|
24300
24827
|
};
|
|
24301
24828
|
if (e.DBProxyEndpointArn) try {
|
|
24302
|
-
result["Tags"] = normalizeAwsTagsToCfn((await client.send(new ListTagsForResourceCommand$
|
|
24829
|
+
result["Tags"] = normalizeAwsTagsToCfn((await client.send(new ListTagsForResourceCommand$9({ ResourceName: e.DBProxyEndpointArn }))).TagList ?? []);
|
|
24303
24830
|
} catch (error) {
|
|
24304
24831
|
this.logger.debug(`ListTagsForResource failed for ${physicalId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
24305
24832
|
result["Tags"] = [];
|
|
@@ -25268,7 +25795,7 @@ var DocDBProvider = class {
|
|
|
25268
25795
|
*/
|
|
25269
25796
|
async attachTags(result, arn) {
|
|
25270
25797
|
try {
|
|
25271
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
25798
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$13({ ResourceName: arn }))).TagList);
|
|
25272
25799
|
} catch (err) {
|
|
25273
25800
|
this.logger.debug(`DocDB ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
25274
25801
|
}
|
|
@@ -25291,7 +25818,7 @@ var DocDBProvider = class {
|
|
|
25291
25818
|
const list = await this.getClient().send(new DescribeDBInstancesCommand$1({ ...marker && { Marker: marker } }));
|
|
25292
25819
|
for (const inst of list.DBInstances ?? []) {
|
|
25293
25820
|
if (!inst.DBInstanceIdentifier || !inst.DBInstanceArn) continue;
|
|
25294
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
25821
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$13({ ResourceName: inst.DBInstanceArn }))).TagList, input.cdkPath)) return {
|
|
25295
25822
|
physicalId: inst.DBInstanceIdentifier,
|
|
25296
25823
|
attributes: {}
|
|
25297
25824
|
};
|
|
@@ -25318,7 +25845,7 @@ var DocDBProvider = class {
|
|
|
25318
25845
|
const list = await this.getClient().send(new DescribeDBClustersCommand$1({ ...marker && { Marker: marker } }));
|
|
25319
25846
|
for (const c of list.DBClusters ?? []) {
|
|
25320
25847
|
if (!c.DBClusterIdentifier || !c.DBClusterArn) continue;
|
|
25321
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
25848
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$13({ ResourceName: c.DBClusterArn }))).TagList, input.cdkPath)) return {
|
|
25322
25849
|
physicalId: c.DBClusterIdentifier,
|
|
25323
25850
|
attributes: {}
|
|
25324
25851
|
};
|
|
@@ -25345,7 +25872,7 @@ var DocDBProvider = class {
|
|
|
25345
25872
|
const list = await this.getClient().send(new DescribeDBSubnetGroupsCommand$1({ ...marker && { Marker: marker } }));
|
|
25346
25873
|
for (const sg of list.DBSubnetGroups ?? []) {
|
|
25347
25874
|
if (!sg.DBSubnetGroupName || !sg.DBSubnetGroupArn) continue;
|
|
25348
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
25875
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$13({ ResourceName: sg.DBSubnetGroupArn }))).TagList, input.cdkPath)) return {
|
|
25349
25876
|
physicalId: sg.DBSubnetGroupName,
|
|
25350
25877
|
attributes: {}
|
|
25351
25878
|
};
|
|
@@ -25938,7 +26465,7 @@ var NeptuneProvider = class {
|
|
|
25938
26465
|
*/
|
|
25939
26466
|
async attachTags(result, arn) {
|
|
25940
26467
|
try {
|
|
25941
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
26468
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$14({ ResourceName: arn }))).TagList);
|
|
25942
26469
|
} catch (err) {
|
|
25943
26470
|
this.logger.debug(`Neptune ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
25944
26471
|
}
|
|
@@ -25961,7 +26488,7 @@ var NeptuneProvider = class {
|
|
|
25961
26488
|
const list = await this.getClient().send(new DescribeDBInstancesCommand$2({ ...marker && { Marker: marker } }));
|
|
25962
26489
|
for (const inst of list.DBInstances ?? []) {
|
|
25963
26490
|
if (!inst.DBInstanceIdentifier || !inst.DBInstanceArn) continue;
|
|
25964
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
26491
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$14({ ResourceName: inst.DBInstanceArn }))).TagList, input.cdkPath)) return {
|
|
25965
26492
|
physicalId: inst.DBInstanceIdentifier,
|
|
25966
26493
|
attributes: {}
|
|
25967
26494
|
};
|
|
@@ -25988,7 +26515,7 @@ var NeptuneProvider = class {
|
|
|
25988
26515
|
const list = await this.getClient().send(new DescribeDBClustersCommand$2({ ...marker && { Marker: marker } }));
|
|
25989
26516
|
for (const c of list.DBClusters ?? []) {
|
|
25990
26517
|
if (!c.DBClusterIdentifier || !c.DBClusterArn) continue;
|
|
25991
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
26518
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$14({ ResourceName: c.DBClusterArn }))).TagList, input.cdkPath)) return {
|
|
25992
26519
|
physicalId: c.DBClusterIdentifier,
|
|
25993
26520
|
attributes: {}
|
|
25994
26521
|
};
|
|
@@ -26015,7 +26542,7 @@ var NeptuneProvider = class {
|
|
|
26015
26542
|
const list = await this.getClient().send(new DescribeDBSubnetGroupsCommand$2({ ...marker && { Marker: marker } }));
|
|
26016
26543
|
for (const sg of list.DBSubnetGroups ?? []) {
|
|
26017
26544
|
if (!sg.DBSubnetGroupName || !sg.DBSubnetGroupArn) continue;
|
|
26018
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
26545
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$14({ ResourceName: sg.DBSubnetGroupArn }))).TagList, input.cdkPath)) return {
|
|
26019
26546
|
physicalId: sg.DBSubnetGroupName,
|
|
26020
26547
|
attributes: {}
|
|
26021
26548
|
};
|
|
@@ -26641,7 +27168,7 @@ var Route53Provider = class {
|
|
|
26641
27168
|
});
|
|
26642
27169
|
const idTail = physicalId.replace(/^\/hostedzone\//, "");
|
|
26643
27170
|
try {
|
|
26644
|
-
result["HostedZoneTags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
27171
|
+
result["HostedZoneTags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$7({
|
|
26645
27172
|
ResourceType: "hostedzone",
|
|
26646
27173
|
ResourceId: idTail
|
|
26647
27174
|
}))).ResourceTagSet?.Tags);
|
|
@@ -26766,7 +27293,7 @@ var Route53Provider = class {
|
|
|
26766
27293
|
if (!zone.Id) continue;
|
|
26767
27294
|
const zoneId = zone.Id.replace("/hostedzone/", "");
|
|
26768
27295
|
try {
|
|
26769
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
27296
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$7({
|
|
26770
27297
|
ResourceType: "hostedzone",
|
|
26771
27298
|
ResourceId: zoneId
|
|
26772
27299
|
}))).ResourceTagSet?.Tags, input.cdkPath)) return {
|
|
@@ -27338,7 +27865,7 @@ var CognitoUserPoolProvider = class {
|
|
|
27338
27865
|
if (input.cdkPath) try {
|
|
27339
27866
|
const arn = (await this.getClient().send(new DescribeUserPoolCommand({ UserPoolId: pool.Id }))).UserPool?.Arn;
|
|
27340
27867
|
if (!arn) continue;
|
|
27341
|
-
if ((await this.getClient().send(new ListTagsForResourceCommand$
|
|
27868
|
+
if ((await this.getClient().send(new ListTagsForResourceCommand$15({ ResourceArn: arn }))).Tags?.["aws:cdk:path"] === input.cdkPath) return {
|
|
27342
27869
|
physicalId: pool.Id,
|
|
27343
27870
|
attributes: {}
|
|
27344
27871
|
};
|
|
@@ -27776,7 +28303,7 @@ var ElastiCacheProvider = class {
|
|
|
27776
28303
|
/** Best-effort tag fetch — failures omit the key without breaking the read. */
|
|
27777
28304
|
async attachTags(result, arn) {
|
|
27778
28305
|
try {
|
|
27779
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
28306
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$10({ ResourceName: arn }))).TagList);
|
|
27780
28307
|
} catch (err) {
|
|
27781
28308
|
this.logger.debug(`ElastiCache ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
27782
28309
|
}
|
|
@@ -27822,7 +28349,7 @@ var ElastiCacheProvider = class {
|
|
|
27822
28349
|
for (const c of list.CacheClusters ?? []) {
|
|
27823
28350
|
if (!c.CacheClusterId) continue;
|
|
27824
28351
|
const arn = c.ARN ?? await this.buildClusterArn(c.CacheClusterId);
|
|
27825
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
28352
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$10({ ResourceName: arn }))).TagList, input.cdkPath)) return {
|
|
27826
28353
|
physicalId: c.CacheClusterId,
|
|
27827
28354
|
attributes: {}
|
|
27828
28355
|
};
|
|
@@ -27850,7 +28377,7 @@ var ElastiCacheProvider = class {
|
|
|
27850
28377
|
for (const g of list.CacheSubnetGroups ?? []) {
|
|
27851
28378
|
if (!g.CacheSubnetGroupName) continue;
|
|
27852
28379
|
const arn = g.ARN ?? await this.buildSubnetGroupArn(g.CacheSubnetGroupName);
|
|
27853
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
28380
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$10({ ResourceName: arn }))).TagList, input.cdkPath)) return {
|
|
27854
28381
|
physicalId: g.CacheSubnetGroupName,
|
|
27855
28382
|
attributes: {}
|
|
27856
28383
|
};
|
|
@@ -28403,11 +28930,11 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
|
|
|
28403
28930
|
const hasAdds = !!newTags && newTags.length > 0;
|
|
28404
28931
|
if (removedKeys.length === 0 && !hasAdds) return;
|
|
28405
28932
|
const arn = await this.resolveNamespaceArn(physicalId);
|
|
28406
|
-
if (removedKeys.length > 0) await this.getClient().send(new UntagResourceCommand$
|
|
28933
|
+
if (removedKeys.length > 0) await this.getClient().send(new UntagResourceCommand$14({
|
|
28407
28934
|
ResourceARN: arn,
|
|
28408
28935
|
TagKeys: removedKeys
|
|
28409
28936
|
}));
|
|
28410
|
-
if (hasAdds) await this.getClient().send(new TagResourceCommand$
|
|
28937
|
+
if (hasAdds) await this.getClient().send(new TagResourceCommand$14({
|
|
28411
28938
|
ResourceARN: arn,
|
|
28412
28939
|
Tags: newTags
|
|
28413
28940
|
}));
|
|
@@ -28595,7 +29122,7 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
|
|
|
28595
29122
|
/** Best-effort tag fetch via `ListTagsForResource(ResourceARN)`. */
|
|
28596
29123
|
async attachTags(result, arn) {
|
|
28597
29124
|
try {
|
|
28598
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
29125
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$16({ ResourceARN: arn }))).Tags);
|
|
28599
29126
|
} catch (err) {
|
|
28600
29127
|
this.logger.debug(`ServiceDiscovery ListTagsForResource(${arn}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
28601
29128
|
}
|
|
@@ -28648,7 +29175,7 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
|
|
|
28648
29175
|
attributes: {}
|
|
28649
29176
|
};
|
|
28650
29177
|
if (input.cdkPath) try {
|
|
28651
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
29178
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$16({ ResourceARN: ns.Arn }))).Tags, input.cdkPath)) return {
|
|
28652
29179
|
physicalId: ns.Id,
|
|
28653
29180
|
attributes: {}
|
|
28654
29181
|
};
|
|
@@ -28679,7 +29206,7 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
|
|
|
28679
29206
|
for (const svc of list.Services ?? []) {
|
|
28680
29207
|
if (!svc.Id || !svc.Arn) continue;
|
|
28681
29208
|
try {
|
|
28682
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
29209
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$16({ ResourceARN: svc.Arn }))).Tags, input.cdkPath)) return {
|
|
28683
29210
|
physicalId: svc.Id,
|
|
28684
29211
|
attributes: {}
|
|
28685
29212
|
};
|
|
@@ -29069,7 +29596,7 @@ var AppSyncProvider = class {
|
|
|
29069
29596
|
const tagsToAdd = {};
|
|
29070
29597
|
for (const [k, v] of Object.entries(newMap)) if (oldMap[k] !== v) tagsToAdd[k] = v;
|
|
29071
29598
|
if (tagKeysToRemove.length > 0) try {
|
|
29072
|
-
await this.getClient().send(new UntagResourceCommand$
|
|
29599
|
+
await this.getClient().send(new UntagResourceCommand$15({
|
|
29073
29600
|
resourceArn: arn,
|
|
29074
29601
|
tagKeys: tagKeysToRemove
|
|
29075
29602
|
}));
|
|
@@ -29077,7 +29604,7 @@ var AppSyncProvider = class {
|
|
|
29077
29604
|
throw this.wrapUpdateError(error, resourceType, logicalId, apiId, "GraphqlApi (untag)");
|
|
29078
29605
|
}
|
|
29079
29606
|
if (Object.keys(tagsToAdd).length > 0) try {
|
|
29080
|
-
await this.getClient().send(new TagResourceCommand$
|
|
29607
|
+
await this.getClient().send(new TagResourceCommand$15({
|
|
29081
29608
|
resourceArn: arn,
|
|
29082
29609
|
tags: tagsToAdd
|
|
29083
29610
|
}));
|
|
@@ -31630,14 +32157,14 @@ var KMSProvider = class {
|
|
|
31630
32157
|
const tagsToRemove = [];
|
|
31631
32158
|
for (const k of oldMap.keys()) if (!newMap.has(k)) tagsToRemove.push(k);
|
|
31632
32159
|
if (tagsToRemove.length > 0) {
|
|
31633
|
-
await this.getClient().send(new UntagResourceCommand$
|
|
32160
|
+
await this.getClient().send(new UntagResourceCommand$10({
|
|
31634
32161
|
KeyId: keyId,
|
|
31635
32162
|
TagKeys: tagsToRemove
|
|
31636
32163
|
}));
|
|
31637
32164
|
this.logger.debug(`Removed ${tagsToRemove.length} tag(s) from KMS Key ${keyId}`);
|
|
31638
32165
|
}
|
|
31639
32166
|
if (tagsToAdd.length > 0) {
|
|
31640
|
-
await this.getClient().send(new TagResourceCommand$
|
|
32167
|
+
await this.getClient().send(new TagResourceCommand$10({
|
|
31641
32168
|
KeyId: keyId,
|
|
31642
32169
|
Tags: tagsToAdd
|
|
31643
32170
|
}));
|
|
@@ -32252,11 +32779,11 @@ var BudgetsBudgetProvider = class {
|
|
|
32252
32779
|
const removedKeys = oldTags.map((t) => t.Key).filter((k) => {
|
|
32253
32780
|
return typeof k === "string" && !newKeys.has(k);
|
|
32254
32781
|
});
|
|
32255
|
-
if (removedKeys.length > 0) await this.getClient().send(new UntagResourceCommand$
|
|
32782
|
+
if (removedKeys.length > 0) await this.getClient().send(new UntagResourceCommand$16({
|
|
32256
32783
|
ResourceARN: arn,
|
|
32257
32784
|
ResourceTagKeys: removedKeys
|
|
32258
32785
|
}));
|
|
32259
|
-
if (newTags.length > 0) await this.getClient().send(new TagResourceCommand$
|
|
32786
|
+
if (newTags.length > 0) await this.getClient().send(new TagResourceCommand$16({
|
|
32260
32787
|
ResourceARN: arn,
|
|
32261
32788
|
ResourceTags: newTags
|
|
32262
32789
|
}));
|
|
@@ -32344,7 +32871,7 @@ var BudgetsBudgetProvider = class {
|
|
|
32344
32871
|
}));
|
|
32345
32872
|
for (const budget of list.Budgets ?? []) {
|
|
32346
32873
|
if (!budget.BudgetName) continue;
|
|
32347
|
-
if (matchesCdkPath((await client.send(new ListTagsForResourceCommand$
|
|
32874
|
+
if (matchesCdkPath((await client.send(new ListTagsForResourceCommand$17({ ResourceARN: this.budgetArn(accountId, budget.BudgetName) }))).ResourceTags, input.cdkPath)) return {
|
|
32348
32875
|
physicalId: budget.BudgetName,
|
|
32349
32876
|
attributes: { Arn: this.budgetArn(accountId, budget.BudgetName) }
|
|
32350
32877
|
};
|
|
@@ -32915,7 +33442,7 @@ var KinesisStreamConsumerProvider = class {
|
|
|
32915
33442
|
if (desc.ConsumerName !== void 0) result["ConsumerName"] = desc.ConsumerName;
|
|
32916
33443
|
if (desc.StreamARN !== void 0) result["StreamARN"] = desc.StreamARN;
|
|
32917
33444
|
try {
|
|
32918
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
33445
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$18({ ResourceARN: physicalId }))).Tags);
|
|
32919
33446
|
} catch (err) {
|
|
32920
33447
|
if (err instanceof ResourceNotFoundException$8) return void 0;
|
|
32921
33448
|
this.logger.debug(`ListTagsForResource(${physicalId}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -32939,14 +33466,14 @@ var KinesisStreamConsumerProvider = class {
|
|
|
32939
33466
|
const tagsToRemove = [];
|
|
32940
33467
|
for (const k of Object.keys(oldMap)) if (!(k in newMap)) tagsToRemove.push(k);
|
|
32941
33468
|
if (tagsToRemove.length > 0) {
|
|
32942
|
-
await this.getClient().send(new UntagResourceCommand$
|
|
33469
|
+
await this.getClient().send(new UntagResourceCommand$17({
|
|
32943
33470
|
ResourceARN: consumerArn,
|
|
32944
33471
|
TagKeys: tagsToRemove
|
|
32945
33472
|
}));
|
|
32946
33473
|
this.logger.debug(`Removed ${tagsToRemove.length} tag(s) from Kinesis stream consumer ${consumerArn}`);
|
|
32947
33474
|
}
|
|
32948
33475
|
if (Object.keys(tagsToAdd).length > 0) {
|
|
32949
|
-
await this.getClient().send(new TagResourceCommand$
|
|
33476
|
+
await this.getClient().send(new TagResourceCommand$17({
|
|
32950
33477
|
ResourceARN: consumerArn,
|
|
32951
33478
|
Tags: tagsToAdd
|
|
32952
33479
|
}));
|
|
@@ -33876,6 +34403,601 @@ var EFSProvider = class {
|
|
|
33876
34403
|
}
|
|
33877
34404
|
};
|
|
33878
34405
|
|
|
34406
|
+
//#endregion
|
|
34407
|
+
//#region src/provisioning/providers/fsx-filesystem-provider.ts
|
|
34408
|
+
/**
|
|
34409
|
+
* Default polling budget for FSx lifecycle transitions. Lustre SCRATCH
|
|
34410
|
+
* creates typically finish in 5-10 minutes, but PERSISTENT creates,
|
|
34411
|
+
* storage-capacity growth and deletes can take substantially longer —
|
|
34412
|
+
* mirror the Custom Resource provider's 1-hour ceiling.
|
|
34413
|
+
*/
|
|
34414
|
+
const DEFAULT_MAX_WAIT_MS = 3600 * 1e3;
|
|
34415
|
+
const DEFAULT_POLL_INTERVAL_MS = 15e3;
|
|
34416
|
+
/**
|
|
34417
|
+
* Lustre sub-properties that `UpdateFileSystem` accepts (the mutable
|
|
34418
|
+
* subset of the CFn `LustreConfiguration` block). Everything else in the
|
|
34419
|
+
* block is fixed at creation — FSx has no API to change it in place.
|
|
34420
|
+
*/
|
|
34421
|
+
const LUSTRE_MUTABLE_SUBPROPS = new Set([
|
|
34422
|
+
"WeeklyMaintenanceStartTime",
|
|
34423
|
+
"DailyAutomaticBackupStartTime",
|
|
34424
|
+
"AutomaticBackupRetentionDays",
|
|
34425
|
+
"AutoImportPolicy",
|
|
34426
|
+
"DataCompressionType",
|
|
34427
|
+
"PerUnitStorageThroughput",
|
|
34428
|
+
"MetadataConfiguration",
|
|
34429
|
+
"ThroughputCapacity",
|
|
34430
|
+
"DataReadCacheConfiguration"
|
|
34431
|
+
]);
|
|
34432
|
+
/**
|
|
34433
|
+
* Top-level properties that are create-only per the CFn registry schema
|
|
34434
|
+
* (`createOnlyProperties`). A change on any of these is routed through
|
|
34435
|
+
* DELETE+CREATE by the replacement-detection layer; if a diff somehow
|
|
34436
|
+
* reaches update() with one of them changed, refuse loudly instead of
|
|
34437
|
+
* silently applying a partial update.
|
|
34438
|
+
*/
|
|
34439
|
+
const TOP_LEVEL_IMMUTABLE_PROPS = [
|
|
34440
|
+
"FileSystemType",
|
|
34441
|
+
"SubnetIds",
|
|
34442
|
+
"SecurityGroupIds",
|
|
34443
|
+
"KmsKeyId",
|
|
34444
|
+
"BackupId"
|
|
34445
|
+
];
|
|
34446
|
+
const toNumber = (v) => v === void 0 ? void 0 : Number(v);
|
|
34447
|
+
const toBoolean = (v) => {
|
|
34448
|
+
if (v === void 0) return void 0;
|
|
34449
|
+
if (typeof v === "string") return v === "true";
|
|
34450
|
+
return Boolean(v);
|
|
34451
|
+
};
|
|
34452
|
+
/**
|
|
34453
|
+
* SDK Provider for `AWS::FSx::FileSystem`.
|
|
34454
|
+
*
|
|
34455
|
+
* The type is `ProvisioningType: NON_PROVISIONABLE` in the CFn registry,
|
|
34456
|
+
* so cdkd's Cloud Control fallback cannot handle it (issue #1042).
|
|
34457
|
+
*
|
|
34458
|
+
* v1 scope: the **Lustre** variant (the CDK L2, `aws-fsx.LustreFileSystem`).
|
|
34459
|
+
* The `WindowsConfiguration` / `OntapConfiguration` / `OpenZFSConfiguration`
|
|
34460
|
+
* sub-trees are declared `unhandledByDesign`, so templates using them are
|
|
34461
|
+
* rejected by the property-coverage pre-flight instead of silently dropping
|
|
34462
|
+
* the whole variant config (each non-Lustre `FileSystemType` REQUIRES its
|
|
34463
|
+
* variant block, so no non-Lustre template can slip past the pre-flight).
|
|
34464
|
+
*
|
|
34465
|
+
* Lifecycle handling — every mutation is async on AWS:
|
|
34466
|
+
* - `create` → `CreateFileSystem` (or `CreateFileSystemFromBackup` when
|
|
34467
|
+
* `BackupId` is set) + poll `DescribeFileSystems` until `AVAILABLE`.
|
|
34468
|
+
* - `update` → `UpdateFileSystem` for the mutable surface (StorageCapacity,
|
|
34469
|
+
* Lustre mutable sub-props, StorageType, FileSystemTypeVersion,
|
|
34470
|
+
* NetworkType) + `TagResource`/`UntagResource` for `Tags`; polls back to
|
|
34471
|
+
* `AVAILABLE`.
|
|
34472
|
+
* - `delete` → `DeleteFileSystem` + poll until the file system is GONE
|
|
34473
|
+
* (`FileSystemNotFound` / dropped from the Describe response). A timeout
|
|
34474
|
+
* here is a hard error — a lingering FSx file system bills per hour.
|
|
34475
|
+
*
|
|
34476
|
+
* `getMinResourceTimeoutMs()` lifts the deploy engine's per-resource
|
|
34477
|
+
* deadline to the polling ceiling (mirrors `CustomResourceProvider`), so
|
|
34478
|
+
* slow FSx creates don't require a manual `--resource-timeout`.
|
|
34479
|
+
*/
|
|
34480
|
+
var FSxFileSystemProvider = class {
|
|
34481
|
+
/**
|
|
34482
|
+
* Cloud Control has NO handlers for this type (`ProvisioningType:
|
|
34483
|
+
* NON_PROVISIONABLE` in the CFn registry), so the deploy engine's #614
|
|
34484
|
+
* silent-drop auto-route MUST NOT send a Windows/ONTAP/OpenZFS template
|
|
34485
|
+
* to CC — it would fail at provisioning time with an opaque
|
|
34486
|
+
* UnsupportedActionException. With this opt-out the ProviderRegistry
|
|
34487
|
+
* rejects such templates pre-flight with a clear error instead.
|
|
34488
|
+
* (The runtime Tier 3 set cannot express this: it excludes SDK-covered
|
|
34489
|
+
* types by design, so `isNonProvisionable()` is false for this type.)
|
|
34490
|
+
*/
|
|
34491
|
+
disableCcApiFallback = true;
|
|
34492
|
+
client;
|
|
34493
|
+
providerRegion = process.env["AWS_REGION"];
|
|
34494
|
+
logger = getLogger().child("FSxFileSystemProvider");
|
|
34495
|
+
pollIntervalMs;
|
|
34496
|
+
maxWaitMs;
|
|
34497
|
+
constructor(options) {
|
|
34498
|
+
this.pollIntervalMs = options?.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
34499
|
+
this.maxWaitMs = options?.maxWaitMs ?? DEFAULT_MAX_WAIT_MS;
|
|
34500
|
+
}
|
|
34501
|
+
handledProperties = new Map([["AWS::FSx::FileSystem", new Set([
|
|
34502
|
+
"BackupId",
|
|
34503
|
+
"FileSystemType",
|
|
34504
|
+
"FileSystemTypeVersion",
|
|
34505
|
+
"KmsKeyId",
|
|
34506
|
+
"LustreConfiguration",
|
|
34507
|
+
"NetworkType",
|
|
34508
|
+
"SecurityGroupIds",
|
|
34509
|
+
"StorageCapacity",
|
|
34510
|
+
"StorageType",
|
|
34511
|
+
"SubnetIds",
|
|
34512
|
+
"Tags"
|
|
34513
|
+
])]]);
|
|
34514
|
+
unhandledByDesign = new Map([["AWS::FSx::FileSystem", new Map([
|
|
34515
|
+
["WindowsConfiguration", "FSx for Windows File Server variant — requires Active Directory wiring and Windows-specific update/delete semantics (final backups, throughput tiers) that v1 does not implement; only the Lustre variant (the CDK L2) is supported. Follow-up to issue #1042."],
|
|
34516
|
+
["OntapConfiguration", "FSx for NetApp ONTAP variant — the file system is only a container for SVMs/volumes (separate AWS::FSx::StorageVirtualMachine / AWS::FSx::Volume types, both still unsupported), so shipping it alone would be misleading; only the Lustre variant is supported in v1. Follow-up to issue #1042."],
|
|
34517
|
+
["OpenZFSConfiguration", "FSx for OpenZFS variant — root-volume semantics (RootVolumeId, child AWS::FSx::Volume trees) are not implemented in v1; only the Lustre variant is supported. Follow-up to issue #1042."]
|
|
34518
|
+
])]]);
|
|
34519
|
+
getClient() {
|
|
34520
|
+
if (!this.client) this.client = new FSxClient(this.providerRegion ? { region: this.providerRegion } : {});
|
|
34521
|
+
return this.client;
|
|
34522
|
+
}
|
|
34523
|
+
/**
|
|
34524
|
+
* Self-reported minimum per-resource timeout: the deploy engine resolves
|
|
34525
|
+
* `max(getMinResourceTimeoutMs(), globalCliDefault)` so FSx's slow
|
|
34526
|
+
* create/delete polling fits inside the resource deadline without the
|
|
34527
|
+
* user passing `--resource-timeout`.
|
|
34528
|
+
*/
|
|
34529
|
+
getMinResourceTimeoutMs() {
|
|
34530
|
+
return this.maxWaitMs;
|
|
34531
|
+
}
|
|
34532
|
+
async create(logicalId, resourceType, properties) {
|
|
34533
|
+
if (resourceType !== "AWS::FSx::FileSystem") throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId);
|
|
34534
|
+
const backupId = properties["BackupId"];
|
|
34535
|
+
const fileSystemType = properties["FileSystemType"];
|
|
34536
|
+
if (backupId === void 0 && fileSystemType !== "LUSTRE") throw new ProvisioningError(`AWS::FSx::FileSystem: FileSystemType '${fileSystemType ?? "(unset)"}' is not supported by cdkd yet — only the LUSTRE variant is implemented (issue #1042). Windows / ONTAP / OpenZFS file systems can follow in a later PR.`, resourceType, logicalId);
|
|
34537
|
+
this.logger.debug(`Creating FSx FileSystem ${logicalId}`);
|
|
34538
|
+
const tokenHash = createHash("sha256").update([
|
|
34539
|
+
properties["FileSystemType"],
|
|
34540
|
+
properties["SubnetIds"],
|
|
34541
|
+
properties["SecurityGroupIds"],
|
|
34542
|
+
properties["KmsKeyId"],
|
|
34543
|
+
properties["BackupId"]
|
|
34544
|
+
].map((v) => JSON.stringify(v ?? null)).join(" ")).digest("hex").slice(0, 12);
|
|
34545
|
+
const clientRequestToken = `cdkd-${logicalId.slice(0, 45)}-${tokenHash}`;
|
|
34546
|
+
const tags = properties["Tags"];
|
|
34547
|
+
const common = {
|
|
34548
|
+
ClientRequestToken: clientRequestToken,
|
|
34549
|
+
SubnetIds: properties["SubnetIds"],
|
|
34550
|
+
SecurityGroupIds: properties["SecurityGroupIds"],
|
|
34551
|
+
KmsKeyId: properties["KmsKeyId"],
|
|
34552
|
+
StorageType: properties["StorageType"],
|
|
34553
|
+
StorageCapacity: toNumber(properties["StorageCapacity"]),
|
|
34554
|
+
FileSystemTypeVersion: properties["FileSystemTypeVersion"],
|
|
34555
|
+
NetworkType: properties["NetworkType"],
|
|
34556
|
+
LustreConfiguration: this.toCreateLustreConfiguration(properties["LustreConfiguration"]),
|
|
34557
|
+
Tags: tags?.map((t) => ({
|
|
34558
|
+
Key: t.Key,
|
|
34559
|
+
Value: t.Value
|
|
34560
|
+
}))
|
|
34561
|
+
};
|
|
34562
|
+
let fileSystemId;
|
|
34563
|
+
try {
|
|
34564
|
+
let created;
|
|
34565
|
+
if (backupId !== void 0) created = (await this.getClient().send(new CreateFileSystemFromBackupCommand({
|
|
34566
|
+
...common,
|
|
34567
|
+
BackupId: backupId
|
|
34568
|
+
}))).FileSystem;
|
|
34569
|
+
else created = (await this.getClient().send(new CreateFileSystemCommand$1({
|
|
34570
|
+
...common,
|
|
34571
|
+
FileSystemType: fileSystemType
|
|
34572
|
+
}))).FileSystem;
|
|
34573
|
+
fileSystemId = created?.FileSystemId;
|
|
34574
|
+
if (!fileSystemId) throw new ProvisioningError(`FSx CreateFileSystem for ${logicalId} returned no FileSystemId`, resourceType, logicalId);
|
|
34575
|
+
const fs = await this.waitForFileSystemAvailable(fileSystemId, logicalId, resourceType);
|
|
34576
|
+
this.logger.debug(`Successfully created FSx FileSystem ${logicalId}: ${fileSystemId}`);
|
|
34577
|
+
return {
|
|
34578
|
+
physicalId: fileSystemId,
|
|
34579
|
+
attributes: this.buildAttributes(fs)
|
|
34580
|
+
};
|
|
34581
|
+
} catch (error) {
|
|
34582
|
+
if (fileSystemId !== void 0) try {
|
|
34583
|
+
await this.getClient().send(new DeleteFileSystemCommand$1({ FileSystemId: fileSystemId }));
|
|
34584
|
+
this.logger.warn(`Rolled back partially-created FSx FileSystem ${fileSystemId}`);
|
|
34585
|
+
} catch (cleanupError) {
|
|
34586
|
+
this.logger.warn(`Failed to roll back partially-created FSx FileSystem ${fileSystemId}: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)} — delete it manually to stop billing`);
|
|
34587
|
+
}
|
|
34588
|
+
if (error instanceof ProvisioningError) throw error;
|
|
34589
|
+
const cause = error instanceof Error ? error : void 0;
|
|
34590
|
+
throw new ProvisioningError(`Failed to create FSx FileSystem ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
|
|
34591
|
+
}
|
|
34592
|
+
}
|
|
34593
|
+
/**
|
|
34594
|
+
* Map the CFn `LustreConfiguration` block to the SDK create shape. The
|
|
34595
|
+
* field names are identical (both PascalCase); numeric / boolean fields
|
|
34596
|
+
* are coerced defensively because template values can arrive as strings.
|
|
34597
|
+
*/
|
|
34598
|
+
toCreateLustreConfiguration(config) {
|
|
34599
|
+
if (!config) return void 0;
|
|
34600
|
+
const metadata = config["MetadataConfiguration"];
|
|
34601
|
+
const readCache = config["DataReadCacheConfiguration"];
|
|
34602
|
+
return {
|
|
34603
|
+
WeeklyMaintenanceStartTime: config["WeeklyMaintenanceStartTime"],
|
|
34604
|
+
ImportPath: config["ImportPath"],
|
|
34605
|
+
ExportPath: config["ExportPath"],
|
|
34606
|
+
ImportedFileChunkSize: toNumber(config["ImportedFileChunkSize"]),
|
|
34607
|
+
DeploymentType: config["DeploymentType"],
|
|
34608
|
+
AutoImportPolicy: config["AutoImportPolicy"],
|
|
34609
|
+
PerUnitStorageThroughput: toNumber(config["PerUnitStorageThroughput"]),
|
|
34610
|
+
DailyAutomaticBackupStartTime: config["DailyAutomaticBackupStartTime"],
|
|
34611
|
+
AutomaticBackupRetentionDays: toNumber(config["AutomaticBackupRetentionDays"]),
|
|
34612
|
+
CopyTagsToBackups: toBoolean(config["CopyTagsToBackups"]),
|
|
34613
|
+
DriveCacheType: config["DriveCacheType"],
|
|
34614
|
+
DataCompressionType: config["DataCompressionType"],
|
|
34615
|
+
EfaEnabled: toBoolean(config["EfaEnabled"]),
|
|
34616
|
+
ThroughputCapacity: toNumber(config["ThroughputCapacity"]),
|
|
34617
|
+
MetadataConfiguration: metadata ? {
|
|
34618
|
+
Mode: metadata["Mode"],
|
|
34619
|
+
Iops: toNumber(metadata["Iops"])
|
|
34620
|
+
} : void 0,
|
|
34621
|
+
DataReadCacheConfiguration: readCache ? {
|
|
34622
|
+
SizingMode: readCache["SizingMode"],
|
|
34623
|
+
SizeGiB: toNumber(readCache["SizeGiB"])
|
|
34624
|
+
} : void 0
|
|
34625
|
+
};
|
|
34626
|
+
}
|
|
34627
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
34628
|
+
const changed = (key) => JSON.stringify(properties[key]) !== JSON.stringify(previousProperties[key]);
|
|
34629
|
+
for (const key of TOP_LEVEL_IMMUTABLE_PROPS) {
|
|
34630
|
+
const next = properties[key];
|
|
34631
|
+
const prev = previousProperties[key];
|
|
34632
|
+
if (JSON.stringify(next ?? null) !== JSON.stringify(prev ?? null)) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `AWS FSx FileSystem ${key} is immutable on AWS — UpdateFileSystem does not accept ${key}; the property is fixed at creation. Re-deploy with cdkd deploy --replace, or destroy + redeploy the stack.`);
|
|
34633
|
+
}
|
|
34634
|
+
const nextLustre = properties["LustreConfiguration"] ?? {};
|
|
34635
|
+
const prevLustre = previousProperties["LustreConfiguration"] ?? {};
|
|
34636
|
+
const lustreKeys = new Set([...Object.keys(nextLustre), ...Object.keys(prevLustre)]);
|
|
34637
|
+
const lustreMutableDiff = {};
|
|
34638
|
+
let lustreHasMutableDiff = false;
|
|
34639
|
+
for (const key of lustreKeys) {
|
|
34640
|
+
const next = nextLustre[key];
|
|
34641
|
+
const prev = prevLustre[key];
|
|
34642
|
+
if (JSON.stringify(next) === JSON.stringify(prev)) continue;
|
|
34643
|
+
if (!LUSTRE_MUTABLE_SUBPROPS.has(key)) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `AWS FSx FileSystem LustreConfiguration.${key} is immutable on AWS — UpdateFileSystem cannot change it after creation. Re-deploy with cdkd deploy --replace, or destroy + redeploy the stack.`);
|
|
34644
|
+
lustreHasMutableDiff = true;
|
|
34645
|
+
switch (key) {
|
|
34646
|
+
case "WeeklyMaintenanceStartTime":
|
|
34647
|
+
case "DailyAutomaticBackupStartTime":
|
|
34648
|
+
lustreMutableDiff[key] = next;
|
|
34649
|
+
break;
|
|
34650
|
+
case "AutomaticBackupRetentionDays":
|
|
34651
|
+
case "PerUnitStorageThroughput":
|
|
34652
|
+
case "ThroughputCapacity":
|
|
34653
|
+
lustreMutableDiff[key] = toNumber(next);
|
|
34654
|
+
break;
|
|
34655
|
+
case "AutoImportPolicy":
|
|
34656
|
+
case "DataCompressionType":
|
|
34657
|
+
lustreMutableDiff[key] = next;
|
|
34658
|
+
break;
|
|
34659
|
+
case "MetadataConfiguration": {
|
|
34660
|
+
const metadata = next;
|
|
34661
|
+
lustreMutableDiff.MetadataConfiguration = metadata ? {
|
|
34662
|
+
Mode: metadata["Mode"],
|
|
34663
|
+
Iops: toNumber(metadata["Iops"])
|
|
34664
|
+
} : void 0;
|
|
34665
|
+
break;
|
|
34666
|
+
}
|
|
34667
|
+
case "DataReadCacheConfiguration": {
|
|
34668
|
+
const readCache = next;
|
|
34669
|
+
lustreMutableDiff.DataReadCacheConfiguration = readCache ? {
|
|
34670
|
+
SizingMode: readCache["SizingMode"],
|
|
34671
|
+
SizeGiB: toNumber(readCache["SizeGiB"])
|
|
34672
|
+
} : void 0;
|
|
34673
|
+
break;
|
|
34674
|
+
}
|
|
34675
|
+
}
|
|
34676
|
+
}
|
|
34677
|
+
const storageCapacityChanged = changed("StorageCapacity");
|
|
34678
|
+
const storageTypeChanged = changed("StorageType");
|
|
34679
|
+
const typeVersionChanged = changed("FileSystemTypeVersion");
|
|
34680
|
+
const networkTypeChanged = changed("NetworkType");
|
|
34681
|
+
const tagsChanged = changed("Tags");
|
|
34682
|
+
if (!lustreHasMutableDiff && !storageCapacityChanged && !storageTypeChanged && !typeVersionChanged && !networkTypeChanged && !tagsChanged) {
|
|
34683
|
+
this.logger.debug(`No mutable diff for FSx FileSystem ${logicalId}, skipping update`);
|
|
34684
|
+
return {
|
|
34685
|
+
physicalId,
|
|
34686
|
+
wasReplaced: false
|
|
34687
|
+
};
|
|
34688
|
+
}
|
|
34689
|
+
this.logger.debug(`Updating FSx FileSystem ${logicalId}: ${physicalId}`);
|
|
34690
|
+
try {
|
|
34691
|
+
const needsUpdateCall = lustreHasMutableDiff || storageCapacityChanged || storageTypeChanged || typeVersionChanged || networkTypeChanged;
|
|
34692
|
+
let updatedFs;
|
|
34693
|
+
if (needsUpdateCall) {
|
|
34694
|
+
const callTimeMs = Date.now();
|
|
34695
|
+
const respPendingActions = ((await this.getClient().send(new UpdateFileSystemCommand$1({
|
|
34696
|
+
FileSystemId: physicalId,
|
|
34697
|
+
...storageCapacityChanged && { StorageCapacity: toNumber(properties["StorageCapacity"]) },
|
|
34698
|
+
...storageTypeChanged && { StorageType: properties["StorageType"] },
|
|
34699
|
+
...typeVersionChanged && { FileSystemTypeVersion: properties["FileSystemTypeVersion"] },
|
|
34700
|
+
...networkTypeChanged && { NetworkType: properties["NetworkType"] },
|
|
34701
|
+
...lustreHasMutableDiff && { LustreConfiguration: lustreMutableDiff }
|
|
34702
|
+
}))).FileSystem?.AdministrativeActions ?? []).filter((a) => a.AdministrativeActionType === "FILE_SYSTEM_UPDATE" && (a.Status === "PENDING" || a.Status === "IN_PROGRESS"));
|
|
34703
|
+
const requestTimes = respPendingActions.map((a) => a.RequestTime?.getTime()).filter((t) => t !== void 0);
|
|
34704
|
+
const actionThresholdMs = requestTimes.length > 0 ? Math.min(...requestTimes) : callTimeMs - 6e4;
|
|
34705
|
+
updatedFs = await this.waitForUpdateActionComplete(physicalId, logicalId, resourceType, actionThresholdMs, respPendingActions.length > 0);
|
|
34706
|
+
}
|
|
34707
|
+
if (tagsChanged) await this.applyTagDiff(physicalId, properties["Tags"], previousProperties["Tags"]);
|
|
34708
|
+
if (!updatedFs) try {
|
|
34709
|
+
updatedFs = (await this.getClient().send(new DescribeFileSystemsCommand$1({ FileSystemIds: [physicalId] }))).FileSystems?.[0];
|
|
34710
|
+
} catch (describeError) {
|
|
34711
|
+
this.logger.debug(`Post-update attribute refresh for ${physicalId} failed (returning without attributes): ${describeError instanceof Error ? describeError.message : String(describeError)}`);
|
|
34712
|
+
}
|
|
34713
|
+
this.logger.debug(`Successfully updated FSx FileSystem ${logicalId}`);
|
|
34714
|
+
return {
|
|
34715
|
+
physicalId,
|
|
34716
|
+
wasReplaced: false,
|
|
34717
|
+
...updatedFs && { attributes: this.buildAttributes(updatedFs) }
|
|
34718
|
+
};
|
|
34719
|
+
} catch (error) {
|
|
34720
|
+
if (error instanceof ProvisioningError) throw error;
|
|
34721
|
+
const cause = error instanceof Error ? error : void 0;
|
|
34722
|
+
throw new ProvisioningError(`Failed to update FSx FileSystem ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
34723
|
+
}
|
|
34724
|
+
}
|
|
34725
|
+
/**
|
|
34726
|
+
* Apply a `Tags` diff via `TagResource` / `UntagResource` (the FSx
|
|
34727
|
+
* `UpdateFileSystem` API does not accept tags). Needs the ARN — resolve
|
|
34728
|
+
* it from `DescribeFileSystems`.
|
|
34729
|
+
*/
|
|
34730
|
+
async applyTagDiff(physicalId, nextTags, prevTags) {
|
|
34731
|
+
const arn = (await this.getClient().send(new DescribeFileSystemsCommand$1({ FileSystemIds: [physicalId] }))).FileSystems?.[0]?.ResourceARN;
|
|
34732
|
+
if (!arn) throw new Error(`could not resolve ResourceARN for FSx FileSystem ${physicalId}`);
|
|
34733
|
+
const next = new Map((nextTags ?? []).map((t) => [t.Key, t.Value]));
|
|
34734
|
+
const prev = new Map((prevTags ?? []).map((t) => [t.Key, t.Value]));
|
|
34735
|
+
const toSet = [];
|
|
34736
|
+
for (const [key, value] of next) {
|
|
34737
|
+
if (key === void 0) continue;
|
|
34738
|
+
if (prev.get(key) !== value) toSet.push({
|
|
34739
|
+
Key: key,
|
|
34740
|
+
Value: value
|
|
34741
|
+
});
|
|
34742
|
+
}
|
|
34743
|
+
const toRemove = [];
|
|
34744
|
+
for (const key of prev.keys()) if (key !== void 0 && !next.has(key)) toRemove.push(key);
|
|
34745
|
+
if (toSet.length > 0) await this.getClient().send(new TagResourceCommand$18({
|
|
34746
|
+
ResourceARN: arn,
|
|
34747
|
+
Tags: toSet
|
|
34748
|
+
}));
|
|
34749
|
+
if (toRemove.length > 0) await this.getClient().send(new UntagResourceCommand$18({
|
|
34750
|
+
ResourceARN: arn,
|
|
34751
|
+
TagKeys: toRemove
|
|
34752
|
+
}));
|
|
34753
|
+
}
|
|
34754
|
+
async delete(logicalId, physicalId, resourceType, _properties, context) {
|
|
34755
|
+
this.logger.debug(`Deleting FSx FileSystem ${logicalId}: ${physicalId}`);
|
|
34756
|
+
try {
|
|
34757
|
+
await this.getClient().send(new DeleteFileSystemCommand$1({ FileSystemId: physicalId }));
|
|
34758
|
+
} catch (error) {
|
|
34759
|
+
if (error instanceof FileSystemNotFound$1) {
|
|
34760
|
+
assertRegionMatch(await this.getClient().config.region(), context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
34761
|
+
this.logger.debug(`FSx FileSystem ${physicalId} does not exist, skipping deletion`);
|
|
34762
|
+
return;
|
|
34763
|
+
}
|
|
34764
|
+
const cause = error instanceof Error ? error : void 0;
|
|
34765
|
+
throw new ProvisioningError(`Failed to delete FSx FileSystem ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
34766
|
+
}
|
|
34767
|
+
await this.waitForFileSystemDeleted(physicalId, logicalId, resourceType);
|
|
34768
|
+
this.logger.debug(`Successfully deleted FSx FileSystem ${logicalId}`);
|
|
34769
|
+
}
|
|
34770
|
+
/**
|
|
34771
|
+
* Issue the polling `DescribeFileSystems` with bounded tolerance for
|
|
34772
|
+
* TRANSIENT errors (throttling / 5xx / connection resets): up to
|
|
34773
|
+
* `maxConsecutiveTransient` consecutive failures are absorbed (with the
|
|
34774
|
+
* normal poll delay) before the error propagates. A 5-10 minute create
|
|
34775
|
+
* poll at 15s intervals would otherwise turn a single throttle into a
|
|
34776
|
+
* spurious failure + best-effort rollback cycle. Non-transient errors
|
|
34777
|
+
* (incl. FileSystemNotFound) propagate immediately.
|
|
34778
|
+
*/
|
|
34779
|
+
async describeForPoll(fileSystemId, transientState, maxConsecutiveTransient = 5) {
|
|
34780
|
+
try {
|
|
34781
|
+
const response = await this.getClient().send(new DescribeFileSystemsCommand$1({ FileSystemIds: [fileSystemId] }));
|
|
34782
|
+
transientState.count = 0;
|
|
34783
|
+
return response.FileSystems?.[0];
|
|
34784
|
+
} catch (error) {
|
|
34785
|
+
const name = error instanceof Error ? error.name : "";
|
|
34786
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
34787
|
+
if ((name === "ThrottlingException" || name === "ServiceLimitExceeded" || name === "InternalServerError" || name === "TimeoutError" || /rate exceeded|too many requests|timed? ?out|ECONNRESET|EPIPE|socket hang up/i.test(msg)) && transientState.count < maxConsecutiveTransient) {
|
|
34788
|
+
transientState.count += 1;
|
|
34789
|
+
this.logger.debug(`Transient DescribeFileSystems error while polling ${fileSystemId} (${transientState.count}/${maxConsecutiveTransient}): ${msg} — retrying`);
|
|
34790
|
+
return;
|
|
34791
|
+
}
|
|
34792
|
+
throw error;
|
|
34793
|
+
}
|
|
34794
|
+
}
|
|
34795
|
+
async waitForFileSystemAvailable(fileSystemId, logicalId, resourceType) {
|
|
34796
|
+
const startTime = Date.now();
|
|
34797
|
+
const transientState = { count: 0 };
|
|
34798
|
+
while (Date.now() - startTime < this.maxWaitMs) {
|
|
34799
|
+
const fs = await this.describeForPoll(fileSystemId, transientState);
|
|
34800
|
+
const lifecycle = fs?.Lifecycle;
|
|
34801
|
+
if (fs && lifecycle === "AVAILABLE") return fs;
|
|
34802
|
+
if (lifecycle === "FAILED" || lifecycle === "MISCONFIGURED") throw new ProvisioningError(`FSx FileSystem ${fileSystemId} entered lifecycle state ${lifecycle}: ${fs?.FailureDetails?.Message ?? "no failure details reported"}`, resourceType, logicalId, fileSystemId);
|
|
34803
|
+
this.logger.debug(`FSx FileSystem ${fileSystemId} state: ${lifecycle ?? "unknown"}, waiting...`);
|
|
34804
|
+
await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));
|
|
34805
|
+
}
|
|
34806
|
+
throw new ProvisioningError(`Timed out waiting for FSx FileSystem ${fileSystemId} to become AVAILABLE (${Math.round(this.maxWaitMs / 6e4)} min)`, resourceType, logicalId, fileSystemId);
|
|
34807
|
+
}
|
|
34808
|
+
/**
|
|
34809
|
+
* Wait until the async `FILE_SYSTEM_UPDATE` administrative action kicked
|
|
34810
|
+
* off by `UpdateFileSystem` completes (and the Lifecycle is AVAILABLE).
|
|
34811
|
+
* `STORAGE_OPTIMIZATION` actions are intentionally ignored — they can run
|
|
34812
|
+
* for hours after a capacity grow, and CloudFormation does not wait for
|
|
34813
|
+
* them either (`UPDATED_OPTIMIZING` counts as done). A FAILED update
|
|
34814
|
+
* action is a hard error carrying the action's failure message.
|
|
34815
|
+
*
|
|
34816
|
+
* `actionThresholdMs` scopes the wait to THIS update's actions: FSx keeps
|
|
34817
|
+
* terminal (COMPLETED / FAILED) actions in the history, so only actions
|
|
34818
|
+
* whose `RequestTime` is at or after the threshold are considered — a
|
|
34819
|
+
* PAST failed update must not fail this one's retry. An action without a
|
|
34820
|
+
* `RequestTime` is conservatively tracked.
|
|
34821
|
+
*
|
|
34822
|
+
* `requireActionObservation` guards the eventual-consistency race: when
|
|
34823
|
+
* the UpdateFileSystem response confirmed a newly-created action, the
|
|
34824
|
+
* wait refuses to return until an in-threshold action has been observed
|
|
34825
|
+
* in at least one Describe response — a lagging read replica could
|
|
34826
|
+
* otherwise briefly show none and cause a premature return with the
|
|
34827
|
+
* pre-update config. Terminal actions stay in the history, so the
|
|
34828
|
+
* observation is guaranteed to eventually succeed (bounded by
|
|
34829
|
+
* `maxWaitMs`).
|
|
34830
|
+
*/
|
|
34831
|
+
async waitForUpdateActionComplete(fileSystemId, logicalId, resourceType, actionThresholdMs, requireActionObservation) {
|
|
34832
|
+
const startTime = Date.now();
|
|
34833
|
+
const transientState = { count: 0 };
|
|
34834
|
+
let seenTrackedAction = false;
|
|
34835
|
+
while (Date.now() - startTime < this.maxWaitMs) {
|
|
34836
|
+
const fs = await this.describeForPoll(fileSystemId, transientState);
|
|
34837
|
+
if (fs) {
|
|
34838
|
+
const updateActions = (fs.AdministrativeActions ?? []).filter((a) => a.AdministrativeActionType === "FILE_SYSTEM_UPDATE" && (a.RequestTime === void 0 || a.RequestTime.getTime() >= actionThresholdMs));
|
|
34839
|
+
if (updateActions.length > 0) seenTrackedAction = true;
|
|
34840
|
+
const failed = updateActions.find((a) => a.Status === "FAILED");
|
|
34841
|
+
if (failed) throw new ProvisioningError(`FSx FileSystem ${fileSystemId} update failed (FILE_SYSTEM_UPDATE administrative action): ${failed.FailureDetails?.Message ?? "no failure details reported"}`, resourceType, logicalId, fileSystemId);
|
|
34842
|
+
if (!updateActions.some((a) => a.Status === "PENDING" || a.Status === "IN_PROGRESS") && (!requireActionObservation || seenTrackedAction) && fs.Lifecycle === "AVAILABLE") return fs;
|
|
34843
|
+
this.logger.debug(`FSx FileSystem ${fileSystemId} update in progress (lifecycle: ${fs.Lifecycle ?? "unknown"}), waiting...`);
|
|
34844
|
+
}
|
|
34845
|
+
await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));
|
|
34846
|
+
}
|
|
34847
|
+
throw new ProvisioningError(`Timed out waiting for FSx FileSystem ${fileSystemId} update to complete (${Math.round(this.maxWaitMs / 6e4)} min)`, resourceType, logicalId, fileSystemId);
|
|
34848
|
+
}
|
|
34849
|
+
async waitForFileSystemDeleted(fileSystemId, logicalId, resourceType) {
|
|
34850
|
+
const startTime = Date.now();
|
|
34851
|
+
const transientState = { count: 0 };
|
|
34852
|
+
while (Date.now() - startTime < this.maxWaitMs) {
|
|
34853
|
+
let fs;
|
|
34854
|
+
let sawResponse = true;
|
|
34855
|
+
try {
|
|
34856
|
+
fs = await this.describeForPoll(fileSystemId, transientState);
|
|
34857
|
+
if (fs === void 0 && transientState.count > 0) sawResponse = false;
|
|
34858
|
+
} catch (error) {
|
|
34859
|
+
if (error instanceof FileSystemNotFound$1) return;
|
|
34860
|
+
const cause = error instanceof Error ? error : void 0;
|
|
34861
|
+
throw new ProvisioningError(`Failed to poll FSx FileSystem ${fileSystemId} deletion: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, fileSystemId, cause);
|
|
34862
|
+
}
|
|
34863
|
+
if (!fs && sawResponse) return;
|
|
34864
|
+
if (!fs) {
|
|
34865
|
+
await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));
|
|
34866
|
+
continue;
|
|
34867
|
+
}
|
|
34868
|
+
if (fs.Lifecycle === "FAILED") throw new ProvisioningError(`FSx FileSystem ${fileSystemId} entered lifecycle state FAILED during deletion: ${fs.FailureDetails?.Message ?? "no failure details reported"}`, resourceType, logicalId, fileSystemId);
|
|
34869
|
+
this.logger.debug(`FSx FileSystem ${fileSystemId} state: ${fs.Lifecycle ?? "unknown"}, waiting for deletion...`);
|
|
34870
|
+
await new Promise((resolve) => setTimeout(resolve, this.pollIntervalMs));
|
|
34871
|
+
}
|
|
34872
|
+
throw new ProvisioningError(`Timed out waiting for FSx FileSystem ${fileSystemId} deletion (${Math.round(this.maxWaitMs / 6e4)} min) — verify and delete it manually to stop billing`, resourceType, logicalId, fileSystemId);
|
|
34873
|
+
}
|
|
34874
|
+
buildAttributes(fs) {
|
|
34875
|
+
const attributes = {};
|
|
34876
|
+
if (fs.ResourceARN !== void 0) attributes["ResourceARN"] = fs.ResourceARN;
|
|
34877
|
+
if (fs.DNSName !== void 0) attributes["DNSName"] = fs.DNSName;
|
|
34878
|
+
if (fs.LustreConfiguration?.MountName !== void 0) attributes["LustreMountName"] = fs.LustreConfiguration.MountName;
|
|
34879
|
+
if (fs.FileSystemId !== void 0) attributes["FileSystemId"] = fs.FileSystemId;
|
|
34880
|
+
return attributes;
|
|
34881
|
+
}
|
|
34882
|
+
async getAttribute(physicalId, _resourceType, attributeName) {
|
|
34883
|
+
if (attributeName === "Id" || attributeName === "FileSystemId") return physicalId;
|
|
34884
|
+
const fs = (await this.getClient().send(new DescribeFileSystemsCommand$1({ FileSystemIds: [physicalId] }))).FileSystems?.[0];
|
|
34885
|
+
if (!fs) return void 0;
|
|
34886
|
+
switch (attributeName) {
|
|
34887
|
+
case "ResourceARN": return fs.ResourceARN;
|
|
34888
|
+
case "DNSName": return fs.DNSName;
|
|
34889
|
+
case "LustreMountName": return fs.LustreConfiguration?.MountName;
|
|
34890
|
+
case "RootVolumeId": return fs.OpenZFSConfiguration?.RootVolumeId;
|
|
34891
|
+
default: return;
|
|
34892
|
+
}
|
|
34893
|
+
}
|
|
34894
|
+
/**
|
|
34895
|
+
* State property paths this provider cannot read back from AWS:
|
|
34896
|
+
* - `SecurityGroupIds` — `DescribeFileSystems` returns network
|
|
34897
|
+
* interface ids, never the original security group list.
|
|
34898
|
+
* - `BackupId` — creation-source input, not surfaced on the deployed
|
|
34899
|
+
* file system.
|
|
34900
|
+
*/
|
|
34901
|
+
getDriftUnknownPaths(resourceType) {
|
|
34902
|
+
if (resourceType !== "AWS::FSx::FileSystem") return [];
|
|
34903
|
+
return ["SecurityGroupIds", "BackupId"];
|
|
34904
|
+
}
|
|
34905
|
+
/**
|
|
34906
|
+
* Read the AWS-current file system configuration in CFn-property shape
|
|
34907
|
+
* via `DescribeFileSystems`. Lustre data-repository fields (`ImportPath`
|
|
34908
|
+
* / `ExportPath` / `AutoImportPolicy` / `ImportedFileChunkSize`) are
|
|
34909
|
+
* mapped back from the nested `DataRepositoryConfiguration` the API
|
|
34910
|
+
* returns. Returns `undefined` when the file system is gone.
|
|
34911
|
+
*/
|
|
34912
|
+
async readCurrentState(physicalId, _logicalId, resourceType) {
|
|
34913
|
+
if (resourceType !== "AWS::FSx::FileSystem") return void 0;
|
|
34914
|
+
let fs;
|
|
34915
|
+
try {
|
|
34916
|
+
fs = (await this.getClient().send(new DescribeFileSystemsCommand$1({ FileSystemIds: [physicalId] }))).FileSystems?.[0];
|
|
34917
|
+
} catch (err) {
|
|
34918
|
+
if (err instanceof FileSystemNotFound$1) return void 0;
|
|
34919
|
+
throw err;
|
|
34920
|
+
}
|
|
34921
|
+
if (!fs) return void 0;
|
|
34922
|
+
const result = {};
|
|
34923
|
+
if (fs.FileSystemType !== void 0) result["FileSystemType"] = fs.FileSystemType;
|
|
34924
|
+
if (fs.StorageCapacity !== void 0) result["StorageCapacity"] = fs.StorageCapacity;
|
|
34925
|
+
if (fs.StorageType !== void 0) result["StorageType"] = fs.StorageType;
|
|
34926
|
+
if (fs.SubnetIds !== void 0) result["SubnetIds"] = [...fs.SubnetIds];
|
|
34927
|
+
if (fs.KmsKeyId !== void 0) result["KmsKeyId"] = fs.KmsKeyId;
|
|
34928
|
+
if (fs.FileSystemTypeVersion !== void 0) result["FileSystemTypeVersion"] = fs.FileSystemTypeVersion;
|
|
34929
|
+
if (fs.NetworkType !== void 0) result["NetworkType"] = fs.NetworkType;
|
|
34930
|
+
const lustre = fs.LustreConfiguration;
|
|
34931
|
+
if (lustre) {
|
|
34932
|
+
const config = {};
|
|
34933
|
+
if (lustre.WeeklyMaintenanceStartTime !== void 0) config["WeeklyMaintenanceStartTime"] = lustre.WeeklyMaintenanceStartTime;
|
|
34934
|
+
if (lustre.DeploymentType !== void 0) config["DeploymentType"] = lustre.DeploymentType;
|
|
34935
|
+
if (lustre.PerUnitStorageThroughput !== void 0) config["PerUnitStorageThroughput"] = lustre.PerUnitStorageThroughput;
|
|
34936
|
+
if (lustre.DailyAutomaticBackupStartTime !== void 0) config["DailyAutomaticBackupStartTime"] = lustre.DailyAutomaticBackupStartTime;
|
|
34937
|
+
if (lustre.AutomaticBackupRetentionDays !== void 0) config["AutomaticBackupRetentionDays"] = lustre.AutomaticBackupRetentionDays;
|
|
34938
|
+
if (lustre.CopyTagsToBackups !== void 0) config["CopyTagsToBackups"] = lustre.CopyTagsToBackups;
|
|
34939
|
+
if (lustre.DriveCacheType !== void 0) config["DriveCacheType"] = lustre.DriveCacheType;
|
|
34940
|
+
if (lustre.DataCompressionType !== void 0) config["DataCompressionType"] = lustre.DataCompressionType;
|
|
34941
|
+
if (lustre.EfaEnabled !== void 0) config["EfaEnabled"] = lustre.EfaEnabled;
|
|
34942
|
+
if (lustre.ThroughputCapacity !== void 0) config["ThroughputCapacity"] = lustre.ThroughputCapacity;
|
|
34943
|
+
if (lustre.MetadataConfiguration) {
|
|
34944
|
+
const metadata = {};
|
|
34945
|
+
if (lustre.MetadataConfiguration.Mode !== void 0) metadata["Mode"] = lustre.MetadataConfiguration.Mode;
|
|
34946
|
+
if (lustre.MetadataConfiguration.Iops !== void 0) metadata["Iops"] = lustre.MetadataConfiguration.Iops;
|
|
34947
|
+
if (Object.keys(metadata).length > 0) config["MetadataConfiguration"] = metadata;
|
|
34948
|
+
}
|
|
34949
|
+
if (lustre.DataReadCacheConfiguration) {
|
|
34950
|
+
const readCache = {};
|
|
34951
|
+
if (lustre.DataReadCacheConfiguration.SizingMode !== void 0) readCache["SizingMode"] = lustre.DataReadCacheConfiguration.SizingMode;
|
|
34952
|
+
if (lustre.DataReadCacheConfiguration.SizeGiB !== void 0) readCache["SizeGiB"] = lustre.DataReadCacheConfiguration.SizeGiB;
|
|
34953
|
+
if (Object.keys(readCache).length > 0) config["DataReadCacheConfiguration"] = readCache;
|
|
34954
|
+
}
|
|
34955
|
+
const dataRepo = lustre.DataRepositoryConfiguration;
|
|
34956
|
+
if (dataRepo) {
|
|
34957
|
+
if (dataRepo.ImportPath !== void 0) config["ImportPath"] = dataRepo.ImportPath;
|
|
34958
|
+
if (dataRepo.ExportPath !== void 0) config["ExportPath"] = dataRepo.ExportPath;
|
|
34959
|
+
if (dataRepo.AutoImportPolicy !== void 0) config["AutoImportPolicy"] = dataRepo.AutoImportPolicy;
|
|
34960
|
+
if (dataRepo.ImportedFileChunkSize !== void 0) config["ImportedFileChunkSize"] = dataRepo.ImportedFileChunkSize;
|
|
34961
|
+
}
|
|
34962
|
+
if (Object.keys(config).length > 0) result["LustreConfiguration"] = config;
|
|
34963
|
+
}
|
|
34964
|
+
result["Tags"] = normalizeAwsTagsToCfn(fs.Tags);
|
|
34965
|
+
return result;
|
|
34966
|
+
}
|
|
34967
|
+
/**
|
|
34968
|
+
* Adopt an existing FSx file system into cdkd state. Explicit physical
|
|
34969
|
+
* id is verified via `DescribeFileSystems`; otherwise a paginated walk
|
|
34970
|
+
* matches the `aws:cdk:path` tag (`Tags` ride inline on each item).
|
|
34971
|
+
*/
|
|
34972
|
+
async import(input) {
|
|
34973
|
+
if (input.resourceType !== "AWS::FSx::FileSystem") return null;
|
|
34974
|
+
if (input.knownPhysicalId) try {
|
|
34975
|
+
const fs = (await this.getClient().send(new DescribeFileSystemsCommand$1({ FileSystemIds: [input.knownPhysicalId] }))).FileSystems?.[0];
|
|
34976
|
+
return fs?.FileSystemId ? {
|
|
34977
|
+
physicalId: fs.FileSystemId,
|
|
34978
|
+
attributes: this.buildAttributes(fs)
|
|
34979
|
+
} : null;
|
|
34980
|
+
} catch (err) {
|
|
34981
|
+
if (err instanceof FileSystemNotFound$1) return null;
|
|
34982
|
+
throw err;
|
|
34983
|
+
}
|
|
34984
|
+
if (!input.cdkPath) return null;
|
|
34985
|
+
let nextToken;
|
|
34986
|
+
do {
|
|
34987
|
+
const list = await this.getClient().send(new DescribeFileSystemsCommand$1({ ...nextToken && { NextToken: nextToken } }));
|
|
34988
|
+
for (const fs of list.FileSystems ?? []) {
|
|
34989
|
+
if (!fs.FileSystemId) continue;
|
|
34990
|
+
if (matchesCdkPath(fs.Tags, input.cdkPath)) return {
|
|
34991
|
+
physicalId: fs.FileSystemId,
|
|
34992
|
+
attributes: this.buildAttributes(fs)
|
|
34993
|
+
};
|
|
34994
|
+
}
|
|
34995
|
+
nextToken = list.NextToken;
|
|
34996
|
+
} while (nextToken);
|
|
34997
|
+
return null;
|
|
34998
|
+
}
|
|
34999
|
+
};
|
|
35000
|
+
|
|
33879
35001
|
//#endregion
|
|
33880
35002
|
//#region src/provisioning/providers/firehose-provider.ts
|
|
33881
35003
|
/**
|
|
@@ -36097,11 +37219,11 @@ var CodeCommitRepositoryProvider = class {
|
|
|
36097
37219
|
const repoArn = metadata?.Arn;
|
|
36098
37220
|
if (repoArn) {
|
|
36099
37221
|
const removedKeys = Object.keys(oldTagMap).filter((k) => !(k in newTagMap));
|
|
36100
|
-
if (removedKeys.length > 0) await this.getClient().send(new UntagResourceCommand$
|
|
37222
|
+
if (removedKeys.length > 0) await this.getClient().send(new UntagResourceCommand$19({
|
|
36101
37223
|
resourceArn: repoArn,
|
|
36102
37224
|
tagKeys: removedKeys
|
|
36103
37225
|
}));
|
|
36104
|
-
if (Object.keys(newTagMap).length > 0) await this.getClient().send(new TagResourceCommand$
|
|
37226
|
+
if (Object.keys(newTagMap).length > 0) await this.getClient().send(new TagResourceCommand$19({
|
|
36105
37227
|
resourceArn: repoArn,
|
|
36106
37228
|
tags: newTagMap
|
|
36107
37229
|
}));
|
|
@@ -36208,7 +37330,7 @@ var CodeCommitRepositoryProvider = class {
|
|
|
36208
37330
|
throw err;
|
|
36209
37331
|
}
|
|
36210
37332
|
if (!metadata?.Arn) continue;
|
|
36211
|
-
if ((await this.getClient().send(new ListTagsForResourceCommand$
|
|
37333
|
+
if ((await this.getClient().send(new ListTagsForResourceCommand$19({ resourceArn: metadata.Arn }))).tags?.["aws:cdk:path"] === input.cdkPath) return {
|
|
36212
37334
|
physicalId: repo.repositoryName,
|
|
36213
37335
|
attributes: this.toAttributes(metadata)
|
|
36214
37336
|
};
|
|
@@ -36358,7 +37480,7 @@ var DLMLifecyclePolicyProvider = class {
|
|
|
36358
37480
|
if (tagsChanged && arn) {
|
|
36359
37481
|
const removedKeys = Object.keys(oldTags).filter((k) => !(k in newTags));
|
|
36360
37482
|
if (removedKeys.length > 0) {
|
|
36361
|
-
await this.getClient().send(new UntagResourceCommand$
|
|
37483
|
+
await this.getClient().send(new UntagResourceCommand$20({
|
|
36362
37484
|
ResourceArn: arn,
|
|
36363
37485
|
TagKeys: removedKeys
|
|
36364
37486
|
}));
|
|
@@ -36367,7 +37489,7 @@ var DLMLifecyclePolicyProvider = class {
|
|
|
36367
37489
|
const tagsToAdd = {};
|
|
36368
37490
|
for (const [k, v] of Object.entries(newTags)) if (oldTags[k] !== v) tagsToAdd[k] = v;
|
|
36369
37491
|
if (Object.keys(tagsToAdd).length > 0) {
|
|
36370
|
-
await this.getClient().send(new TagResourceCommand$
|
|
37492
|
+
await this.getClient().send(new TagResourceCommand$20({
|
|
36371
37493
|
ResourceArn: arn,
|
|
36372
37494
|
Tags: tagsToAdd
|
|
36373
37495
|
}));
|
|
@@ -36570,11 +37692,11 @@ var S3VectorsProvider = class {
|
|
|
36570
37692
|
}
|
|
36571
37693
|
if (!resourceArn) throw new ProvisioningError(`Could not resolve ARN for S3 VectorBucket ${logicalId} (${physicalId}); cannot apply tag update.`, resourceType, logicalId, physicalId);
|
|
36572
37694
|
try {
|
|
36573
|
-
if (Object.keys(toSet).length > 0) await this.getClient().send(new TagResourceCommand$
|
|
37695
|
+
if (Object.keys(toSet).length > 0) await this.getClient().send(new TagResourceCommand$21({
|
|
36574
37696
|
resourceArn,
|
|
36575
37697
|
tags: toSet
|
|
36576
37698
|
}));
|
|
36577
|
-
if (toRemove.length > 0) await this.getClient().send(new UntagResourceCommand$
|
|
37699
|
+
if (toRemove.length > 0) await this.getClient().send(new UntagResourceCommand$21({
|
|
36578
37700
|
resourceArn,
|
|
36579
37701
|
tagKeys: toRemove
|
|
36580
37702
|
}));
|
|
@@ -36702,7 +37824,7 @@ var S3VectorsProvider = class {
|
|
|
36702
37824
|
if (Object.keys(enc).length > 0) result["EncryptionConfiguration"] = enc;
|
|
36703
37825
|
}
|
|
36704
37826
|
if (bucket?.vectorBucketArn) try {
|
|
36705
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
37827
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$20({ resourceArn: bucket.vectorBucketArn }))).tags);
|
|
36706
37828
|
} catch (err) {
|
|
36707
37829
|
this.logger.debug(`S3Vectors ListTagsForResource(${bucket.vectorBucketArn}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
36708
37830
|
result["Tags"] = [];
|
|
@@ -36738,7 +37860,7 @@ var S3VectorsProvider = class {
|
|
|
36738
37860
|
for (const bucket of list.vectorBuckets ?? []) {
|
|
36739
37861
|
if (!bucket.vectorBucketName || !bucket.vectorBucketArn) continue;
|
|
36740
37862
|
try {
|
|
36741
|
-
if ((await this.getClient().send(new ListTagsForResourceCommand$
|
|
37863
|
+
if ((await this.getClient().send(new ListTagsForResourceCommand$20({ resourceArn: bucket.vectorBucketArn }))).tags?.["aws:cdk:path"] === input.cdkPath) return {
|
|
36742
37864
|
physicalId: bucket.vectorBucketName,
|
|
36743
37865
|
attributes: {}
|
|
36744
37866
|
};
|
|
@@ -37348,7 +38470,7 @@ var S3TablesProvider = class {
|
|
|
37348
38470
|
attributes: {}
|
|
37349
38471
|
};
|
|
37350
38472
|
if (input.cdkPath) try {
|
|
37351
|
-
if ((await this.getClient().send(new ListTagsForResourceCommand$
|
|
38473
|
+
if ((await this.getClient().send(new ListTagsForResourceCommand$21({ resourceArn: bucket.arn }))).tags?.["aws:cdk:path"] === input.cdkPath) return {
|
|
37352
38474
|
physicalId: bucket.arn,
|
|
37353
38475
|
attributes: {}
|
|
37354
38476
|
};
|
|
@@ -37415,7 +38537,7 @@ var S3TablesProvider = class {
|
|
|
37415
38537
|
for (const table of tables.tables ?? []) {
|
|
37416
38538
|
if (!table.name || !table.tableARN) continue;
|
|
37417
38539
|
try {
|
|
37418
|
-
if ((await this.getClient().send(new ListTagsForResourceCommand$
|
|
38540
|
+
if ((await this.getClient().send(new ListTagsForResourceCommand$21({ resourceArn: table.tableARN }))).tags?.["aws:cdk:path"] === input.cdkPath) return {
|
|
37419
38541
|
physicalId: `${bucket.arn}|${namespaceName}|${table.name}`,
|
|
37420
38542
|
attributes: {}
|
|
37421
38543
|
};
|
|
@@ -37511,7 +38633,7 @@ var S3TablesProvider = class {
|
|
|
37511
38633
|
*/
|
|
37512
38634
|
async readTagsBestEffort(resourceArn) {
|
|
37513
38635
|
try {
|
|
37514
|
-
const tags = (await this.getClient().send(new ListTagsForResourceCommand$
|
|
38636
|
+
const tags = (await this.getClient().send(new ListTagsForResourceCommand$21({ resourceArn }))).tags ?? {};
|
|
37515
38637
|
const out = [];
|
|
37516
38638
|
for (const [Key, Value] of Object.entries(tags)) out.push({
|
|
37517
38639
|
Key,
|
|
@@ -37565,7 +38687,7 @@ var S3TablesProvider = class {
|
|
|
37565
38687
|
const resourceArn = await this.lookupTableArn(tableBucketARN, namespace, name);
|
|
37566
38688
|
if (!resourceArn) throw new ProvisioningError(`applyTableTagsDiff: GetTable returned no tableARN for ${physicalId} — table is gone or state is out-of-sync. Refusing to silently drop the tag update (run 'cdkd state orphan ${logicalId}' to clean up if the table was deleted out-of-band).`, resourceType, logicalId, physicalId);
|
|
37567
38689
|
if (removedKeys.length > 0) try {
|
|
37568
|
-
await this.getClient().send(new UntagResourceCommand$
|
|
38690
|
+
await this.getClient().send(new UntagResourceCommand$22({
|
|
37569
38691
|
resourceArn,
|
|
37570
38692
|
tagKeys: removedKeys
|
|
37571
38693
|
}));
|
|
@@ -37574,7 +38696,7 @@ var S3TablesProvider = class {
|
|
|
37574
38696
|
throw new ProvisioningError(`applyTableTagsDiff: UntagResource failed for ${resourceArn} (keys: ${removedKeys.join(", ")}): ${err instanceof Error ? err.message : String(err)}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
|
|
37575
38697
|
}
|
|
37576
38698
|
if (Object.keys(upserts).length > 0) try {
|
|
37577
|
-
await this.getClient().send(new TagResourceCommand$
|
|
38699
|
+
await this.getClient().send(new TagResourceCommand$22({
|
|
37578
38700
|
resourceArn,
|
|
37579
38701
|
tags: upserts
|
|
37580
38702
|
}));
|
|
@@ -37606,7 +38728,7 @@ var S3TablesProvider = class {
|
|
|
37606
38728
|
if (removedKeys.length === 0 && Object.keys(upserts).length === 0) return;
|
|
37607
38729
|
const resourceArn = physicalId;
|
|
37608
38730
|
if (removedKeys.length > 0) try {
|
|
37609
|
-
await this.getClient().send(new UntagResourceCommand$
|
|
38731
|
+
await this.getClient().send(new UntagResourceCommand$22({
|
|
37610
38732
|
resourceArn,
|
|
37611
38733
|
tagKeys: removedKeys
|
|
37612
38734
|
}));
|
|
@@ -37615,7 +38737,7 @@ var S3TablesProvider = class {
|
|
|
37615
38737
|
throw new ProvisioningError(`applyTableBucketTagsDiff: UntagResource failed for ${resourceArn} (keys: ${removedKeys.join(", ")}): ${err instanceof Error ? err.message : String(err)}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
|
|
37616
38738
|
}
|
|
37617
38739
|
if (Object.keys(upserts).length > 0) try {
|
|
37618
|
-
await this.getClient().send(new TagResourceCommand$
|
|
38740
|
+
await this.getClient().send(new TagResourceCommand$22({
|
|
37619
38741
|
resourceArn,
|
|
37620
38742
|
tags: upserts
|
|
37621
38743
|
}));
|
|
@@ -37798,11 +38920,11 @@ var ECRProvider = class {
|
|
|
37798
38920
|
if (repoArn) {
|
|
37799
38921
|
const newKeys = new Set((newTags ?? []).map((t) => t.Key).filter((k) => !!k));
|
|
37800
38922
|
const removedKeys = (oldTags ?? []).map((t) => t.Key).filter((k) => !!k && !newKeys.has(k));
|
|
37801
|
-
if (removedKeys.length > 0) await this.getClient().send(new UntagResourceCommand$
|
|
38923
|
+
if (removedKeys.length > 0) await this.getClient().send(new UntagResourceCommand$11({
|
|
37802
38924
|
resourceArn: repoArn,
|
|
37803
38925
|
tagKeys: removedKeys
|
|
37804
38926
|
}));
|
|
37805
|
-
if (newTags && newTags.length > 0) await this.getClient().send(new TagResourceCommand$
|
|
38927
|
+
if (newTags && newTags.length > 0) await this.getClient().send(new TagResourceCommand$11({
|
|
37806
38928
|
resourceArn: repoArn,
|
|
37807
38929
|
tags: newTags
|
|
37808
38930
|
}));
|
|
@@ -37901,7 +39023,7 @@ var ECRProvider = class {
|
|
|
37901
39023
|
if (!(err instanceof LifecyclePolicyNotFoundException)) throw err;
|
|
37902
39024
|
}
|
|
37903
39025
|
if (r.repositoryArn) try {
|
|
37904
|
-
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$
|
|
39026
|
+
result["Tags"] = normalizeAwsTagsToCfn((await this.getClient().send(new ListTagsForResourceCommand$8({ resourceArn: r.repositoryArn }))).tags);
|
|
37905
39027
|
} catch (err) {
|
|
37906
39028
|
if (!(err instanceof RepositoryNotFoundException)) throw err;
|
|
37907
39029
|
}
|
|
@@ -37934,7 +39056,7 @@ var ECRProvider = class {
|
|
|
37934
39056
|
for (const repo of list.repositories ?? []) {
|
|
37935
39057
|
if (!repo.repositoryArn || !repo.repositoryName) continue;
|
|
37936
39058
|
try {
|
|
37937
|
-
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$
|
|
39059
|
+
if (matchesCdkPath((await this.getClient().send(new ListTagsForResourceCommand$8({ resourceArn: repo.repositoryArn }))).tags, input.cdkPath)) return {
|
|
37938
39060
|
physicalId: repo.repositoryName,
|
|
37939
39061
|
attributes: {}
|
|
37940
39062
|
};
|
|
@@ -39236,6 +40358,9 @@ function registerAllProviders(registry) {
|
|
|
39236
40358
|
registry.register("AWS::ServiceDiscovery::PublicDnsNamespace", serviceDiscoveryProvider);
|
|
39237
40359
|
registry.register("AWS::ServiceDiscovery::Service", serviceDiscoveryProvider);
|
|
39238
40360
|
registry.register("AWS::BedrockAgentCore::Runtime", new AgentCoreRuntimeProvider());
|
|
40361
|
+
registry.register("AWS::BedrockAgentCore::Browser", new AgentCoreBrowserProvider());
|
|
40362
|
+
registry.register("AWS::BedrockAgentCore::CodeInterpreter", new AgentCoreCodeInterpreterProvider());
|
|
40363
|
+
registry.register("AWS::BedrockAgentCore::Evaluator", new AgentCoreEvaluatorProvider());
|
|
39239
40364
|
const appSyncProvider = new AppSyncProvider();
|
|
39240
40365
|
registry.register("AWS::AppSync::GraphQLApi", appSyncProvider);
|
|
39241
40366
|
registry.register("AWS::AppSync::GraphQLSchema", appSyncProvider);
|
|
@@ -39261,6 +40386,7 @@ function registerAllProviders(registry) {
|
|
|
39261
40386
|
registry.register("AWS::EFS::FileSystem", efsProvider);
|
|
39262
40387
|
registry.register("AWS::EFS::MountTarget", efsProvider);
|
|
39263
40388
|
registry.register("AWS::EFS::AccessPoint", efsProvider);
|
|
40389
|
+
registry.register("AWS::FSx::FileSystem", new FSxFileSystemProvider());
|
|
39264
40390
|
registry.register("AWS::KinesisFirehose::DeliveryStream", new FirehoseProvider());
|
|
39265
40391
|
registry.register("AWS::CloudTrail::Trail", new CloudTrailProvider());
|
|
39266
40392
|
registry.register("AWS::CodeBuild::Project", new CodeBuildProvider());
|
|
@@ -58539,7 +59665,7 @@ function reorderArgs(argv) {
|
|
|
58539
59665
|
async function main() {
|
|
58540
59666
|
installPipeCloseHandler();
|
|
58541
59667
|
const program = new Command();
|
|
58542
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
59668
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.244.0");
|
|
58543
59669
|
program.addCommand(createBootstrapCommand());
|
|
58544
59670
|
program.addCommand(createSynthCommand());
|
|
58545
59671
|
program.addCommand(createListCommand());
|