Hacker News new | ask | show | jobs
by Zelphyr 2878 days ago
How do I debug locally/on Docker with services like SNS and ElasticTranscoder? I know there are emulators but those have gaps in services that providers like AWS offer. Not to mention, I'm debugging with an emulator and not the real thing.
2 comments

I can’t speak for ElasticTranscoder, but there is nothing stopping you from running your lambda function locally and still connect to all of the AWS services.

Just like people have been calling their controller actions from test harnesses for ages to test their APIs. You can call call your handler the same way.

At the end of the day, AWS is just passing you a JSON message. You can call your lambda function manually with the same JSON payload locally.

This is exactly how we test our lambda code that call AWS media encoders
You could run the docker container on an EC2 instance or have an SSH bastion / VPN tunnel between yourself and your AWS VPC.

I tend to opt for the SSH tunnel route for personal projects but use OpenVPN with a secrets management (eg Vault or AWS's new key store) for professional projects (ie when you have several people on your team).

AWS is versatile enough that you do actually have several options available to you.