-
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
aws-lambda: currentVersion
Version already exists
#28252
Comments
@pahud it worked today with the code unchanged. I think there's some weirdness with the underlying Lambda api. A colleague was also able to reproduce this intermittent error. |
Hi @pahud , has there been an update on this issue? |
No. Did you mean the code below deployed in 2.84.0 will fail when you upgrade to 2.113.0 ? const lambda = new NodejsFunction(this, "lambda", {...})
const lambdaAlias = new Alias(this, "LambdaAlias", {
aliasName: "prod",
version: lambda.currentVersion, // this seems to be the problem
})
myApi.addRoutes({
integration: new HttpLambdaIntegration("id", lambdaAlias),
path: "/url",
}) I just tested the simplified sample below. Deployed in export class DemoStack extends MyStack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
const fn = getLambdaFunction(this); // return a dummy lambda func
new lambda.Alias(this, "LambdaAlias", {
aliasName: "prod",
version: fn.currentVersion, // this seems to be the problem
})
}
} Then, upgrade to Now, I updated the lambda code and run
And then I run |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the bug
Upgraded
aws-cdk-lib
to2.113.0
. NowAWS::Lambda::Version
will throw this error when the current version already exists.Expected Behavior
Deployment should succeed like before.
Current Behavior
Throw this error when trying to update the lambda version
Reproduction Steps
Make sure
aws-cdk-lib
is at2.113.0
.Possible Solution
No response
Additional Information/Context
aws-cdk-lib
from2.84.0
to2.113.0
@aws-cdk/aws-apigatewayv2-integrations-alpha
withaws-cdk-lib/aws-apigatewayv2-integrations
forHttpLambdaIntegration
because it'd been GA and alpha has now been deprecated.CDK CLI Version
2.113.0
Framework Version
No response
Node.js Version
v18.17.1
OS
macOS 14.1.1
Language
TypeScript
Language Version
5.1.6
Other information
No response
The text was updated successfully, but these errors were encountered: