Skip to content

Commit 32e84cb

Browse files
committed
fix lambda get function concurrency
Signed-off-by: Sylvain Hellegouarch <[email protected]>
1 parent 50e1794 commit 32e84cb

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
## [Unreleased][]
44

5-
[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-aws/compare/0.32.0...HEAD
5+
[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-aws/compare/0.32.1...HEAD
6+
7+
## [0.32.1][] - 2024-02-23
8+
9+
[0.32.1]: https://github.com/chaostoolkit-incubator/chaostoolkit-aws/compare/0.32.0...0.32.1
10+
11+
### Fixed
12+
13+
- Use `boto3.lambda.get_function_concurrency` to retrieve the reserved
14+
`ReservedConcurrentExecutions` from a lambda function
615

716
## [0.32.0][] - 2024-02-23
817

chaosaws/awslambda/probes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def get_function_concurrency(
2323
Get configuration information of lambda by its function name
2424
"""
2525
client = aws_client("lambda", configuration, secrets)
26-
result = client.get_function(FunctionName=function_name)
27-
return result["Concurrency"]["ReservedConcurrentExecutions"]
26+
result = client.get_function_concurrency(FunctionName=function_name)
27+
return result["ReservedConcurrentExecutions"]
2828

2929

3030
def get_function_timeout(

tests/awslambda/test_awslambda_probes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ def test_aws_lambda_get_function_concurrency(aws_client):
3535
aws_client.return_value = client
3636
lambda_function_name = "my-lambda-function"
3737
get_function_concurrency(lambda_function_name)
38-
client.get_function.assert_called_with(FunctionName=lambda_function_name)
38+
client.get_function_concurrency.assert_called_with(
39+
FunctionName=lambda_function_name
40+
)
3941

4042

4143
@patch("chaosaws.awslambda.probes.aws_client", autospec=True)

0 commit comments

Comments
 (0)