Deploying Laravel (laravel-mix) application on AWS Serverless platform Deploying Laravel (laravel-mix) application on AWS Serverless platform laravel laravel

Deploying Laravel (laravel-mix) application on AWS Serverless platform


A 403 error suggests that you are unauthorized or there is some kind of permissions error.

Based on this page:

https://bref.sh/docs/frameworks/laravel.html

Can you confirm that you have set appropriate permissions for lambda to read and write from s3 buckets that you use ?

...provider:    ...    environment:        AWS_BUCKET: # environment variable for Laravel            Ref: Storage    iamRoleStatements:        # Allow Lambda to read and write files in the S3 buckets        -   Effect: Allow            Action: s3:*            Resource:                - Fn::GetAtt: Storage.Arn # the storage bucket                - Fn::Join: ['', [Fn::GetAtt: Storage.Arn, '/*']] # everything in the storage bucketresources:    Resources:        Storage:            Type: AWS::S3::Bucket

The documentation goes on to say that you will have to add the the token line from the following snippet in config/filesystems.php . Have you done so?

's3' => [            'driver' => 's3',            'key' => env('AWS_ACCESS_KEY_ID'),            'secret' => env('AWS_SECRET_ACCESS_KEY'),            'token' => env('AWS_SESSION_TOKEN'),            'region' => env('AWS_DEFAULT_REGION'),            'bucket' => env('AWS_BUCKET'),            'url' => env('AWS_URL'),        ],

I don't use Laravel, so the above suggestions are just based on looking at your error and reading the documentation. But if you provide more information, I'm happy to take a look