import boto3
import logging
import os


LOGGER = logging.getLogger()
LOGGER.setLevel(logging.INFO)


def make_s3():
    AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
    AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
    REGION_NAME = os.environ['AWS_REGION']
    S3_ENDPOINT_URL = os.environ['S3_ENDPOINT_URL']
    return boto3.client('s3', aws_access_key_id=AWS_ACCESS_KEY_ID,
                        aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
                        region_name=REGION_NAME,
                        endpoint_url=S3_ENDPOINT_URL)


def handler(event, context):
    BUCKET_NAME = os.environ['BUCKET_NAME']
    client_s3 = make_s3()
    client_s3.put_object(
        Bucket=BUCKET_NAME,
        Key='b-key',
        Body='some body 2234'
    )
    LOGGER.info("I've been called!")
    return {
        "event": str(event),
        "context": str(context.__dict__),
        "message": "Hello TEST 1222!"
    }

@@ -113,33 +113,33 @@
 ():%0A    
-AWS_ACCESS_KEY_ID
+aws_access_key_id
  = os.en
@@ -169,37 +169,37 @@
 D'%5D%0A    
-AWS_SECRET_ACCESS_KEY
+aws_secret_access_key
  = os.en
@@ -233,27 +233,27 @@
 Y'%5D%0A    
-REGION_NAME
+region_name
  = os.en
@@ -276,31 +276,31 @@
 N'%5D%0A    
-S3_ENDPOINT_URL
+s3_endpoint_url
  = os.en
@@ -372,33 +372,33 @@
 _key_id=
-AWS_ACCESS_KEY_ID
+aws_access_key_id
 ,%0A      
@@ -437,37 +437,37 @@
 ess_key=
-AWS_SECRET_ACCESS_KEY
+aws_secret_access_key
 ,%0A      
@@ -500,19 +500,19 @@
 ame=
-REGION_NAME
+region_name
 ,%0A  
@@ -546,31 +546,31 @@
 int_url=
-S3_ENDPOINT_URL
+s3_endpoint_url
 )%0A%0A%0Adef 
@@ -598,27 +598,27 @@
 t):%0A    
-BUCKET_NAME
+bucket_name
  = os.en
@@ -705,27 +705,27 @@
  Bucket=
-BUCKET_NAME
+bucket_name
 ,%0A      
@@ -766,13 +766,8 @@
 body
- 2234
 '%0A  
@@ -925,13 +925,8 @@
 TEST
- 1222
 !%22%0A 

clean up