- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlambda_function.py
More file actions
Latest commit
18 lines (15 loc) · 556 Bytes
/
Copy pathlambda_function.py
File metadata and controls
18 lines (15 loc) · 556 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
""" Lambda function module """
importos
importjson
importboto3
deflambda_handler(event, context):
""" Handles function event and context """
# resolve backend api key from the secrets manager
sm_client=boto3.client('secretsmanager')
sm_resp=sm_client.get_secret_value(os.getenv('BACKEND_SERVICE_API_KEY_SECRET_ARN'))
backend_api_key=json.dumps(sm_resp.get('SecretString')).get('key')
# TODO implement further business logic
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}