I'm working in a secured environment where my CI/CD can't test the infrastructure we deploy. I know that deploying a Lambda function or using AWS Synthetics are options, but they feel way too complicated and slow for what I need! Is there a way to run a "one-off" script in Lambda similar to how you might use npx or uxv? Something that can set itself up and tear itself down afterwards?
4 Answers
What exactly are you trying to test? If it's about checking interactions with AWS APIs, regular development environments should do the trick. But if you need to see how your Lambda performs with specific inputs and outputs, regular unit testing might be best. Or, if you're okay with it, LocalStack can simulate a VPC for you too.
Are you possibly looking for Lambda layers? They can help with managing dependencies more easily if you're running scripts in Lambda.
Aren't Lambdas pretty much what you're describing? They're designed for running one-off scripts whenever you need to, setting up and tearing down automatically. You could just run a Python script directly in Lambda, and it’s one of the most flexible approaches!
You might want to check out LocalStack. It lets you emulate AWS services locally, so you won’t have to actually deploy any Lambdas to test your scripts.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically