首页 > 解决方案 > Lambda、Bref 和 Symfony:命令不显示

问题描述

我正在使用 Bref 和 Symfony 在 AWS Lambda 中制作控制台应用程序。

我在本地开发了两个命令,这些都是可用的。

接下来,我按照教程https://bref.sh/docs/runtimes/console.html将 lambda 函数部署到 AWS,但是当我运行 lambda 函数时,我的命令没有出现。

我的 serverless.yml 文件:

service: my-worker

provider:
    name: aws
    # The AWS region in which to deploy (us-east-1 is the default)
    region: eu-west-1
    # The stage of the application, e.g. dev, production, staging… ('dev' is the default)
    stage: production
    runtime: provided.al2
    environment:
        # Symfony environment variables
        APP_ENV: prod

plugins:
    - ./vendor/bref/bref

functions:
    # This function let us run console commands in Lambda
    console:
        handler: bin/console
        timeout: 120 # in seconds
        events:
            - schedule:
                  rate: cron(0 1 ? * FRI *)
                  input: '"app:my-command"'

        layers:
            - ${bref:layer.php-80} # PHP
            - ${bref:layer.console} # The "console" layer

package:
    patterns:
        # Excluded files and folders for deployment
        - '!assets/**'
        - '!node_modules/**'
        - '!public/build/**'
        - '!tests/**'
        - '!var/**'
        # If you want to include files and folders that are part of excluded folders,
        # add them at the end
        - 'var/cache/prod/**'
        - 'public/build/entrypoints.json'
        - 'public/build/manifest.json'

有人可以帮助我吗?

谢谢。

标签: aws-lambdabref

解决方案


推荐阅读