3

새로운 람다 함수가없는 경우 게시하려고합니다. 업데이트가 잘 작동하는 것 같아 자유롭게 업데이트 할 수 있습니다. 나는 모든 매개 변수없이 게시-LMFunction를 실행하고 수동으로 내가 여전히 오류가 일을 입력하면 내가 수행하려고 할 때 명령을 게시 나는 오류를 Member must not be nullAWS에서 람다 함수 게시

$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() 
} 

가 계속. 내가 멍청한 뭔가가있어? 내 게시 기능에 4 개의 필수 입력란이 모두 추가되어 있다고 생각합니다. webconsole 내에서 이들을 만들 수도 있기 때문에 자격 증명 문제는 아닙니다.

답변

3

단순히 런타임 매개 변수를

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

그들의 문서를 잃어버린 것은 필요에 따라 표시되지만 당신은 파워 쉘 ISE에 작성할 때이 분야에 별표를 넣어하지 않습니다.