I run the code in lambda function like that:
with locopy.Redshift(dbapi=pg8000, host=HOST, port=PORT, database=DATABASE, user=USER, password=\'password\' ) as