4

まだ存在しない場合、新しい 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 つの必須フィールドがすべて追加されていると思います。これらは Web コンソール内で作成することもできるので、資格情報の問題ではないと思います。

4

1 に答える 1

4

私は単純にランタイムパラメータがありませんでした

Publish-LMFunction -FunctionName $FunctionName -FunctionZip $zipFilePath -Handler exports.handler -Role arn:aws:iam:$AccountNumber:role/$RoleName -Region $Region -Runtime nodejs4.3

彼らのドキュメントはそれが必要であることを示していますが、Powershell ISE で書いているときはフィールドにアスタリスクを入れません。

于 2016-10-28T19:59:21.013 に答える