@go-to-k/cdkd 0.230.1 → 0.230.3
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 +209 -4
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-_N5kVjZN.js → deploy-engine-BGL0DPBv.js} +52 -6
- package/dist/deploy-engine-BGL0DPBv.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-_N5kVjZN.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { A as withErrorHandling, B as generateResourceName, C as StackHasActiveImportsError, F as getLiveRenderer, H as withSkipPrefix, I as PATTERN_B_NAME_OPTIONS, L as PATTERN_B_NAME_PROPERTIES, M as getLogger, P as runStackBuffered, R as PATTERN_B_RESOURCE_TYPES, S as ResourceUpdateNotSupportedError, U as withStackName, V as generateResourceNameWithFallback, _ as MissingCdkCliError, a as assertRegionMatch, b as ProvisioningError, f as LocalInvokeBuildError$1, i as resolveExplicitPhysicalId, k as normalizeAwsError, l as CdkdError, m as LocalStartServiceError, n as matchesCdkPath, o as disableInstanceApiTermination, p as LocalMigrateError, r as normalizeAwsTagsToCfn, s as isTerminationProtectionPropagationError, t as CDK_PATH_TAG, v as NestedStackChildDirectDestroyError, w as StackTerminationProtectionError, x as ResourceTimeoutError, y as PartialFailureError } from "./import-helpers-DayvBD4T.js";
|
|
3
3
|
import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-pjPwZz1r.js";
|
|
4
|
-
import { $ as CFN_TEMPLATE_BODY_LIMIT, A as LockManager, B as runDockerForeground, C as findActionableSilentDrops, D as DiffCalculator, E as applyRoleArnIfSet, F as stringifyValue, G as getDefaultStateBucketName, H as AssetManifestLoader, I as WorkGraph, J as resolveCaptureObservedState, K as getLegacyStateBucketName, L as buildDockerImage, M as rebuildClientForBucketRegion, N as shouldRetainResource, O as DagBuilder, P as AssetPublisher, Q as warnDeprecatedNoPrefixCliFlag, R as formatDockerLoginError, S as ProviderRegistry, T as IntrinsicFunctionResolver, U as getDockerImageBySourceHash, V as runDockerStreaming, W as Synthesizer, X as resolveStateBucketWithDefault, Y as resolveSkipPrefix, Z as resolveStateBucketWithDefaultAndSource, _ as green, a as withRetry, b as IAMRoleProvider, c as computeImplicitDeleteEdges, d as isStatefulRecreateTargetSync, et as CFN_TEMPLATE_URL_LIMIT, f as renderStatefulReason, g as gray, h as cyan, i as withResourceDeadline, it as AssemblyReader, j as S3StateBackend, k as TemplateParser, l as extractDeploymentEventError, m as bold, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as findLargeInlineResources, o as isRetryableTransientError, ot as resolveBucketRegion, p as formatResourceLine, q as resolveApp, r as DeployEngine, rt as uploadCfnTemplate, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as MIGRATE_TMP_PREFIX, u as MULTI_REGION_RECREATE_BLOCKED_TYPES, v as red, w as CloudControlProvider, x as collectInlinePolicyNamesManagedBySiblings, y as yellow, z as getDockerCmd } from "./deploy-engine-
|
|
4
|
+
import { $ as CFN_TEMPLATE_BODY_LIMIT, A as LockManager, B as runDockerForeground, C as findActionableSilentDrops, D as DiffCalculator, E as applyRoleArnIfSet, F as stringifyValue, G as getDefaultStateBucketName, H as AssetManifestLoader, I as WorkGraph, J as resolveCaptureObservedState, K as getLegacyStateBucketName, L as buildDockerImage, M as rebuildClientForBucketRegion, N as shouldRetainResource, O as DagBuilder, P as AssetPublisher, Q as warnDeprecatedNoPrefixCliFlag, R as formatDockerLoginError, S as ProviderRegistry, T as IntrinsicFunctionResolver, U as getDockerImageBySourceHash, V as runDockerStreaming, W as Synthesizer, X as resolveStateBucketWithDefault, Y as resolveSkipPrefix, Z as resolveStateBucketWithDefaultAndSource, _ as green, a as withRetry, b as IAMRoleProvider, c as computeImplicitDeleteEdges, d as isStatefulRecreateTargetSync, et as CFN_TEMPLATE_URL_LIMIT, f as renderStatefulReason, g as gray, h as cyan, i as withResourceDeadline, it as AssemblyReader, j as S3StateBackend, k as TemplateParser, l as extractDeploymentEventError, m as bold, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as findLargeInlineResources, o as isRetryableTransientError, ot as resolveBucketRegion, p as formatResourceLine, q as resolveApp, r as DeployEngine, rt as uploadCfnTemplate, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as MIGRATE_TMP_PREFIX, u as MULTI_REGION_RECREATE_BLOCKED_TYPES, v as red, w as CloudControlProvider, x as collectInlinePolicyNamesManagedBySiblings, y as yellow, z as getDockerCmd } from "./deploy-engine-BGL0DPBv.js";
|
|
5
5
|
import { t as ASGProvider } from "./asg-provider-Dgj3loIG.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -9,7 +9,7 @@ import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurat
|
|
|
9
9
|
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";
|
|
10
10
|
import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQueueUrlCommand, ListQueueTagsCommand, ListQueuesCommand, QueueDoesNotExist, SQSClient, SetQueueAttributesCommand, TagQueueCommand, UntagQueueCommand } from "@aws-sdk/client-sqs";
|
|
11
11
|
import { CreateTopicCommand, DeleteTopicCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, ListTagsForResourceCommand, ListTopicsCommand, NotFoundException, SNSClient, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand } from "@aws-sdk/client-sns";
|
|
12
|
-
import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionRecursionConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, LambdaClient, ListFunctionsCommand, ListLayersCommand, ListTagsCommand, PublishLayerVersionCommand, PutFunctionConcurrencyCommand, PutFunctionRecursionConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
|
|
12
|
+
import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionEventInvokeConfigCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionEventInvokeConfigCommand, GetFunctionRecursionConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, LambdaClient, ListFunctionsCommand, ListLayersCommand, 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";
|
|
13
13
|
import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
14
14
|
import { 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, DescribeAvailabilityZonesCommand, DescribeIamInstanceProfileAssociationsCommand, DescribeInstanceAttributeCommand, DescribeInstanceCreditSpecificationsCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DetachInternetGatewayCommand, DisassociateRouteTableCommand, EC2Client, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, MonitorInstancesCommand, ReplaceNetworkAclAssociationCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
|
|
15
15
|
import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DisableKinesisStreamingDestinationCommand, DynamoDBClient, EnableKinesisStreamingDestinationCommand, GetResourcePolicyCommand, ListTablesCommand, ListTagsOfResourceCommand, PutResourcePolicyCommand, ResourceNotFoundException as ResourceNotFoundException$1, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateContributorInsightsCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
|
|
@@ -1445,7 +1445,7 @@ const FLUSH_INTERVAL_MS = 2e3;
|
|
|
1445
1445
|
const FLUSH_EVENT_THRESHOLD = 50;
|
|
1446
1446
|
/** Build-time cdkd version, with a dev fallback for non-built contexts. */
|
|
1447
1447
|
function getCdkdVersion() {
|
|
1448
|
-
return "0.230.
|
|
1448
|
+
return "0.230.3";
|
|
1449
1449
|
}
|
|
1450
1450
|
/**
|
|
1451
1451
|
* Generate a time-sortable unique run id, e.g.
|
|
@@ -9661,6 +9661,210 @@ var LambdaLayerVersionProvider = class {
|
|
|
9661
9661
|
}
|
|
9662
9662
|
};
|
|
9663
9663
|
|
|
9664
|
+
//#endregion
|
|
9665
|
+
//#region src/provisioning/providers/lambda-event-invoke-config-provider.ts
|
|
9666
|
+
/**
|
|
9667
|
+
* AWS Lambda EventInvokeConfig Provider
|
|
9668
|
+
*
|
|
9669
|
+
* Implements provisioning for AWS::Lambda::EventInvokeConfig (the async-invoke
|
|
9670
|
+
* configuration CDK synthesizes whenever a Function sets `maxEventAge`,
|
|
9671
|
+
* `retryAttempts`, or `onFailure` / `onSuccess` destinations).
|
|
9672
|
+
*
|
|
9673
|
+
* WHY an SDK provider instead of the Cloud Control fallback:
|
|
9674
|
+
* `PutFunctionEventInvokeConfig` is a synchronous **full-replace** write —
|
|
9675
|
+
* exactly what CloudFormation uses for this type. The Cloud Control UPDATE
|
|
9676
|
+
* path instead applies a JSON-patch read-modify-write, and Lambda's
|
|
9677
|
+
* EventInvokeConfig read handler returns an AWS-injected empty
|
|
9678
|
+
* `DestinationConfig.OnSuccess: {}` even when only `OnFailure` was configured.
|
|
9679
|
+
* That empty object then fails Cloud Control model validation on every UPDATE
|
|
9680
|
+
* (`#/DestinationConfig/OnSuccess: required key [Destination] not found`), so a
|
|
9681
|
+
* common daily pattern — an async Lambda with `onFailure` whose `maxEventAge`
|
|
9682
|
+
* or `retryAttempts` is later changed — was undeployable via the CC route.
|
|
9683
|
+
* The full-replace SDK call sends exactly the template's DestinationConfig and
|
|
9684
|
+
* sidesteps the merge entirely.
|
|
9685
|
+
*
|
|
9686
|
+
* The physical id is the Cloud Control primaryIdentifier shape
|
|
9687
|
+
* `<FunctionName>|<Qualifier>` so import / migration stays consistent with the
|
|
9688
|
+
* prior CC-routed behavior.
|
|
9689
|
+
*/
|
|
9690
|
+
var LambdaEventInvokeConfigProvider = class {
|
|
9691
|
+
lambdaClient;
|
|
9692
|
+
logger = getLogger().child("LambdaEventInvokeConfigProvider");
|
|
9693
|
+
handledProperties = new Map([["AWS::Lambda::EventInvokeConfig", new Set([
|
|
9694
|
+
"FunctionName",
|
|
9695
|
+
"Qualifier",
|
|
9696
|
+
"MaximumEventAgeInSeconds",
|
|
9697
|
+
"MaximumRetryAttempts",
|
|
9698
|
+
"DestinationConfig"
|
|
9699
|
+
])]]);
|
|
9700
|
+
constructor() {
|
|
9701
|
+
const awsClients = getAwsClients();
|
|
9702
|
+
this.lambdaClient = awsClients.lambda;
|
|
9703
|
+
}
|
|
9704
|
+
/**
|
|
9705
|
+
* Compose the Cloud-Control-compatible compound physical id.
|
|
9706
|
+
*/
|
|
9707
|
+
buildPhysicalId(functionName, qualifier) {
|
|
9708
|
+
return `${functionName}|${qualifier}`;
|
|
9709
|
+
}
|
|
9710
|
+
/**
|
|
9711
|
+
* Split a `<FunctionName>|<Qualifier>` physical id back into its parts.
|
|
9712
|
+
* Tolerates a bare function name (defaults the qualifier to `$LATEST`).
|
|
9713
|
+
* Splits on the FIRST `|`, which is unambiguous: a Lambda function name is
|
|
9714
|
+
* `[a-zA-Z0-9-_]+` and a function ARN contains no `|`, so the separator can
|
|
9715
|
+
* never appear inside the FunctionName segment.
|
|
9716
|
+
*/
|
|
9717
|
+
parsePhysicalId(physicalId) {
|
|
9718
|
+
const sep = physicalId.indexOf("|");
|
|
9719
|
+
if (sep === -1) return {
|
|
9720
|
+
functionName: physicalId,
|
|
9721
|
+
qualifier: "$LATEST"
|
|
9722
|
+
};
|
|
9723
|
+
return {
|
|
9724
|
+
functionName: physicalId.slice(0, sep),
|
|
9725
|
+
qualifier: physicalId.slice(sep + 1)
|
|
9726
|
+
};
|
|
9727
|
+
}
|
|
9728
|
+
/**
|
|
9729
|
+
* Build the SDK DestinationConfig from CFn properties.
|
|
9730
|
+
*
|
|
9731
|
+
* Only emit a sub-key (`OnSuccess` / `OnFailure`) when the template actually
|
|
9732
|
+
* carries a `Destination` for it — never send an empty `{}`, which is the
|
|
9733
|
+
* exact shape that fails the type's model validation.
|
|
9734
|
+
*/
|
|
9735
|
+
buildDestinationConfig(raw) {
|
|
9736
|
+
if (!raw) return void 0;
|
|
9737
|
+
const config = {};
|
|
9738
|
+
const onSuccess = raw["OnSuccess"];
|
|
9739
|
+
if (onSuccess && typeof onSuccess["Destination"] === "string") config.OnSuccess = { Destination: onSuccess["Destination"] };
|
|
9740
|
+
const onFailure = raw["OnFailure"];
|
|
9741
|
+
if (onFailure && typeof onFailure["Destination"] === "string") config.OnFailure = { Destination: onFailure["Destination"] };
|
|
9742
|
+
return Object.keys(config).length > 0 ? config : void 0;
|
|
9743
|
+
}
|
|
9744
|
+
buildPutInput(properties) {
|
|
9745
|
+
const functionName = properties["FunctionName"];
|
|
9746
|
+
const qualifier = properties["Qualifier"] ?? "$LATEST";
|
|
9747
|
+
const input = { FunctionName: functionName };
|
|
9748
|
+
if (qualifier !== "$LATEST") input.Qualifier = qualifier;
|
|
9749
|
+
if (properties["MaximumEventAgeInSeconds"] !== void 0) input.MaximumEventAgeInSeconds = Number(properties["MaximumEventAgeInSeconds"]);
|
|
9750
|
+
if (properties["MaximumRetryAttempts"] !== void 0) input.MaximumRetryAttempts = Number(properties["MaximumRetryAttempts"]);
|
|
9751
|
+
const dest = this.buildDestinationConfig(properties["DestinationConfig"]);
|
|
9752
|
+
if (dest) input.DestinationConfig = dest;
|
|
9753
|
+
return input;
|
|
9754
|
+
}
|
|
9755
|
+
async create(logicalId, resourceType, properties) {
|
|
9756
|
+
this.logger.debug(`Creating Lambda EventInvokeConfig ${logicalId}`);
|
|
9757
|
+
const functionName = properties["FunctionName"];
|
|
9758
|
+
if (!functionName) throw new ProvisioningError(`FunctionName is required for Lambda EventInvokeConfig ${logicalId}`, resourceType, logicalId);
|
|
9759
|
+
const qualifier = properties["Qualifier"] ?? "$LATEST";
|
|
9760
|
+
try {
|
|
9761
|
+
await this.lambdaClient.send(new PutFunctionEventInvokeConfigCommand(this.buildPutInput(properties)));
|
|
9762
|
+
const physicalId = this.buildPhysicalId(functionName, qualifier);
|
|
9763
|
+
this.logger.debug(`Successfully created Lambda EventInvokeConfig ${logicalId}: ${physicalId}`);
|
|
9764
|
+
return {
|
|
9765
|
+
physicalId,
|
|
9766
|
+
attributes: {}
|
|
9767
|
+
};
|
|
9768
|
+
} catch (error) {
|
|
9769
|
+
const cause = error instanceof Error ? error : void 0;
|
|
9770
|
+
throw new ProvisioningError(`Failed to create Lambda EventInvokeConfig ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, functionName, cause);
|
|
9771
|
+
}
|
|
9772
|
+
}
|
|
9773
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
9774
|
+
this.logger.debug(`Updating Lambda EventInvokeConfig ${logicalId}: ${physicalId}`);
|
|
9775
|
+
const handled = this.handledProperties.get("AWS::Lambda::EventInvokeConfig") ?? /* @__PURE__ */ new Set();
|
|
9776
|
+
let changed = false;
|
|
9777
|
+
for (const key of handled) if (JSON.stringify(properties[key] ?? null) !== JSON.stringify(previousProperties[key] ?? null)) {
|
|
9778
|
+
changed = true;
|
|
9779
|
+
break;
|
|
9780
|
+
}
|
|
9781
|
+
if (!changed) return {
|
|
9782
|
+
physicalId,
|
|
9783
|
+
wasReplaced: false,
|
|
9784
|
+
attributes: {}
|
|
9785
|
+
};
|
|
9786
|
+
try {
|
|
9787
|
+
await this.lambdaClient.send(new PutFunctionEventInvokeConfigCommand(this.buildPutInput(properties)));
|
|
9788
|
+
this.logger.debug(`Successfully updated Lambda EventInvokeConfig ${logicalId}`);
|
|
9789
|
+
return {
|
|
9790
|
+
physicalId,
|
|
9791
|
+
wasReplaced: false,
|
|
9792
|
+
attributes: {}
|
|
9793
|
+
};
|
|
9794
|
+
} catch (error) {
|
|
9795
|
+
const cause = error instanceof Error ? error : void 0;
|
|
9796
|
+
throw new ProvisioningError(`Failed to update Lambda EventInvokeConfig ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
9797
|
+
}
|
|
9798
|
+
}
|
|
9799
|
+
async delete(logicalId, physicalId, resourceType, _properties, context) {
|
|
9800
|
+
this.logger.debug(`Deleting Lambda EventInvokeConfig ${logicalId}: ${physicalId}`);
|
|
9801
|
+
const { functionName, qualifier } = this.parsePhysicalId(physicalId);
|
|
9802
|
+
const deleteInput = { FunctionName: functionName };
|
|
9803
|
+
if (qualifier !== "$LATEST") deleteInput.Qualifier = qualifier;
|
|
9804
|
+
try {
|
|
9805
|
+
await this.lambdaClient.send(new DeleteFunctionEventInvokeConfigCommand(deleteInput));
|
|
9806
|
+
this.logger.debug(`Successfully deleted Lambda EventInvokeConfig ${logicalId}`);
|
|
9807
|
+
} catch (error) {
|
|
9808
|
+
if (error instanceof ResourceNotFoundException) {
|
|
9809
|
+
assertRegionMatch(await this.lambdaClient.config.region(), context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
9810
|
+
this.logger.debug(`Lambda EventInvokeConfig ${physicalId} does not exist, skipping deletion`);
|
|
9811
|
+
return;
|
|
9812
|
+
}
|
|
9813
|
+
const cause = error instanceof Error ? error : void 0;
|
|
9814
|
+
throw new ProvisioningError(`Failed to delete Lambda EventInvokeConfig ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
|
|
9815
|
+
}
|
|
9816
|
+
}
|
|
9817
|
+
/**
|
|
9818
|
+
* AWS::Lambda::EventInvokeConfig exposes no `Fn::GetAtt` return values, so
|
|
9819
|
+
* there is nothing to resolve. Present for interface completeness / orphan
|
|
9820
|
+
* rewrites.
|
|
9821
|
+
*/
|
|
9822
|
+
async getAttribute(_physicalId, _resourceType, _attributeName) {}
|
|
9823
|
+
/**
|
|
9824
|
+
* Read the AWS-current async-invoke configuration in CFn-property shape for
|
|
9825
|
+
* `cdkd drift`. Surfaces only the keys cdkd writes; the AWS-injected empty
|
|
9826
|
+
* `DestinationConfig.OnSuccess: {}` is dropped so a config set with only
|
|
9827
|
+
* `OnFailure` does not show phantom drift.
|
|
9828
|
+
*/
|
|
9829
|
+
async readCurrentState(physicalId, _logicalId, _resourceType) {
|
|
9830
|
+
const { functionName, qualifier } = this.parsePhysicalId(physicalId);
|
|
9831
|
+
let resp;
|
|
9832
|
+
try {
|
|
9833
|
+
const input = { FunctionName: functionName };
|
|
9834
|
+
if (qualifier !== "$LATEST") input.Qualifier = qualifier;
|
|
9835
|
+
resp = await this.lambdaClient.send(new GetFunctionEventInvokeConfigCommand(input));
|
|
9836
|
+
} catch (err) {
|
|
9837
|
+
if (err instanceof ResourceNotFoundException) return void 0;
|
|
9838
|
+
throw err;
|
|
9839
|
+
}
|
|
9840
|
+
const result = {
|
|
9841
|
+
FunctionName: functionName,
|
|
9842
|
+
Qualifier: qualifier
|
|
9843
|
+
};
|
|
9844
|
+
if (resp.MaximumEventAgeInSeconds !== void 0) result["MaximumEventAgeInSeconds"] = resp.MaximumEventAgeInSeconds;
|
|
9845
|
+
if (resp.MaximumRetryAttempts !== void 0) result["MaximumRetryAttempts"] = resp.MaximumRetryAttempts;
|
|
9846
|
+
const dest = {};
|
|
9847
|
+
if (resp.DestinationConfig?.OnSuccess?.Destination) dest["OnSuccess"] = { Destination: resp.DestinationConfig.OnSuccess.Destination };
|
|
9848
|
+
if (resp.DestinationConfig?.OnFailure?.Destination) dest["OnFailure"] = { Destination: resp.DestinationConfig.OnFailure.Destination };
|
|
9849
|
+
if (Object.keys(dest).length > 0) result["DestinationConfig"] = dest;
|
|
9850
|
+
return result;
|
|
9851
|
+
}
|
|
9852
|
+
/**
|
|
9853
|
+
* Adopt an existing EventInvokeConfig into cdkd state.
|
|
9854
|
+
*
|
|
9855
|
+
* **Explicit override only.** The config attaches to a function/qualifier and
|
|
9856
|
+
* has no standalone identity or `aws:cdk:path` tag to look up. Users pass
|
|
9857
|
+
* `--resource <logicalId>=<FunctionName>|<Qualifier>`.
|
|
9858
|
+
*/
|
|
9859
|
+
async import(input) {
|
|
9860
|
+
if (input.knownPhysicalId) return {
|
|
9861
|
+
physicalId: input.knownPhysicalId,
|
|
9862
|
+
attributes: {}
|
|
9863
|
+
};
|
|
9864
|
+
return null;
|
|
9865
|
+
}
|
|
9866
|
+
};
|
|
9867
|
+
|
|
9664
9868
|
//#endregion
|
|
9665
9869
|
//#region src/provisioning/providers/dynamodb-table-provider.ts
|
|
9666
9870
|
/**
|
|
@@ -36503,6 +36707,7 @@ function registerAllProviders(registry) {
|
|
|
36503
36707
|
registry.register("AWS::Lambda::Url", new LambdaUrlProvider());
|
|
36504
36708
|
registry.register("AWS::Lambda::EventSourceMapping", new LambdaEventSourceMappingProvider());
|
|
36505
36709
|
registry.register("AWS::Lambda::LayerVersion", new LambdaLayerVersionProvider());
|
|
36710
|
+
registry.register("AWS::Lambda::EventInvokeConfig", new LambdaEventInvokeConfigProvider());
|
|
36506
36711
|
registry.register("AWS::DynamoDB::Table", new DynamoDBTableProvider());
|
|
36507
36712
|
registry.register("AWS::DynamoDB::GlobalTable", new DynamoDBGlobalTableProvider());
|
|
36508
36713
|
registry.register("AWS::Logs::LogGroup", new LogsLogGroupProvider());
|
|
@@ -54990,7 +55195,7 @@ function reorderArgs(argv) {
|
|
|
54990
55195
|
async function main() {
|
|
54991
55196
|
installPipeCloseHandler();
|
|
54992
55197
|
const program = new Command();
|
|
54993
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.230.
|
|
55198
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.230.3");
|
|
54994
55199
|
program.addCommand(createBootstrapCommand());
|
|
54995
55200
|
program.addCommand(createSynthCommand());
|
|
54996
55201
|
program.addCommand(createListCommand());
|