serverless-localstack не в состоянии развернуть лямбду - PullRequest
0 голосов
/ 14 апреля 2019

При попытке развернуть лямбду с помощью serverless-localalstack в localstack, код загружается в корзину s3, но лямбда не развертывается, хотя они не являются ошибками в журнале.

Я запускаю команду sls deploy --stage local --verbose и не вижу ошибок. вывод:

Serverless: config
.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: dev
Serverless: config.stage: local
Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use 
 http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
Serverless: Reconfiguring service dynamodb to use http://localhost:4569
Serverless: Reconfiguring service kinesis to use http://localhost:4568
Serverless: Reconfiguring service route53 to use http://localhost:4580
Serverless: Reconfiguring service firehose to use http://localhost:4573
Serverless: Reconfiguring service stepfunctions to use http://localhost:4585
Serverless: Reconfiguring service es to use http://localhost:4578
Serverless: Reconfiguring service s3 to use http://localhost:4572
Serverless: Reconfiguring service ses to use http://localhost:4579
Serverless: Reconfiguring service sns to use http://localhost:4575
Serverless: Reconfiguring service sqs to use http://localhost:4576
Serverless: Reconfiguring service sts to use http://localhost:4592
Serverless: Reconfiguring service iam to use http://localhost:4593
Serverless: Generated requirements from /root/lambda_detect/requirements.txt in /root/lambda_detect/.serverless/requirements.txt...
Serverless: Installing requirements from /root/lambda_detect/.serverless/requirements/requirements.txt ...
Serverless: Running ...
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service detector.zip file to S3 (971.78 KB)...
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - detector-local
CloudFormation - UPDATE_COMPLETE - AWS::CloudFormation::Stack - detector-local
Serverless: Stack update finished...
Service Information
service: detector
stage: local
region: us-east-1
stack: detector-local
resources: 3
api keys:
  None
endpoints:
  None
functions:
  detectfile: detector-local-detectfile
layers:
  None

Stack Outputs
ServerlessDeploymentBucketName: detector-local-ServerlessDeploymentBucket-A-Z978A-Z005A-Z489

мой файл serverless.yaml:

service: detector

provider:
  name: aws
  runtime: python3.6
  region: us-east-1

plugins:
  - serverless-python-requirements
  - serverless-localstack

custom:
  pythonRequirements:
    dockerizePip: false

  localstack:
    host: http://localhost
    debug: true
    stages:
      - local
    autostart: true

functions:
  detectfile:
    handler: lambda_function.lambda_handler
    Role: 'arn:aws:iam::000000000001:role/e2e_lambda_role'
    Events:
      -s3:
        Bucket:
          Ref: Bucket1
        event: 's3:ObjectCreated:*'
        filter:
          S3Key:
            Rules:
             - Name: prefix
               Value: fmts/
    Bucket1:
        Type: 'AWS::S3::Bucket'

    environment:
      bucket: e2e-test

после развертывания я запускаю awslocal lambda list-functions, но не вижу лямбды их

...