Aws-s3 and digital ocean spaces error

I updated Strapi from 4.14.5 to 4.15.4(latest) as of today and updated dependencies also. Am getting error using @strapi/provider-upload-aws-s3 with digital ocean spaces which was working perfectly before.
It now returns Error(“Region is missing”);

My configuration which was working before was

upload: {
   config: {
     provider: "aws-s3",
     providerOptions: {
       accessKeyId: process.env.DO_SPACE_ACCESS_KEY,
       secretAccessKey: process.env.DO_SPACE_SECRET_KEY,
       endpoint: process.env.DO_SPACE_ENDPOINT,
       params: {
         Bucket: process.env.DO_SPACE_BUCKET,
       },
     },
     actionOptions: {
       upload: {},
       uploadStream: {},
       delete: {},
     },
   },
 },

Tried adding region as shown from Digital ocean site for region name

https://docs.digitalocean.com/products/platform/availability-matrix/#available-datacenters

but it returns invalid region name, Anyone with a fix for this? I’ve followed the docs as is but not working

I got this same issue, did you ever fix it?

I solved the problem by removing the bucket name from my endpoint url and adding the region to my .env so DO_SPACES_REGION and set that to nyc3 then in my endpoint url it is now https://nyc3.digitaloceanspaces.com

That allowed the upload to go back to working properly like it did before.

Do you mind sharing your config for this? I am struggling with the same issue, but adding region did not solve it.

For anyone else having the same issue, I used this config. Am using Strapi 4.19.1 as of this post. Please note the s3Options inside the providerOptions.

 upload: {
    config: {
      provider: "aws-s3",
      providerOptions: {
        s3Options: {
          credentials: {
            accessKeyId: process.env.DO_SPACE_ACCESS_KEY,
            secretAccessKey: process.env.DO_SPACE_SECRET_KEY,
          },
          endpoint: process.env.DO_SPACE_ENDPOINT, // aws-s3 v3 needs a prefixed https:// endpoint
          region: process.env.DO_SPACE_REGION,
          params: {
            Bucket: process.env.DO_SPACE_BUCKET,
          },
        },
      },
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
      },
    },
  },

Hope this helps @puslefot

Thank you @CodeDruid13, I needed the https:// in front of the endpoint!