Configure plugin-cloud-storage with S3

default discord avatar
Chris_Heinz
last month
6

I am having a hard time configuring the plugin with my S3 credentials as I always getting an error I am not sure if I am using the right credentials. I created a bucket and a new user via IAM. Then I created a role for the user and selected the S3 bucket with full acess. Then I created a tag and used the displayed acess key and copied the secret key but I always get an error after starting the payload server.

  • default discord avatar
    tylandavis
    last month

    could you share some more info about the error you are getting? It will also help to know what your configuration for the plugin looks like as well.

  • default discord avatar
    Chris_Heinz
    last month

    Sure


       cloudStorage({
          collections: {
            // Enable cloud storage for Media collection
            media: {
              // Create the S3 adapter
              adapter: s3Adapter({
                config: {
                  // endpoint: process.env.S3_ENDPOINT,
                  region: "eu-central-1",
                  credentials: {
                    accessKeyId: process.env.S3_ACCESS_KEY_ID,
                    secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
                  },
                },
                bucket: "demo-bucket",
              }),
            },
          },
        }),

    And the error I am facing rn is "The request signature we calculated does not match the signature you provided. Check your key and signing method." @tylandavis

  • default discord avatar
    tylandavis
    last month

    @Chris_Heinz Double check that your environment variables for credentials are set correctly. I'm reading online that access keys with special characters need to be escaped with

    \

    , so that may be an issue too

  • default discord avatar
    Chris_Heinz
    last month

    I've read the same and tried to escape slashes but no luck. Is the config for bucket just the name I gave it or the specific ARN ?



    Figured it out my problem was that I still got a few of my assets referenced in my local media directory and as it tried to look them up in the bucket I was getting an error with "The specified key does not exist" which was kind of misleading



    Thanks for your help @tylandavis

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.