Serverless-Devs icon indicating copy to clipboard operation
Serverless-Devs copied to clipboard

使用 Serverless Devs 对 AWS lambda 进行部署

Open Boya-Na opened this issue 3 years ago • 0 comments

Describe the bug 在配置 lambda 的 yaml 后,在部署会提示ERROR:

InvalidParameterType: Expected params.VpcConfig.SecurityGroupIds[0] to be a string

具体Yaml配置:

MyLambdaFunctionDemo:
    component: devscomp/lambda
    props:
      region: us-west-1
      function:
        name: MyLambdaFunctionDemo
        description: aws deployment test
        role: ${vars.role}
        runtime: python3.9
        codeUri: src/functions/aws-deployment-test
        handler: lambda_function.lambda_handler
        memorySize: 1024
        timeout: 600
        vpcConfig: 
          securityGroupIds: 
            - 'sg-xxxxx'

在运行 aws type 检查的时候,对于 securityGroupIds 传入的值是一个object,具体值为:

{
  '0': 's',
  '1': 'g',
  '2': '-',
  '3': 'x',
  '4': 'x',
  '5': 'x',
  '6': 'x',
  '7': 'x',
}

Desktop (please complete the following information):

  • OS: MacOS
  • Version 12.6

请问这个问题是具体由什么造成的?如何解决?谢谢

Boya-Na avatar Oct 25 '22 03:10 Boya-Na