aws/aws-lambda-dotnet

Upgrading Powershell script lambda with .net8 not working

Closed this issue · 2 comments

Describe the bug

Hi Team -

I want to update the Powershell script lambda function runtime to .net8 but when try to deploy function using following deployment code. It is generating new function but .net6 runtime. The cproj and .cs files generate dynamically so i don't have control to define .net8 frame work. I'm using following script to deploy function.

Import-Module AWSLambdaPSCore
$env:AWS_LAMBDA_DOTNET_FRAMEWORK = "net8.0"
Set-AWSCredential -ProfileName "deploy-lambda-function"
$publishPSLambdaParams = @{
# Name of the Lambda function
Name = 'a204503-prod-AddServerInDatadogMM'
# Path to the Powershell script file
ScriptPath = '.\prod-AddServerInDatadogMM.ps1'
# Local Region. Use Get-AWSRegion to find yours
Region = 'us-east-1'
# # z IAM role used that this function will run as
IAMRoleArn = 'customer_mssql_lambda_basic_execution_role'

}

Publish-AWSPowerShellLambda @publishPSLambdaParams

I have updated poweshell version and installed latest version .net8 SDK As well on my laptop. If you've steps kindly share with me.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Above code should deploy function with correct version of .net8

Current Behavior

Above script is generating function but with .net6.0

Reproduction Steps

Try deploying any ps script using above code. Change the script location and other parameters

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

ASWSDK last version

Targeted .NET Platform

.Net 8

Operating System and version

Windows 11

After upgrading AWSLambdaPSCore module to latest version this issue was resolved.

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.