#!/bin/bash -eu func="$1" code_location=$(aws lambda get-function --function-name "$func" --query 'Code.Location' --output text) wget -q -O "$func.zip" "$code_location" unzip -d "$func" "$func.zip"