A container with the dependencies required to create and publish PowerShell code to AWS Lambda.
518
I've been working with PowerShell since its beginning and haven't looked back since. Last year, while working on an serverless project for work, I decided to try Lambda on my own and deploy some of my PowerShell code to AWS to see how it works.
I started working more with AWS on my own while studying for some certs. I jumped back into Lambda and was reminded of how tedious it is to setup my environment for publishing PowerShell to AWS. Unfortunately, I didn't take any notes last year and wanted an easier way to ensure I could just focus on the code. That is where Docker comes in to save the day and our story begins - I created a Docker container with the dependencies required to publish PowerShell code to AWS. I also threw in a few helpful scripts to get a project up and running as quickly as possible.
An AWS Account and access to you "Access Key Id" and "Secret Access key"
Docker or Docker Desktop
Some Docker know how
If you are lacking in either of those areas head over to the Docker and learn how to Get Started!
Start the container
docker run -dit --name powershell-builder rickjacobo/lambda-powershell-project-builder
Access the container shell
docker exec -it powershell-builder pwsh
Create a project
./create-project.ps1
Add code to your project
./edit-<projectname>.ps1
This is the same as running
vi /<projectname>/<projectname>.ps1
If you don't have any code readily available feel free to append the code below to .ps1.
$Json = @"
{
"Message":"Hello, World!"
}
"@
$Json
Publish your code to AWS
./publish-<projectname>.ps1
That's it - the container abstracts a lot of the complexity of getting started with PowerShell on AWS Lambda. Hopefully, this quick tutorial will help you to give AWS Lambda a try.
Content type
Image
Digest
sha256:634bce636…
Size
455.2 MB
Last updated
about 3 years ago
docker pull rickjacobo/lambda-powershell-project-builder