Skip to content

Invalid request provided: AWS::CloudFront::Function: null #329

Closed
@garritfra

Description

Description

Hi, I'm currently deploying a Laravel application. When trying to integrate static assets using lift, I get the following error:

CREATE_FAILED: websiteRequestFunction9E9EBB7A (AWS::CloudFront::Function)
Resource handler returned message: "Invalid request provided: AWS::CloudFront::Function: null (Service: CloudFront, Status Code: 409, Request ID: 3fb4cd8e-8fa4-4411-801a-2e2aabe17573)" (RequestToken: 95e93590-d1b5-409b-21a5-28a4b2e41d06, HandlerErrorCode: InvalidRequest)

Any hints about what could cause this?

How to Reproduce

service: ...

useDotenv: true

provider:
    name: aws
    # The AWS region in which to deploy (us-east-1 is the default)
    region: eu-central-1
    # Environment variables
    environment:
        APP_ENV: ${sls:stage}
    cfnRole: "<cloudformation role>"
    vpc:
        subnetIds:
          - ...
        securityGroupIds:
          - ...

package:
    # Files and directories to exclude from deployment
    patterns:
        - '!node_modules/**'
        - '!public/storage'
        - '!resources/assets/**'
        - '!storage/**'
        - '!tests/**'
        - '!.ddev/**'

functions:

    # This function runs the Laravel website/API
    web:
        handler: public/index.php
        runtime: php-82-fpm
        timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
        events:
            - httpApi: '*'

    # This function lets us run artisan commands in Lambda
    artisan:
        handler: artisan
        runtime: php-82-console
        timeout: 720 # in seconds
        # Uncomment to also run the scheduler every minute
        #events:
        #    - schedule:
        #          rate: rate(1 minute)
        #          input: '"schedule:run"'

constructs:
    website:
        type: server-side-website
        assets:
            '/js/*': public/js
            '/css/*': public/css
            '/build/*': public/build
            '/vendor/*': public/vendor
            '/favicon.ico': public/favicon.ico
            '/robots.txt': public/robots.txt 

plugins:
    - ./vendor/bref/bref
    - serverless-dotenv-plugin
    - serverless-lift

Additional Information

Versions of the serverless plugins:

        "serverless-dotenv-plugin": "^6.0.0",
        "serverless-lift": "^1.25.1",

And serverless itself:

Framework Core: 3.30.1 (local) 3.30.1 (global)
Plugin: 6.2.3
SDK: 4.3.2

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions