-
Install Powershell 6.x on Mac
brew cask install powershell
-
Install the .NET Core 2.1 SDK (not runtime)
-
Install the AWSLambdaPSCore module.
Install-Module AWSLambdaPSCore -Scope CurrentUser
- Create new project
New-AWSPowerShellLambda -ScriptName blah -Template Basic
Move to AWS Tools for PowerShell in AWS Lambda, you can now switch to the new AWS.Tools modules. They will help lower cold start time and memory usage.
You will need to change the #Requires
statement from AWSPowerShell.NetCore
to the AWS.Tools module you wish to use (e.g. AWS.Tools.S3).
You will also need to add an extra #Requires
statement to use AWS.Tools.Common. AWS will remove this requirement in the future by supporting automatic identification of the module dependencies.
Change the line:
#Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.335.0'}
to
#Requires -Modules @{ModuleName='AWS.Tools.Common';ModuleVersion='3.3.604.0'}
#Requires -Modules @{ModuleName='AWS.Tools.S3';ModuleVersion='3.3.604.0'}