@go-to-k/cdkd 0.280.15 → 0.280.16
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/{asg-provider-BRvHsDmu.js → asg-provider-4pPwAL_v.js} +2 -2
- package/dist/{asg-provider-BRvHsDmu.js.map → asg-provider-4pPwAL_v.js.map} +1 -1
- package/dist/cli.js +174 -35
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-CJPLgh5z.js → deploy-engine-1eZqhWKB.js} +42 -11
- package/dist/deploy-engine-1eZqhWKB.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-CJPLgh5z.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as requireConfigString, $t as processStackMessages, A as red, At as runDockerStreaming, B as isTerminationProtectionPropagationError, Bt as resolveSkipPrefix, C as isStatefulRecreateTargetSync, Ct as parseBootstrapMarker, D as cyan, Dn as normalizeAwsError, Dt as formatDockerLoginError, E as bold, Et as buildDockerImage, F as ProviderRegistry, Ft as getDefaultStateBucketName, G as normalizeAwsTagsToCfn, Gt as warnDeprecatedNoPrefixCliFlag, H as cfnRefValueFromPhysicalId, Ht as resolveStateBucketWithDefaultAndSource, I as findActionableSilentDrops, It as getLegacyStateBucketName, J as configStringRefusal, Jt as MIGRATE_TMP_PREFIX, K as resolveExplicitPhysicalId, Kt as CFN_TEMPLATE_BODY_LIMIT, L as CloudControlProvider, Lt as resolveApp, M as IAMRoleProvider, Mt as getDockerImageBySourceHash, N as collectInlinePolicyNamesManagedBySiblings, Nt as Synthesizer, O as gray, On as withErrorHandling, Ot as getDockerCmd, P as clearOnUpdateRemoval, Pt as synthesisStatusMessage, Q as requireConfigObject, Qt as AssemblyReader, R as slowCcOperationTimeoutMs, Rt as resolveAutoAssetStorage, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, Sn as StackTerminationProtectionError, St as getBootstrapMarkerKey, T as formatResourceLine, Tt as validateContainerRepoName, U as refStateLookupFromResource, Ut as resolveUseCdkBootstrapAssets, V as IntrinsicFunctionResolver, Vt as resolveStateBucketWithDefault, W as WAFv2WebACLProvider, Wt as stateBucketExistenceConfirmed, X as replayWarn, Xt as uploadCfnTemplate, Y as readConfigString, Yt as findLargeInlineResources, Z as requireConfigArray, Zt as expectedOwnerParam, _ as createPreDeleteFinalSnapshot, _n as PartialFailureError, _t as loadPublishableAssetManifest, a as DeploymentEventsStore, an as setAwsClients, at as isThrottlingError, b as unsupportedFinalSnapshotError, bn as ResourceUpdateNotSupportedError, bt as BOOTSTRAP_MARKER_PREFIX, c as replayFailedOperations, ct as LockManager, d as IMPLICIT_DELETE_DEPENDENCIES, dn as LocalInvokeBuildError$1, dt as shouldRetainResource, et as applyRoleArnIfSet, f as computeImplicitDeleteEdges, fn as LocalMigrateError, ft as AssetPublisher, g as ccRoutedFinalSnapshotError, gn as NestedStackChildDirectDestroyError, gt as createAssetRedirectResolver, h as buildFinalSnapshotIdentifier, hn as MissingCdkCliError, ht as buildAssetRedirectMap, i as DeploymentEventsReader, in as resetAwsClients, it as isRetryableTransientError, j as yellow, jt as AssetManifestLoader, k as green, kt as runDockerForeground, l as replayRollback, lt as S3StateBackend, m as PRE_DELETE_SNAPSHOT_TYPES, mt as WorkGraph, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as AwsClients, nt as describeTypeWithThrottleRetry, o as planFailedOps, ot as DagBuilder, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as LocalStartServiceError, pt as stringifyValue, q as assertRegionMatch, qt as CFN_TEMPLATE_URL_LIMIT, r as DeployEngine, rn as getAwsClients, rt as withRetry, s as planRollback, sn as CdkdError, st as TemplateParser, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as resolveBucketRegion, tt as DiffCalculator, u as withResourceDeadline, un as DeployCancelledError, ut as rebuildClientForBucketRegion, v as isFinalSnapshotError, vn as ProvisioningError, vt as rewriteTemplateAssetReferences, w as renderStatefulReason, wt as validateAssetBucketName, x as extractDeploymentEventError, xn as StackHasActiveImportsError, xt as ensureAssetStorage, y as refusesFinalSnapshot, yn as ResourceTimeoutError, yt as AssetModeResolver, z as disableInstanceApiTermination, zt as resolveCaptureObservedState } from "./deploy-engine-
|
|
2
|
+
import { $ as requireConfigString, $t as processStackMessages, A as red, At as runDockerStreaming, B as isTerminationProtectionPropagationError, Bt as resolveSkipPrefix, C as isStatefulRecreateTargetSync, Ct as parseBootstrapMarker, D as cyan, Dn as normalizeAwsError, Dt as formatDockerLoginError, E as bold, Et as buildDockerImage, F as ProviderRegistry, Ft as getDefaultStateBucketName, G as normalizeAwsTagsToCfn, Gt as warnDeprecatedNoPrefixCliFlag, H as cfnRefValueFromPhysicalId, Ht as resolveStateBucketWithDefaultAndSource, I as findActionableSilentDrops, It as getLegacyStateBucketName, J as configStringRefusal, Jt as MIGRATE_TMP_PREFIX, K as resolveExplicitPhysicalId, Kt as CFN_TEMPLATE_BODY_LIMIT, L as CloudControlProvider, Lt as resolveApp, M as IAMRoleProvider, Mt as getDockerImageBySourceHash, N as collectInlinePolicyNamesManagedBySiblings, Nt as Synthesizer, O as gray, On as withErrorHandling, Ot as getDockerCmd, P as clearOnUpdateRemoval, Pt as synthesisStatusMessage, Q as requireConfigObject, Qt as AssemblyReader, R as slowCcOperationTimeoutMs, Rt as resolveAutoAssetStorage, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, Sn as StackTerminationProtectionError, St as getBootstrapMarkerKey, T as formatResourceLine, Tt as validateContainerRepoName, U as refStateLookupFromResource, Ut as resolveUseCdkBootstrapAssets, V as IntrinsicFunctionResolver, Vt as resolveStateBucketWithDefault, W as WAFv2WebACLProvider, Wt as stateBucketExistenceConfirmed, X as replayWarn, Xt as uploadCfnTemplate, Y as readConfigString, Yt as findLargeInlineResources, Z as requireConfigArray, Zt as expectedOwnerParam, _ as createPreDeleteFinalSnapshot, _n as PartialFailureError, _t as loadPublishableAssetManifest, a as DeploymentEventsStore, an as setAwsClients, at as isThrottlingError, b as unsupportedFinalSnapshotError, bn as ResourceUpdateNotSupportedError, bt as BOOTSTRAP_MARKER_PREFIX, c as replayFailedOperations, ct as LockManager, d as IMPLICIT_DELETE_DEPENDENCIES, dn as LocalInvokeBuildError$1, dt as shouldRetainResource, et as applyRoleArnIfSet, f as computeImplicitDeleteEdges, fn as LocalMigrateError, ft as AssetPublisher, g as ccRoutedFinalSnapshotError, gn as NestedStackChildDirectDestroyError, gt as createAssetRedirectResolver, h as buildFinalSnapshotIdentifier, hn as MissingCdkCliError, ht as buildAssetRedirectMap, i as DeploymentEventsReader, in as resetAwsClients, it as isRetryableTransientError, j as yellow, jt as AssetManifestLoader, k as green, kt as runDockerForeground, l as replayRollback, lt as S3StateBackend, m as PRE_DELETE_SNAPSHOT_TYPES, mt as WorkGraph, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as AwsClients, nt as describeTypeWithThrottleRetry, o as planFailedOps, ot as DagBuilder, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as LocalStartServiceError, pt as stringifyValue, q as assertRegionMatch, qt as CFN_TEMPLATE_URL_LIMIT, r as DeployEngine, rn as getAwsClients, rt as withRetry, s as planRollback, sn as CdkdError, st as TemplateParser, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as resolveBucketRegion, tt as DiffCalculator, u as withResourceDeadline, un as DeployCancelledError, ut as rebuildClientForBucketRegion, v as isFinalSnapshotError, vn as ProvisioningError, vt as rewriteTemplateAssetReferences, w as renderStatefulReason, wt as validateAssetBucketName, x as extractDeploymentEventError, xn as StackHasActiveImportsError, xt as ensureAssetStorage, y as refusesFinalSnapshot, yn as ResourceTimeoutError, yt as AssetModeResolver, z as disableInstanceApiTermination, zt as resolveCaptureObservedState } from "./deploy-engine-1eZqhWKB.js";
|
|
3
3
|
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-BYMEE-BS.js";
|
|
4
|
-
import { t as ASGProvider } from "./asg-provider-
|
|
4
|
+
import { t as ASGProvider } from "./asg-provider-4pPwAL_v.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
7
7
|
import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
8
8
|
import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRoleCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateAccessKeyCommand, UpdateLoginProfileCommand } from "@aws-sdk/client-iam";
|
|
9
9
|
import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQueueUrlCommand, ListQueueTagsCommand, QueueDoesNotExist, SQSClient, SetQueueAttributesCommand, TagQueueCommand, UntagQueueCommand } from "@aws-sdk/client-sqs";
|
|
10
10
|
import { CreateTopicCommand, DeleteTopicCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, InvalidParameterException, ListSubscriptionsByTopicCommand, ListTagsForResourceCommand, ListTopicsCommand, NotFoundException, SNSClient, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand } from "@aws-sdk/client-sns";
|
|
11
|
-
import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionEventInvokeConfigCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionEventInvokeConfigCommand, GetFunctionRecursionConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, LambdaClient, ListTagsCommand, PublishLayerVersionCommand, PutFunctionConcurrencyCommand, PutFunctionEventInvokeConfigCommand, PutFunctionRecursionConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
|
|
11
|
+
import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCodeSigningConfigCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionEventInvokeConfigCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCodeSigningConfigCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionEventInvokeConfigCommand, GetFunctionRecursionConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, GetRuntimeManagementConfigCommand, LambdaClient, ListTagsCommand, PublishLayerVersionCommand, PutFunctionCodeSigningConfigCommand, PutFunctionConcurrencyCommand, PutFunctionEventInvokeConfigCommand, PutFunctionRecursionConfigCommand, PutRuntimeManagementConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionActiveV2, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
|
|
12
12
|
import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
13
13
|
import { AllocateAddressCommand, AssociateAddressCommand, AssociateIamInstanceProfileCommand, AssociateRouteTableCommand, AttachInternetGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAddressesCommand, DescribeAvailabilityZonesCommand, DescribeIamInstanceProfileAssociationsCommand, DescribeInstanceAttributeCommand, DescribeInstanceCreditSpecificationsCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DetachInternetGatewayCommand, DisassociateAddressCommand, DisassociateRouteTableCommand, EC2Client, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, MonitorInstancesCommand, ReleaseAddressCommand, ReplaceNetworkAclAssociationCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
|
|
14
14
|
import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DisableKinesisStreamingDestinationCommand, DynamoDBClient, EnableKinesisStreamingDestinationCommand, GetResourcePolicyCommand, ListTagsOfResourceCommand, PutResourcePolicyCommand, ResourceNotFoundException as ResourceNotFoundException$1, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateContributorInsightsCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
|
|
@@ -9028,6 +9028,13 @@ function isSnsTopicArnList(value) {
|
|
|
9028
9028
|
//#endregion
|
|
9029
9029
|
//#region src/provisioning/providers/lambda-function-provider.ts
|
|
9030
9030
|
/**
|
|
9031
|
+
* Attempts the create path's atomicity cleanup makes when DeleteFunction is
|
|
9032
|
+
* refused because the function is still settling. Three attempts with the
|
|
9033
|
+
* linear backoff in `cleanupDeleteRetryDelayMs` covers the few seconds a
|
|
9034
|
+
* `Pending` -> terminal transition takes without stalling a failed deploy.
|
|
9035
|
+
*/
|
|
9036
|
+
const LAMBDA_CLEANUP_DELETE_MAX_ATTEMPTS = 3;
|
|
9037
|
+
/**
|
|
9031
9038
|
* Pick the inline-code filename for a Lambda runtime.
|
|
9032
9039
|
*
|
|
9033
9040
|
* CloudFormation's `Code.ZipFile` auto-zips inline code into a file named
|
|
@@ -9078,8 +9085,28 @@ var LambdaFunctionProvider = class {
|
|
|
9078
9085
|
"SnapStart",
|
|
9079
9086
|
"LoggingConfig",
|
|
9080
9087
|
"RecursiveLoop",
|
|
9081
|
-
"ReservedConcurrentExecutions"
|
|
9088
|
+
"ReservedConcurrentExecutions",
|
|
9089
|
+
"CodeSigningConfigArn",
|
|
9090
|
+
"RuntimeManagementConfig",
|
|
9091
|
+
"DurableConfig",
|
|
9092
|
+
"TenancyConfig"
|
|
9082
9093
|
])]]);
|
|
9094
|
+
/**
|
|
9095
|
+
* Properties the provider deliberately does NOT wire (issue #391 /
|
|
9096
|
+
* see `ResourceProvider.unhandledByDesign`).
|
|
9097
|
+
*
|
|
9098
|
+
* `CapacityProviderConfig` / `FunctionScalingConfig` are deliberately NOT
|
|
9099
|
+
* here — they stay in `silentDrop` (pre-flight rejection with the
|
|
9100
|
+
* `--allow-unsupported-properties` escape hatch) rather than being declared
|
|
9101
|
+
* un-wirable, because they ARE wirable once Lambda managed instances are
|
|
9102
|
+
* supported. They are one coupled feature: `PutFunctionScalingConfig` fails
|
|
9103
|
+
* with `AccessDeniedException: The function provided by the arn does not
|
|
9104
|
+
* contain a capacity provider configuration` unless the function already
|
|
9105
|
+
* carries a capacity provider (live-probed us-east-1, 2026-08-11). Tracked
|
|
9106
|
+
* in issue #1616.
|
|
9107
|
+
*/
|
|
9108
|
+
unhandledByDesign = /* @__PURE__ */ new Map([["AWS::Lambda::Function", /* @__PURE__ */ new Map([["PublishToLatestPublished", "CloudFormation-only version-publishing directive with no AWS SDK equivalent"]])]]);
|
|
9109
|
+
cleanupDeleteRetryDelayMs = 2e3;
|
|
9083
9110
|
eniWaitTimeoutMs = 600 * 1e3;
|
|
9084
9111
|
eniWaitInitialDelayMs = 1e4;
|
|
9085
9112
|
eniWaitMaxDelayMs = 1e4;
|
|
@@ -9131,39 +9158,50 @@ var LambdaFunctionProvider = class {
|
|
|
9131
9158
|
ImageConfig: properties["ImageConfig"],
|
|
9132
9159
|
SnapStart: properties["SnapStart"],
|
|
9133
9160
|
LoggingConfig: properties["LoggingConfig"],
|
|
9161
|
+
DurableConfig: properties["DurableConfig"],
|
|
9162
|
+
TenancyConfig: properties["TenancyConfig"],
|
|
9163
|
+
CodeSigningConfigArn: properties["CodeSigningConfigArn"],
|
|
9134
9164
|
Tags: tags
|
|
9135
9165
|
};
|
|
9136
9166
|
const response = await this.lambdaClient.send(new CreateFunctionCommand(createParams));
|
|
9137
9167
|
const recursiveLoop = properties["RecursiveLoop"];
|
|
9138
|
-
if (recursiveLoop !== void 0)
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
this.logger.error(`Cleanup DeleteFunction failed for ${logicalId} after PutFunctionRecursionConfig failure — function may be orphaned: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`);
|
|
9149
|
-
}
|
|
9150
|
-
throw new ProvisioningError(`Failed to set RecursiveLoop on Lambda function ${logicalId} (function was deleted to maintain atomicity): ${rlError instanceof Error ? rlError.message : String(rlError)}`, resourceType, logicalId, functionName, rlError instanceof Error ? rlError : void 0);
|
|
9151
|
-
}
|
|
9168
|
+
if (recursiveLoop !== void 0) await this.applyPostCreateConfig(() => this.lambdaClient.send(new PutFunctionRecursionConfigCommand({
|
|
9169
|
+
FunctionName: functionName,
|
|
9170
|
+
RecursiveLoop: recursiveLoop
|
|
9171
|
+
})), {
|
|
9172
|
+
apiName: "PutFunctionRecursionConfig",
|
|
9173
|
+
propertyName: "RecursiveLoop",
|
|
9174
|
+
logicalId,
|
|
9175
|
+
resourceType,
|
|
9176
|
+
functionName
|
|
9177
|
+
});
|
|
9152
9178
|
const reservedConcurrentExecutions = properties["ReservedConcurrentExecutions"];
|
|
9153
|
-
if (reservedConcurrentExecutions !== void 0)
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9179
|
+
if (reservedConcurrentExecutions !== void 0) await this.applyPostCreateConfig(() => this.lambdaClient.send(new PutFunctionConcurrencyCommand({
|
|
9180
|
+
FunctionName: functionName,
|
|
9181
|
+
ReservedConcurrentExecutions: reservedConcurrentExecutions
|
|
9182
|
+
})), {
|
|
9183
|
+
apiName: "PutFunctionConcurrency",
|
|
9184
|
+
propertyName: "ReservedConcurrentExecutions",
|
|
9185
|
+
logicalId,
|
|
9186
|
+
resourceType,
|
|
9187
|
+
functionName
|
|
9188
|
+
});
|
|
9189
|
+
const runtimeManagementConfig = properties["RuntimeManagementConfig"];
|
|
9190
|
+
if (runtimeManagementConfig !== void 0) await this.applyPostCreateConfig(async () => {
|
|
9191
|
+
await waitUntilFunctionActiveV2({
|
|
9192
|
+
client: this.lambdaClient,
|
|
9193
|
+
maxWaitTime: this.functionUpdateMaxWaitSeconds,
|
|
9194
|
+
minDelay: 1,
|
|
9195
|
+
maxDelay: 5
|
|
9196
|
+
}, { FunctionName: functionName });
|
|
9197
|
+
await this.putRuntimeManagementConfig(functionName, runtimeManagementConfig);
|
|
9198
|
+
}, {
|
|
9199
|
+
apiName: "PutRuntimeManagementConfig",
|
|
9200
|
+
propertyName: "RuntimeManagementConfig",
|
|
9201
|
+
logicalId,
|
|
9202
|
+
resourceType,
|
|
9203
|
+
functionName
|
|
9204
|
+
});
|
|
9167
9205
|
this.logger.debug(`Successfully created Lambda function ${logicalId}: ${functionName}`);
|
|
9168
9206
|
return {
|
|
9169
9207
|
physicalId: response.FunctionName || functionName,
|
|
@@ -9178,6 +9216,63 @@ var LambdaFunctionProvider = class {
|
|
|
9178
9216
|
}
|
|
9179
9217
|
}
|
|
9180
9218
|
/**
|
|
9219
|
+
* Run a post-create control-plane call under the create path's atomicity
|
|
9220
|
+
* contract: on failure, DELETE the just-created function so the next deploy
|
|
9221
|
+
* retry sees a fresh slate instead of an orphan that already exists.
|
|
9222
|
+
*
|
|
9223
|
+
* Extracted from the (previously duplicated) `RecursiveLoop` /
|
|
9224
|
+
* `ReservedConcurrentExecutions` blocks when `RuntimeManagementConfig`
|
|
9225
|
+
* became the third caller — the wording of all three log lines and of the
|
|
9226
|
+
* thrown error is preserved verbatim, parameterized only by the API name
|
|
9227
|
+
* and the CFn property name.
|
|
9228
|
+
*
|
|
9229
|
+
* VPC-attached Lambda caveat (unchanged): the cleanup uses a bare
|
|
9230
|
+
* `DeleteFunction`, not the provider's own `delete()`, so hyperplane ENIs
|
|
9231
|
+
* are NOT pre-detached / awaited. For a VPC-attached function whose call
|
|
9232
|
+
* fails, the next deploy retry's downstream Subnet/SG creation can race the
|
|
9233
|
+
* asynchronous ENI release until AWS finishes the detach. The "concurrent
|
|
9234
|
+
* update operation" substring is preserved in the wrapped error message so
|
|
9235
|
+
* the outer `withRetry` classifier still retries cleanly.
|
|
9236
|
+
*/
|
|
9237
|
+
async applyPostCreateConfig(send, ctx) {
|
|
9238
|
+
try {
|
|
9239
|
+
await send();
|
|
9240
|
+
} catch (error) {
|
|
9241
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
9242
|
+
this.logger.warn(`${ctx.apiName} failed for ${ctx.logicalId}: ${message} — deleting partially-created function to maintain atomicity`);
|
|
9243
|
+
let cleanupFailure;
|
|
9244
|
+
for (let attempt = 0; attempt < LAMBDA_CLEANUP_DELETE_MAX_ATTEMPTS; attempt++) try {
|
|
9245
|
+
await this.lambdaClient.send(new DeleteFunctionCommand({ FunctionName: ctx.functionName }));
|
|
9246
|
+
cleanupFailure = void 0;
|
|
9247
|
+
break;
|
|
9248
|
+
} catch (deleteError) {
|
|
9249
|
+
const deleteMessage = deleteError instanceof Error ? deleteError.message : String(deleteError);
|
|
9250
|
+
cleanupFailure = deleteMessage;
|
|
9251
|
+
if (!/currently in the following state|ResourceConflict/i.test(deleteMessage)) break;
|
|
9252
|
+
if (attempt < LAMBDA_CLEANUP_DELETE_MAX_ATTEMPTS - 1) await new Promise((resolve) => setTimeout(resolve, this.cleanupDeleteRetryDelayMs * (attempt + 1)));
|
|
9253
|
+
}
|
|
9254
|
+
if (cleanupFailure !== void 0) this.logger.error(`Cleanup DeleteFunction failed for ${ctx.logicalId} after ${ctx.apiName} failure — function may be orphaned: ${cleanupFailure}`);
|
|
9255
|
+
throw new ProvisioningError(`Failed to set ${ctx.propertyName} on Lambda function ${ctx.logicalId} (function was deleted to maintain atomicity): ${message}`, ctx.resourceType, ctx.logicalId, ctx.functionName, error instanceof Error ? error : void 0);
|
|
9256
|
+
}
|
|
9257
|
+
}
|
|
9258
|
+
/**
|
|
9259
|
+
* Send the CFn `RuntimeManagementConfig` block to `PutRuntimeManagementConfig`.
|
|
9260
|
+
*
|
|
9261
|
+
* CFn spells the block `{ UpdateRuntimeOn, RuntimeVersionArn }` and the SDK
|
|
9262
|
+
* request carries the same two members flat on the request (plus the
|
|
9263
|
+
* function name), so this is a straight lift rather than a re-shape.
|
|
9264
|
+
* `UpdateRuntimeOn` is required by the API; a template that omits it is
|
|
9265
|
+
* refused by AWS with its own validation error, which is the behavior we
|
|
9266
|
+
* want to surface rather than paper over with a cdkd-invented default.
|
|
9267
|
+
*/
|
|
9268
|
+
async putRuntimeManagementConfig(functionName, config) {
|
|
9269
|
+
await this.lambdaClient.send(new PutRuntimeManagementConfigCommand({
|
|
9270
|
+
FunctionName: functionName,
|
|
9271
|
+
UpdateRuntimeOn: config["UpdateRuntimeOn"],
|
|
9272
|
+
RuntimeVersionArn: config["RuntimeVersionArn"]
|
|
9273
|
+
}));
|
|
9274
|
+
}
|
|
9275
|
+
/**
|
|
9181
9276
|
* Update a Lambda function
|
|
9182
9277
|
*/
|
|
9183
9278
|
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
@@ -9200,7 +9295,8 @@ var LambdaFunctionProvider = class {
|
|
|
9200
9295
|
"FileSystemConfigs",
|
|
9201
9296
|
"ImageConfig",
|
|
9202
9297
|
"SnapStart",
|
|
9203
|
-
"LoggingConfig"
|
|
9298
|
+
"LoggingConfig",
|
|
9299
|
+
"DurableConfig"
|
|
9204
9300
|
];
|
|
9205
9301
|
let hasConfigChanges = false;
|
|
9206
9302
|
for (const field of configFields) if (JSON.stringify(properties[field]) !== JSON.stringify(previousProperties[field])) {
|
|
@@ -9226,12 +9322,19 @@ var LambdaFunctionProvider = class {
|
|
|
9226
9322
|
FileSystemConfigs: clearOnUpdateRemoval(properties["FileSystemConfigs"], previousProperties["FileSystemConfigs"], []),
|
|
9227
9323
|
ImageConfig: clearOnUpdateRemoval(properties["ImageConfig"], previousProperties["ImageConfig"], {}),
|
|
9228
9324
|
SnapStart: clearOnUpdateRemoval(properties["SnapStart"], previousProperties["SnapStart"], { ApplyOn: "None" }),
|
|
9229
|
-
LoggingConfig: clearOnUpdateRemoval(properties["LoggingConfig"], previousProperties["LoggingConfig"], { LogFormat: "Text" })
|
|
9325
|
+
LoggingConfig: clearOnUpdateRemoval(properties["LoggingConfig"], previousProperties["LoggingConfig"], { LogFormat: "Text" }),
|
|
9326
|
+
DurableConfig: properties["DurableConfig"]
|
|
9230
9327
|
};
|
|
9231
9328
|
await this.lambdaClient.send(new UpdateFunctionConfigurationCommand(configParams));
|
|
9232
9329
|
this.logger.debug(`Updated configuration for Lambda function ${physicalId}`);
|
|
9233
9330
|
await this.waitForFunctionUpdated(logicalId, resourceType, physicalId);
|
|
9234
9331
|
}
|
|
9332
|
+
const newCodeSigningConfigArn = properties["CodeSigningConfigArn"];
|
|
9333
|
+
const codeSigningChanged = newCodeSigningConfigArn !== previousProperties["CodeSigningConfigArn"];
|
|
9334
|
+
if (codeSigningChanged && newCodeSigningConfigArn === void 0) {
|
|
9335
|
+
await this.lambdaClient.send(new DeleteFunctionCodeSigningConfigCommand({ FunctionName: physicalId }));
|
|
9336
|
+
this.logger.debug(`Detached CodeSigningConfigArn from Lambda function ${physicalId} (template removed the property)`);
|
|
9337
|
+
}
|
|
9235
9338
|
const newCode = properties["Code"];
|
|
9236
9339
|
const oldCode = previousProperties["Code"];
|
|
9237
9340
|
const normalizeArchitectures = (v) => Array.isArray(v) && v.length > 0 ? v : ["x86_64"];
|
|
@@ -9271,6 +9374,19 @@ var LambdaFunctionProvider = class {
|
|
|
9271
9374
|
}));
|
|
9272
9375
|
this.logger.debug(`Updated ReservedConcurrentExecutions for Lambda function ${physicalId} to ${newReservedConcurrentExecutions}`);
|
|
9273
9376
|
}
|
|
9377
|
+
if (codeSigningChanged && newCodeSigningConfigArn !== void 0) {
|
|
9378
|
+
await this.lambdaClient.send(new PutFunctionCodeSigningConfigCommand({
|
|
9379
|
+
FunctionName: physicalId,
|
|
9380
|
+
CodeSigningConfigArn: newCodeSigningConfigArn
|
|
9381
|
+
}));
|
|
9382
|
+
this.logger.debug(`Updated CodeSigningConfigArn for Lambda function ${physicalId} to ${newCodeSigningConfigArn}`);
|
|
9383
|
+
}
|
|
9384
|
+
const newRuntimeManagementConfig = properties["RuntimeManagementConfig"];
|
|
9385
|
+
const prevRuntimeManagementConfig = previousProperties["RuntimeManagementConfig"];
|
|
9386
|
+
if (newRuntimeManagementConfig?.["UpdateRuntimeOn"] !== prevRuntimeManagementConfig?.["UpdateRuntimeOn"] || newRuntimeManagementConfig?.["RuntimeVersionArn"] !== prevRuntimeManagementConfig?.["RuntimeVersionArn"]) {
|
|
9387
|
+
await this.putRuntimeManagementConfig(physicalId, newRuntimeManagementConfig ?? { UpdateRuntimeOn: "Auto" });
|
|
9388
|
+
this.logger.debug(`Updated RuntimeManagementConfig for Lambda function ${physicalId} to ${JSON.stringify(newRuntimeManagementConfig ?? { UpdateRuntimeOn: "Auto" })}`);
|
|
9389
|
+
}
|
|
9274
9390
|
const getResponse = await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }));
|
|
9275
9391
|
const functionArn = getResponse.Configuration?.FunctionArn;
|
|
9276
9392
|
await this.applyTagDiff(functionArn, previousProperties["Tags"], properties["Tags"]);
|
|
@@ -9795,6 +9911,13 @@ var LambdaFunctionProvider = class {
|
|
|
9795
9911
|
if (cfg.LoggingConfig.LogGroup !== void 0) lc["LogGroup"] = cfg.LoggingConfig.LogGroup;
|
|
9796
9912
|
result["LoggingConfig"] = lc;
|
|
9797
9913
|
}
|
|
9914
|
+
if (cfg.DurableConfig !== void 0) {
|
|
9915
|
+
const dc = {};
|
|
9916
|
+
if (cfg.DurableConfig.ExecutionTimeout !== void 0) dc["ExecutionTimeout"] = cfg.DurableConfig.ExecutionTimeout;
|
|
9917
|
+
if (cfg.DurableConfig.RetentionPeriodInDays !== void 0) dc["RetentionPeriodInDays"] = cfg.DurableConfig.RetentionPeriodInDays;
|
|
9918
|
+
if (Object.keys(dc).length > 0) result["DurableConfig"] = dc;
|
|
9919
|
+
}
|
|
9920
|
+
if (cfg.TenancyConfig?.TenantIsolationMode !== void 0) result["TenancyConfig"] = { TenantIsolationMode: cfg.TenancyConfig.TenantIsolationMode };
|
|
9798
9921
|
result["Tags"] = normalizeAwsTagsToCfn(resp.Tags);
|
|
9799
9922
|
try {
|
|
9800
9923
|
const rlResp = await this.lambdaClient.send(new GetFunctionRecursionConfigCommand({ FunctionName: physicalId }));
|
|
@@ -9808,6 +9931,22 @@ var LambdaFunctionProvider = class {
|
|
|
9808
9931
|
} catch (pcErr) {
|
|
9809
9932
|
if (!(pcErr instanceof ResourceNotFoundException)) this.logger.debug(`GetFunctionConcurrency failed for ${physicalId}: ${pcErr instanceof Error ? pcErr.message : String(pcErr)}`);
|
|
9810
9933
|
}
|
|
9934
|
+
try {
|
|
9935
|
+
const rmResp = await this.lambdaClient.send(new GetRuntimeManagementConfigCommand({ FunctionName: physicalId }));
|
|
9936
|
+
if (rmResp.UpdateRuntimeOn !== void 0) {
|
|
9937
|
+
const rm = { UpdateRuntimeOn: rmResp.UpdateRuntimeOn };
|
|
9938
|
+
if (rmResp.RuntimeVersionArn !== void 0) rm["RuntimeVersionArn"] = rmResp.RuntimeVersionArn;
|
|
9939
|
+
result["RuntimeManagementConfig"] = rm;
|
|
9940
|
+
}
|
|
9941
|
+
} catch (rmErr) {
|
|
9942
|
+
if (!(rmErr instanceof ResourceNotFoundException)) this.logger.warn(`GetRuntimeManagementConfig failed for ${physicalId} — RuntimeManagementConfig omitted from the drift snapshot (may surface as a false removal): ${rmErr instanceof Error ? rmErr.message : String(rmErr)}`);
|
|
9943
|
+
}
|
|
9944
|
+
try {
|
|
9945
|
+
const csResp = await this.lambdaClient.send(new GetFunctionCodeSigningConfigCommand({ FunctionName: physicalId }));
|
|
9946
|
+
if (csResp.CodeSigningConfigArn !== void 0) result["CodeSigningConfigArn"] = csResp.CodeSigningConfigArn;
|
|
9947
|
+
} catch (csErr) {
|
|
9948
|
+
if (!(csErr instanceof ResourceNotFoundException)) this.logger.warn(`GetFunctionCodeSigningConfig failed for ${physicalId} — CodeSigningConfigArn omitted from the drift snapshot (may surface as a false removal): ${csErr instanceof Error ? csErr.message : String(csErr)}`);
|
|
9949
|
+
}
|
|
9811
9950
|
return result;
|
|
9812
9951
|
} catch (err) {
|
|
9813
9952
|
if (err instanceof ResourceNotFoundException) return void 0;
|
|
@@ -69280,7 +69419,7 @@ function createMigrateCommand() {
|
|
|
69280
69419
|
*/
|
|
69281
69420
|
function buildProgram() {
|
|
69282
69421
|
const program = new Command();
|
|
69283
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.280.
|
|
69422
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.280.16");
|
|
69284
69423
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
69285
69424
|
const { profile } = actionCommand.optsWithGlobals();
|
|
69286
69425
|
if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
|