Skip to content

Commit b1f6fba

Browse files
authored
Merge pull request localstack#388 from localstack/bjwschaap/get_function_configuration
Add get_function_configuration to Lambda API
2 parents 2fe79ed + 5467779 commit b1f6fba

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

localstack/services/awslambda/lambda_api.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,29 @@ def get_function_code(function):
682682
headers={'Content-Disposition': 'attachment; filename=lambda_archive.zip'})
683683

684684

685+
@app.route('%s/functions/<function>/configuration' % PATH_ROOT, methods=['GET'])
686+
def get_function_configuration(function):
687+
""" Get the configuration of an existing function
688+
---
689+
operationId: 'getFunctionConfiguration'
690+
parameters:
691+
"""
692+
arn = func_arn(function)
693+
lambda_details = arn_to_lambda.get(arn)
694+
if not lambda_details:
695+
return error_response('Function not found: %s' % arn, 404, error_type='ResourceNotFoundException')
696+
result = {
697+
'Version': '$LATEST',
698+
'FunctionName': function,
699+
'FunctionArn': arn,
700+
'Handler': lambda_details.handler,
701+
'Runtime': lambda_details.runtime,
702+
'Timeout': LAMBDA_DEFAULT_TIMEOUT,
703+
'Environment': lambda_details.envvars
704+
}
705+
return jsonify(result)
706+
707+
685708
@app.route('%s/functions/<function>/configuration' % PATH_ROOT, methods=['PUT'])
686709
def update_function_configuration(function):
687710
""" Update the configuration of an existing function

0 commit comments

Comments
 (0)