Skip to content

Instantly share code, notes, and snippets.

@acdha
Created October 18, 2024 00:25
Show Gist options
  • Save acdha/72de01b7b3dfb2d316f418578da7f0ab to your computer and use it in GitHub Desktop.
Save acdha/72de01b7b3dfb2d316f418578da7f0ab to your computer and use it in GitHub Desktop.
AWS Lambda sucker - handy for introspecting your Lambda packages
#!/bin/bash
set -e -u -o pipefail
LAMBDA="$1"
if [ -z "$LAMBDA" ]; then
echo "Usage: $0 lambda-function-name" > /dev/stderr; exit 1
fi
curl -fso "$LAMBDA".zip "$(aws lambda get-function --function-name "arn:aws:lambda:us-east-1:$(aws sts get-caller-identity --query "Account" --output=text):function:$1" --query Code.Location --output=text)" && unzip "$LAMBDA".zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment