function - AWS Code Sample