Description
Describe the bug
I'm using AwsCustomResource
from typescipt to perform an AwsSdkCall
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
- Select this option if this issue appears to be a regression.
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
new AwsCustomResource(this, 'UpdateCluster', {
timeout: cdk.Duration.minutes(1),
installLatestAwsSdk: false,
onUpdate: {
service: '@aws-sdk/client-memorydb',
action: 'UpdateCluster',
parameters: {
ClusterName: <REPLACE_WITH_MEMORYDB_CLUSTER_NAME>,
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: ['*'],
}),
]),
});
}
Possible Solution
The entry here
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