import json
import boto3


BUCKET_NAME = "hogehoge-sam-sample"
s3 = boto3.resource('s3')
filepath = '/tmp/sample.html'

# バケット名,オブジェクト名
def lambda_handler(event, context):
    bucket = s3.Bucket(BUCKET_NAME)
    bucket.download_file('sample.html', filepath)

    with open(filepath , encoding='utf-8') as f:
        html = f.read()

    return {
        "statusCode": 200,
        "headers": {"Content-Type": "text/html"},
        "body": html
    }