Strapi Upload S3 + Localstack

System Information
  • Strapi Version: 3.4.1
  • Node Version: 12.20.0
  • Yarn Version: 1.22.5

I’m having some trouble to make the strapi-provider-upload-aws-s3 to work with the LocalStack service. The S3 bucket is created correctly but when I try to upload a file via Strapi pointing to the localhost a get an error.

I set the endpoint param in the plugin configuration but didn’t work

 upload: {
      provider: 'aws-s3',
      providerOptions: {
        accessKeyId: env('AWS_ACCESS_KEY_ID'),
        secretAccessKey: env('AWS_ACCESS_SECRET'),
        region: env('AWS_REGION'),
        endpoint: env('AWS_S3_ENDPOINT'),
        params: {
          Bucket: env('AWS_S3_BUCKET')
        }
      }

I’ve tried the following values for the endpoint

  1. localhost:4566
  2. 127.0.0.1:4566
  3. s3.us-east-1.127.0.0.1:4566

I keep getting one of the following errors

  1. error Error: unable to verify the first certificate
  2. `error Error: getaddrinfo EBUSY bucket-name.s3.us-east-1.127.0.0.1

Hi! @vinyoliver

Did you find any solution for this? I’m running into the same problem.

I think the problem is that Strapi (specifically strapi-provider-upload-aws-s3) doesn’t support path-style addressing, this is http://localhost:4566/, that is the way to connect the local s3 service from the host.

I’m a bit lost with this, I cannot find a solution to connect my dev strapi project to the local s3 container.

Any workaround?

Thanks!