【问题标题】:Publishing a PowerShell script to AWS Lambda将 PowerShell 脚本发布到 AWS Lambda
【发布时间】:2018-12-05 15:12:29
【问题描述】:

我正在尝试将 PowerShell 核心脚本部署到 AWS Lambda。我正在从 EC2 实例进行部署。

我正在关注AWS Lambda Deployment Package in PowerShell - AWS Lambda,并尝试部署他们描述的确切脚本。当我运行时,它看起来会起作用:

Publish-AWSPowerShellLambda -ScriptPath .\LambdaPSTest.ps1 -Name LambdaPSTest -Region us-east-1

然后我收到以下错误。

检索函数 LambdaPSTest 的配置时出错:响应状态代码未指示成功:404(未找到)。

我很困惑为什么它看起来会在该区域中断,因为我在调用发布时设置了它。

Error publishing PowerShell Lambda Function: -1

CALLSTACK:
Command                     Arguments
-------                     ---------
_deployProject
Publish-AWSPowerShellLambda {{Region=us-east-1$null}, {Region=us-east-1$null}, {Region=us-east-1$null}, {Region=us-ea...
<ScriptBlock>               {{=$null}, {=$null}, {=$null}, {=$null}}
At C:\Users\Administrator\Documents\PowerShell\Modules\AWSLambdaPSCore\1.1.0.0\Private\_DeploymentFunctions.ps1:194 char:13
+             throw $msg
+             ~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (Error publishin...
:String) [], RuntimeException
+ FullyQualifiedErrorId : Error publishing PowerShell Lambda Function: -1
CALLSTACK:
Command                     Arguments
-------                     ---------
_deployProject
Publish-AWSPowerShellLambda {{Region=us-east-1$null}, {Region=us-east-1$null}, {Region=us-east-1$null}, {Region=us-ea...
<ScriptBlock>               {{=$null}, {=$null}, {=$null}, {=$null}}

【问题讨论】:

    标签: amazon-web-services powershell aws-lambda powershell-core powershell-v6.0


    【解决方案1】:

    我认为这个问题最终与我的企业环境中的安全设置有关。

    万一其他人遇到这种情况,对我有用的是运行

    New-AWSPowerShellLambdaPackage -ScriptPath ./fileUploader.ps1 -OutputPackage fileUploader.zip
    

    然后手动上传到 AWS Lambda

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-25
      • 2015-11-16
      • 2017-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-26
      • 2022-12-04
      相关资源
      最近更新 更多