@go-to-k/cdkd 0.187.0 → 0.188.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { _ as withSkipPrefix, a as runDockerStreaming, c as getLogger, d as getLiveRenderer, f as PATTERN_B_NAME_PROPERTIES, g as generateResourceNameWithFallback, h as generateResourceName, i as runDockerForeground, n as formatDockerLoginError, p as PATTERN_B_RESOURCE_TYPES, r as getDockerCmd, u as runStackBuffered, v as withStackName } from "./docker-cmd-iDMcWcre.js";
|
|
3
|
-
import { A as S3StateBackend, B as resolveCaptureObservedState, C as assertRegionMatch, D as DagBuilder, E as DiffCalculator, F as buildDockerImage, G as CFN_TEMPLATE_BODY_LIMIT, H as resolveStateBucketWithDefault, I as Synthesizer, J as findLargeInlineResources, K as CFN_TEMPLATE_URL_LIMIT, L as getDefaultStateBucketName, M as AssetPublisher, N as stringifyValue, O as TemplateParser, P as WorkGraph, Q as resolveBucketRegion, R as getLegacyStateBucketName, S as CloudControlProvider, T as applyRoleArnIfSet, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as warnDeprecatedNoPrefixCliFlag, X as AssemblyReader, Y as uploadCfnTemplate, _ as matchesCdkPath, a as withRetry, at as LocalStartServiceError, b as ProviderRegistry, bt as withErrorHandling, c as bold, ct as NestedStackChildDirectDestroyError, d as green, dt as ResourceTimeoutError, et as CdkdError, f as red, ft as ResourceUpdateNotSupportedError, g as CDK_PATH_TAG, h as collectInlinePolicyNamesManagedBySiblings, i as withResourceDeadline, it as LocalMigrateError, j as shouldRetainResource, k as LockManager, l as cyan, lt as PartialFailureError, m as IAMRoleProvider, mt as StackTerminationProtectionError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as IMPLICIT_DELETE_DEPENDENCIES, p as yellow, pt as StackHasActiveImportsError, q as MIGRATE_TMP_PREFIX, r as DeployEngine, rt as LocalInvokeBuildError$1, s as formatResourceLine, st as MissingCdkCliError, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as gray, ut as ProvisioningError, v as normalizeAwsTagsToCfn, w as IntrinsicFunctionResolver, x as findActionableSilentDrops, y as resolveExplicitPhysicalId, yt as normalizeAwsError, z as resolveApp } from "./deploy-engine-
|
|
3
|
+
import { A as S3StateBackend, B as resolveCaptureObservedState, C as assertRegionMatch, D as DagBuilder, E as DiffCalculator, F as buildDockerImage, G as CFN_TEMPLATE_BODY_LIMIT, H as resolveStateBucketWithDefault, I as Synthesizer, J as findLargeInlineResources, K as CFN_TEMPLATE_URL_LIMIT, L as getDefaultStateBucketName, M as AssetPublisher, N as stringifyValue, O as TemplateParser, P as WorkGraph, Q as resolveBucketRegion, R as getLegacyStateBucketName, S as CloudControlProvider, T as applyRoleArnIfSet, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as warnDeprecatedNoPrefixCliFlag, X as AssemblyReader, Y as uploadCfnTemplate, _ as matchesCdkPath, a as withRetry, at as LocalStartServiceError, b as ProviderRegistry, bt as withErrorHandling, c as bold, ct as NestedStackChildDirectDestroyError, d as green, dt as ResourceTimeoutError, et as CdkdError, f as red, ft as ResourceUpdateNotSupportedError, g as CDK_PATH_TAG, h as collectInlinePolicyNamesManagedBySiblings, i as withResourceDeadline, it as LocalMigrateError, j as shouldRetainResource, k as LockManager, l as cyan, lt as PartialFailureError, m as IAMRoleProvider, mt as StackTerminationProtectionError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as IMPLICIT_DELETE_DEPENDENCIES, p as yellow, pt as StackHasActiveImportsError, q as MIGRATE_TMP_PREFIX, r as DeployEngine, rt as LocalInvokeBuildError$1, s as formatResourceLine, st as MissingCdkCliError, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as gray, ut as ProvisioningError, v as normalizeAwsTagsToCfn, w as IntrinsicFunctionResolver, x as findActionableSilentDrops, y as resolveExplicitPhysicalId, yt as normalizeAwsError, z as resolveApp } from "./deploy-engine-DxpaX6py.js";
|
|
4
4
|
import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-B15NAPbL.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -8,7 +8,7 @@ import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurat
|
|
|
8
8
|
import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListInstanceProfilesCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, ListUserTagsCommand, ListUsersCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateLoginProfileCommand } from "@aws-sdk/client-iam";
|
|
9
9
|
import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQueueUrlCommand, ListQueueTagsCommand, ListQueuesCommand, QueueDoesNotExist, SQSClient, SetQueueAttributesCommand, TagQueueCommand, UntagQueueCommand } from "@aws-sdk/client-sqs";
|
|
10
10
|
import { CreateTopicCommand, DeleteTopicCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, ListTagsForResourceCommand, ListTopicsCommand, NotFoundException, SNSClient, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand } from "@aws-sdk/client-sns";
|
|
11
|
-
import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, LambdaClient, ListFunctionsCommand, ListLayersCommand, ListTagsCommand, PublishLayerVersionCommand, 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, DeleteFunctionCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCommand, GetFunctionRecursionConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, LambdaClient, ListFunctionsCommand, ListLayersCommand, ListTagsCommand, PublishLayerVersionCommand, PutFunctionRecursionConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
|
|
12
12
|
import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
13
13
|
import { AssociateRouteTableCommand, AttachInternetGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAvailabilityZonesCommand, DescribeInstanceAttributeCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DetachInternetGatewayCommand, DisassociateRouteTableCommand, EC2Client, ModifyInstanceAttributeCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ReplaceNetworkAclAssociationCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, TerminateInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
|
|
14
14
|
import { CreateTableCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DynamoDBClient, ListTablesCommand, ListTagsOfResourceCommand, ResourceNotFoundException as ResourceNotFoundException$1, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
|
|
@@ -415,12 +415,12 @@ const RESOURCE_PROPERTY_FORMAT = /^[A-Z][A-Za-z0-9]+(::[A-Z][A-Za-z0-9]+)+:[A-Z]
|
|
|
415
415
|
function parseAllowUnsupportedPropertiesToken(value, previous) {
|
|
416
416
|
const parsed = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
417
417
|
for (const token of parsed) {
|
|
418
|
-
if (!RESOURCE_PROPERTY_FORMAT.test(token)) throw new Error(`Invalid --allow-unsupported-properties value "${token}": expected <ResourceType>:<PropertyName> with PascalCase on both halves (e.g. AWS::Lambda::Function:
|
|
418
|
+
if (!RESOURCE_PROPERTY_FORMAT.test(token)) throw new Error(`Invalid --allow-unsupported-properties value "${token}": expected <ResourceType>:<PropertyName> with PascalCase on both halves (e.g. AWS::Lambda::Function:RuntimeManagementConfig).`);
|
|
419
419
|
if (token.startsWith("Custom::")) throw new Error(`Invalid --allow-unsupported-properties value "${token}": Custom:: resources are routed through cfn-response and have no write-side silent drop at cdkd, so the flag would have no effect. Use --allow-unsupported-types for type-level escape hatches instead.`);
|
|
420
420
|
}
|
|
421
421
|
return [...previous ?? [], ...parsed];
|
|
422
422
|
}
|
|
423
|
-
const allowUnsupportedPropertiesOption = new Option("--allow-unsupported-properties <entries>", "Comma-separated <ResourceType>:<PropertyName> tokens to accept as silently dropped at deploy time. Escape hatch — the property will NOT be written to AWS, the deployed resource will be missing the field. Example: --allow-unsupported-properties AWS::Lambda::Function:
|
|
423
|
+
const allowUnsupportedPropertiesOption = new Option("--allow-unsupported-properties <entries>", "Comma-separated <ResourceType>:<PropertyName> tokens to accept as silently dropped at deploy time. Escape hatch — the property will NOT be written to AWS, the deployed resource will be missing the field. Example: --allow-unsupported-properties AWS::Lambda::Function:RuntimeManagementConfig,AWS::RDS::DBInstance:CACertificateIdentifier").argParser(parseAllowUnsupportedPropertiesToken);
|
|
424
424
|
/**
|
|
425
425
|
* Issue [#615] — `--recreate-via-cc-api <LogicalId>` (repeatable). Each
|
|
426
426
|
* named resource is destroyed + recreated this deploy via Cloud Control
|
|
@@ -1089,8 +1089,8 @@ function renderStatefulReason(reason) {
|
|
|
1089
1089
|
* this is a structural limitation, not a data-loss footgun.
|
|
1090
1090
|
*
|
|
1091
1091
|
* Plus one cross-flag invariant: `--recreate-via-cc-api MyLambda`
|
|
1092
|
-
* combined with `--allow-unsupported-properties AWS::Lambda::Function:
|
|
1093
|
-
* on a resource whose template carries `
|
|
1092
|
+
* combined with `--allow-unsupported-properties AWS::Lambda::Function:RuntimeManagementConfig`
|
|
1093
|
+
* on a resource whose template carries `RuntimeManagementConfig` is **ambiguous
|
|
1094
1094
|
* intent** — does the user want SDK + silent drop, or CC migration?
|
|
1095
1095
|
* Fail fast and let the user pick one strategy per resource.
|
|
1096
1096
|
*/
|
|
@@ -7053,7 +7053,8 @@ var LambdaFunctionProvider = class {
|
|
|
7053
7053
|
"FileSystemConfigs",
|
|
7054
7054
|
"ImageConfig",
|
|
7055
7055
|
"SnapStart",
|
|
7056
|
-
"LoggingConfig"
|
|
7056
|
+
"LoggingConfig",
|
|
7057
|
+
"RecursiveLoop"
|
|
7057
7058
|
])]]);
|
|
7058
7059
|
eniWaitTimeoutMs = 600 * 1e3;
|
|
7059
7060
|
eniWaitInitialDelayMs = 1e4;
|
|
@@ -7109,6 +7110,21 @@ var LambdaFunctionProvider = class {
|
|
|
7109
7110
|
Tags: tags
|
|
7110
7111
|
};
|
|
7111
7112
|
const response = await this.lambdaClient.send(new CreateFunctionCommand(createParams));
|
|
7113
|
+
const recursiveLoop = properties["RecursiveLoop"];
|
|
7114
|
+
if (recursiveLoop !== void 0) try {
|
|
7115
|
+
await this.lambdaClient.send(new PutFunctionRecursionConfigCommand({
|
|
7116
|
+
FunctionName: functionName,
|
|
7117
|
+
RecursiveLoop: recursiveLoop
|
|
7118
|
+
}));
|
|
7119
|
+
} catch (rlError) {
|
|
7120
|
+
this.logger.warn(`PutFunctionRecursionConfig failed for ${logicalId}: ${rlError instanceof Error ? rlError.message : String(rlError)} — deleting partially-created function to maintain atomicity`);
|
|
7121
|
+
try {
|
|
7122
|
+
await this.lambdaClient.send(new DeleteFunctionCommand({ FunctionName: functionName }));
|
|
7123
|
+
} catch (deleteError) {
|
|
7124
|
+
this.logger.error(`Cleanup DeleteFunction failed for ${logicalId} after PutFunctionRecursionConfig failure — function may be orphaned: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`);
|
|
7125
|
+
}
|
|
7126
|
+
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);
|
|
7127
|
+
}
|
|
7112
7128
|
this.logger.debug(`Successfully created Lambda function ${logicalId}: ${functionName}`);
|
|
7113
7129
|
return {
|
|
7114
7130
|
physicalId: response.FunctionName || functionName,
|
|
@@ -7193,6 +7209,15 @@ var LambdaFunctionProvider = class {
|
|
|
7193
7209
|
this.logger.debug(`Updated code for Lambda function ${physicalId}`);
|
|
7194
7210
|
await this.waitForFunctionUpdated(logicalId, resourceType, physicalId);
|
|
7195
7211
|
}
|
|
7212
|
+
const newRecursiveLoop = properties["RecursiveLoop"];
|
|
7213
|
+
const prevRecursiveLoop = previousProperties["RecursiveLoop"];
|
|
7214
|
+
if (newRecursiveLoop !== void 0 && newRecursiveLoop !== prevRecursiveLoop) {
|
|
7215
|
+
await this.lambdaClient.send(new PutFunctionRecursionConfigCommand({
|
|
7216
|
+
FunctionName: physicalId,
|
|
7217
|
+
RecursiveLoop: newRecursiveLoop
|
|
7218
|
+
}));
|
|
7219
|
+
this.logger.debug(`Updated RecursiveLoop for Lambda function ${physicalId} to '${newRecursiveLoop}'`);
|
|
7220
|
+
}
|
|
7196
7221
|
const getResponse = await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }));
|
|
7197
7222
|
const functionArn = getResponse.Configuration?.FunctionArn;
|
|
7198
7223
|
await this.applyTagDiff(functionArn, previousProperties["Tags"], properties["Tags"]);
|
|
@@ -7712,6 +7737,12 @@ var LambdaFunctionProvider = class {
|
|
|
7712
7737
|
result["LoggingConfig"] = lc;
|
|
7713
7738
|
}
|
|
7714
7739
|
result["Tags"] = normalizeAwsTagsToCfn(resp.Tags);
|
|
7740
|
+
try {
|
|
7741
|
+
const rlResp = await this.lambdaClient.send(new GetFunctionRecursionConfigCommand({ FunctionName: physicalId }));
|
|
7742
|
+
if (rlResp.RecursiveLoop !== void 0) result["RecursiveLoop"] = rlResp.RecursiveLoop;
|
|
7743
|
+
} catch (rlErr) {
|
|
7744
|
+
if (!(rlErr instanceof ResourceNotFoundException)) this.logger.debug(`GetFunctionRecursionConfig failed for ${physicalId}: ${rlErr instanceof Error ? rlErr.message : String(rlErr)}`);
|
|
7745
|
+
}
|
|
7715
7746
|
return result;
|
|
7716
7747
|
} catch (err) {
|
|
7717
7748
|
if (err instanceof ResourceNotFoundException) return void 0;
|
|
@@ -35583,7 +35614,7 @@ const EMPTY_ALLOW_SET = /* @__PURE__ */ new Set();
|
|
|
35583
35614
|
*
|
|
35584
35615
|
* - **Fresh hits**: a resource whose template uses one or more
|
|
35585
35616
|
* silent-drop top-level CFn properties. Annotation value is the list
|
|
35586
|
-
* of property names (e.g. `
|
|
35617
|
+
* of property names (e.g. `RuntimeManagementConfig`).
|
|
35587
35618
|
* - **Sticky hits**: a resource whose deployed state records
|
|
35588
35619
|
* `provisionedBy: 'cc-api'` (from a prior deploy) even when the
|
|
35589
35620
|
* current template's silent-drop set is empty. Annotation value is
|
|
@@ -51563,7 +51594,7 @@ function reorderArgs(argv) {
|
|
|
51563
51594
|
*/
|
|
51564
51595
|
async function main() {
|
|
51565
51596
|
const program = new Command();
|
|
51566
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
51597
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.188.0");
|
|
51567
51598
|
program.addCommand(createBootstrapCommand());
|
|
51568
51599
|
program.addCommand(createSynthCommand());
|
|
51569
51600
|
program.addCommand(createListCommand());
|