(lambda): Remove requirement to call currentVersion in order for currentVersionOptions to take effect #27136
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the bug
Specifying
currentVersionOptions
for aFunction
has no effect unlesscurrentVersion
is invoked.It's easy to see why this is with
cdk diff
, because these options actually apply to a brand newAWS::Lambda::Version
resource that doesn't exist unlesscurrentVersion
is invoked. But it's a confusing behavior, and there doesn't seem to be any scenario where a user would specifycurrentVersionOptions
for aFunction
and not want aAWS::Lambda::Version
resource to be created with those options.Expected Behavior
Specifying
currentVersionOptions
to provide options for the current version of the Lambda Function without any subsequent interaction being required.Current Behavior
Specifying
currentVersionOptions
for aFunction
has no effect unless thecurrentVersion
method is called.Reproduction Steps
(Copied from #23002).
Does not configure provisioned concurrency for the current version of the function.
Does configure provisioned concurrency for the current version of the function.
Possible Solution
I'm not sure. Originally under #23002 the bug was fixed by implicitly calling
currentVersion
in the constructor ifcurrentVersionOptions
is notnull
, but as per #23636Additional Information/Context
This bug was previously lodged as #23002, however the fix provided under that issue was reverted by #23636 as it was flawed.
CDK CLI Version
2.96.0 (build e6322aa)
Framework Version
2.96.0
Node.js Version
v18.17.1
OS
Ubuntu (Windows Subsystem for Linux)
Language
Python
Language Version
3.9.7
Other information
No response
The text was updated successfully, but these errors were encountered: