-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(custom-resources): Package @aws-sdk/client-memory-db does not exist #31755
Comments
Reproducible using code below: import * as cdk from 'aws-cdk-lib';
import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from 'aws-cdk-lib/custom-resources';
export class CdktestStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new AwsCustomResource(this, 'UpdateCluster', {
timeout: cdk.Duration.minutes(1),
installLatestAwsSdk: false,
onUpdate: {
service: '@aws-sdk/client-memorydb',
action: 'UpdateCluster',
parameters: {
ClusterName: 'test-memorydb-cluster',
Engine: 'Valkey',
},
physicalResourceId: PhysicalResourceId.of(`${id}-${this.node.addr.slice(0, 16)}`),
},
policy: AwsCustomResourcePolicy.fromStatements([
new cdk.aws_iam.PolicyStatement({
effect: cdk.aws_iam.Effect.ALLOW,
actions: ['memorydb:UpdateCluster'],
resources: ['*'],
}),
]),
});
}
} Deploying it using
Findings:
|
Looks like the below files are auto-generated from scripts/update-sdkv3-parameters-model.ts:
Per script update-sdkv3-parameters-model.sh, it appears to download https://github.com/aws/aws-sdk-js-v3/archive/refs/heads/main.zip. This file appears to be archived (even though it's downloadable). The EDIT: Looks like there is more to it. writeV2ToV3Mapping() reads aws-sdk-js-codemod/dist/transforms/v2-to-v3/config/CLIENT_PACKAGE_NAMES_MAP, which is replacing Bug aws/aws-sdk-js-codemod#949 opened. It's fixed via PR aws/aws-sdk-js-codemod#951 and released in aws-sdk-js-codemod 2.3.3. Running |
Possible PR contribution steps:
|
Describe the bug
I'm using
AwsCustomResource
from typescipt to perform anAwsSdkCall
with the memorydb service. I set the
AwsSdkCall.service
to be '@aws-sdk/client-memorydb' when creating the custom resource. However this server gets incorrectly mapped to '@aws-sdk/client-memory-db' for which no package exists.This causes the deployment of the custom resource to fail.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The custom resource should deploy successfully
Current Behavior
The deployment fails with error message from the lambda
Error: Package @aws-sdk/client-memory-db does not exist.
at qe (/var/task/index.js:1:125653)
at Object.De (/var/task/index.js:1:126372)
at le (/var/task/index.js:1:127784)
at Runtime.He [as handler] (/var/task/index.js:1:127887)
at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1173:29)
Reproduction Steps
Use this custom resource construct to reproduce
Possible Solution
The entry here
aws-cdk/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-v2-to-v3.json
Line 94 in 78a7182
appears to be incorrect. The package name in AWS Javascript SDK v3 for MemoryDB is " @aws-sdk/client-memorydb" and not
"@aws-sdk/client-memory-db"
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/memorydb/
Additional Information/Context
No response
CDK CLI Version
2.155.0
Framework Version
No response
Node.js Version
v20
OS
MacOSX
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: