2

我是 zappa 的新手。目前我正在尝试使用 zappa 部署我的烧瓶项目。

在部署我的 Flask 应用程序时出现此错误

Traceback (most recent call last):
  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\zappa\cli.py", line 1847, in handle
    sys.exit(cli.handle())

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\zappa\cli.py", line 345, in handle
    self.dispatch_command(self.command, environment)

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\zappa\cli.py", line 379, in dispatch_command
    self.update()

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\zappa\cli.py", line 605, in update
    endpoint_url = self.deploy_api_gateway(api_id)

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\zappa\cli.py", line 1816, in deploy_api_gateway
    cloudwatch_metrics_enabled=self.zappa_settings[self.api_stage].get('cloudwatch_metrics_enabled', False),

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\zappa\zappa.py", line 1014, in deploy_api_gateway
    variables=variables or {}

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\botocore\client.py", line 251, in _api_call
    return self._make_api_call(operation_name, kwargs)

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\botocore\client.py", line 513, in _make_api_call
    api_params, operation_model, context=request_context)

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\botocore\client.py", line 566, in _convert_to_request_dict
    api_params, operation_model)

  File "c:\users\tanvir\virenvfordeployment\env\lib\site-packages\botocore\validate.py", line 270, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())

ParamValidationError: Parameter validation failed:
Invalid type for parameter restApiId, value: None, type: <type 'NoneType'>, valid types: <type 'basestring'>

有谁知道为什么会出现此错误或我该如何解决?

4

2 回答 2

2

我对 zappa 了解不多,但错误消息清楚地说明了您的问题:

Invalid type for parameter restApiId, value: None, type: <type 'NoneType'>, valid types: <type 'basestring'>

在我看来,您还没有设置参数restApiId,它应该包含一个 type 的值basestring。我不确定那个参数是关于什么的,但它似乎必须对AWS-CLI做一些事情。

于 2016-12-19T20:38:43.550 回答
1

在您的 aws cli 中,确保您正在使用您为 zappa 函数创建的 IAM,然后按照 aws configure q&a 获取访问密钥、密钥和区域。我建议你按照这个非常有用的教程一步一步来:https ://developer.amazon.com/blogs/post/8e8ad73a-99e9-4c0f-a7b3-60f92287b0bf/new-alexa-tutorial-deploy-flask -ask-skills-to-aws-lambda-with-zappa我真的希望这会有所帮助。

于 2017-04-10T07:48:48.993 回答