如果新的 Lambda 函数尚不存在,我正在尝试发布它。更新似乎很好用,我可以随意更新。但是,当我尝试执行发布命令时,我不断收到错误Member must not be null
$zipFilePath = "E:\ProductName-Dev\release.zip"
$zipFileItem = Get-Item -Path $zipFilePath
$fileStream = $zipFileItem.OpenRead()
$memoryStream = New-Object System.IO.MemoryStream
$fileStream.CopyTo($memoryStream)
$cmdOutput = Get-LMFunction -FunctionName new-extract;
try{
if($?) {
"lambda function already in AWS"
Update-LMFunctionCode -FunctionName new-extract -ZipFile $memoryStream -Publish 1
} else {
"need to publish new lambda function"
Publish-LMFunction -FunctionName new-extract -FunctionZip $zipFilePath -Handler exports.handler -Role arn:aws:iam::0000000:role/my-extract -Region us-east-1
}
}
finally {
$fileStream.Close()
}
如果我在没有所有参数的情况下运行 Publish-LMFunction 并手动输入内容,我仍然会收到错误消息。有什么明显的我在搞砸吗?我相信我已将所有 4 个必填字段添加到我的发布功能中。我也可以在 webconsole 中创建这些,所以我认为这不是凭据问题。