If you’re deploying an AWS PowerShell Lambda (which is PowerShell Core 6.0) in a build pipeline, you’ll likely come across the fact that the older PowerShell docker images don’t have Dotnet Core installed.
The .NET Core 3.0 .NET Core 3.0 SDK Docker images now contain PowerShell Core, but since AWS still uses .NET Core 2.1 which is in Long Term Support, you’re out of luck.
Therefore if you’re deploying your lambda from your CI pipeline using docker, then you need a build environment which has:
PowerShell Core 6
.NET Core 2.1
AWS Tools for PowerShell
You’ve come to the right place. Here is a DockerFile you can use to build your Lambda deployment environment. Make sure you choose the AWS PowerShell Tools module you need in the last line:
An example of how you can build and use this image in a pipeline is below. I use Buildkite, so YMMV:
Find yourself creating the same AWS Cloudformation stack a lot during testing? Wasting too much time repeating typing in tags?
A simple post today with a quick solution.
Put your stack tags and parameters into json files and use this bash wrapper script to create the cloudformation stack. This script wraps the aws cloudformation create-stack command, but lets you create the stacks again and again with different names. The benefit is the parameters and tags are pre-defined. Thus this script will save you time if you are doing this from the AWS console regularly.
An example of running the script with parameters (that are ordinal on purpose):
Provide your own template file, and modify the stackParams and stackTags to your own needs. Below you’ll find the GitHub gist of the script and sample json files.