-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathapp.py
More file actions
27 lines (18 loc) · 744 Bytes
/
app.py
File metadata and controls
27 lines (18 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import boto3
from aws_xray_sdk.core import patch_all
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent
from aws_lambda_powertools.utilities.typing import LambdaContext
from aws_lambda_powertools.utilities.validation import validator
from schemas import OUTPUT_SCHEMA
from layer import get_s3_bucket_list_as_string
patch_all()
@validator(outbound_schema=OUTPUT_SCHEMA)
def lambda_handler(event: APIGatewayProxyEvent, context: LambdaContext) -> dict:
print("Hello logfile!")
bucket_list = get_s3_bucket_list_as_string()
return {
"statusCode": 200,
"body": bucket_list
}