Prodinit Software Solutions
LinkedinGithub
  • Prodinit's Engineering Blog
  • aws
    • Ways to delete AWS ECR images
    • Enable Cloudwatch Alarm and SNS Topic for AWS Billing Alert
    • A-Z of AWS VPC and other services - with Terraform
    • How Internet Works?
    • How to download/view code running in your lambda functions?
  • backend engineering
    • What is idempotency?
  • databases
    • Database Optimisation - Indexing vs Sharding with Postgres and Django ORM examples
  • devops
    • Docker Best Practices
    • Docker Networking - Bridge vs Host vs Overlay
    • A comparision between multistage build and singlestage build in Docker
    • Things to remember before building your first blue/green deployment in Kubernetes
    • How to export env variables in circleci? (You wont find this in circleci documentation)
  • frontend engineering
    • Host your static website with s3, CloudFront, Route53, and domain from godaddy in 4 easy steps
  • product management
    • You'll fail as a lead developer, here's why ...
  • python
    • Achieve Peak Performance in Python
    • Play with List of dictionaries in Python
    • How we develop a custom autoscaling metrics based on number of tasks in the queues?
  • Contact Us
    • Who are we?
    • Work with us.
Powered by GitBook
On this page
  • How can you check that code then?
  • Enjoyed the blog? If so, you'll appreciate collaborating with the minds behind it as well.
  1. aws

How to download/view code running in your lambda functions?

PreviousHow Internet Works?NextWhat is idempotency?

Last updated 1 year ago

CloudWatch? Check. UI console? Check. Specific line I need? Nope. Debugging Lambdas is like playing hide-and-seek with your code.

While direct code modification in the console and immediate deployment to production should always be avoided, having visibility into the running code can be valuable, especially when working with branches containing extensive feature merges.

if you have lots of dependencies, it is easy to reach the 3M limit and having the console just showing the following warning:

The deployment package of your Lambda function "xyz" is too large to enable inline code editing. However, you can still invoke your function.

How can you check that code then?

Well, just use aws lambda get-function

aws lambda get-function --function-name YOUR_FUNCTION_NAME --query 'Code.Location' | xargs curl -o YOUR_FUNCTION_NAME.zip

Then it´s just a matter of unzip YOUR_FUNCTION_NAME.zip and you have the folder with all the content of the deployed package!

Happy debugging.

Tags

Enjoyed the blog? If so, you'll appreciate collaborating with the minds behind it as well.

Written by -

Dishant Sethi