DEV Community

Robert Stiff
Robert Stiff

Posted on

Debugging AWS Serverless with Terraform Made Easier: Introducing Teleform

Debugging AWS Serverless with Terraform Made Easier: Introducing Teleform

If you've ever found yourself frustrated by the slow process of debugging remotely in an AWS serverless environment while working with Terraform, you're not alone. Debugging cloud functions can be a time-consuming and tedious experience, especially when you’re iterating on code or investigating issues in real-time.

That’s exactly the problem I set out to solve when I built Teleform.


What Is Teleform?

Teleform is an open-source tool designed to simplify the debugging process for AWS Lambda functions deployed using Terraform. It provides a local development experience that seamlessly integrates with your remote AWS environment.

With Teleform, you can:

  • Run Lambda functions locally while still interacting with your AWS environment.
  • Proxy AWS Lambda invocations to your local machine for real-time debugging.
  • Live-reload code and even attach debuggers for a seamless development workflow.

Why I Built Teleform

Debugging serverless applications can be a challenging experience:

  • Redeploying Lambda functions after every change takes time.
  • Observing the effect of changes in a remote environment requires navigating multiple layers of infrastructure.
  • Developers often resort to "mocking" AWS services locally, which doesn’t always reflect production behavior.

I wanted a tool that would allow me to:

  1. Develop and debug AWS Lambda functions as if they were running locally.
  2. Minimize the feedback loop between writing code, running it, and seeing the results.
  3. Avoid constantly redeploying functions or mocking services.

How It Works

Teleform acts as a wrapper around Terraform's AWS Lambda resources. It sets up a proxy in your AWS environment that forwards Lambda invocation requests to a local server running on your machine. This lets you:

  • Debug your code locally with real AWS inputs and outputs.
  • Use live-reloading to test changes instantly.
  • Attach a debugger to step through your code in real-time.

Key Features

  • Proxy Invocation Requests: Route AWS Lambda requests directly to your local machine.
  • Environment Variables Redacted: Safeguard sensitive data while logging.
  • Real-Time Debugging: Step through your code as it executes.
  • Seamless Integration: Works with existing Terraform configurations by swapping the Lambda resource for the Teleform module.

Get Started

Getting started with Teleform is easy. The project is hosted on GitHub, where you’ll find all the setup instructions you need: https://github.com/uatec/teleform.


Your Feedback Matters

I built Teleform to solve my own frustrations with debugging serverless environments, but I’m sharing it in the hope that it can help others too. If you try it out, I’d love to hear your thoughts! Whether it’s feedback, feature requests, or contributions, they’re all welcome.

You can check it out on GitHub: https://github.com/uatec/teleform

Happy debugging! 🚀

Top comments (0)