Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Configure plugin-cloud-storage with S3

default discord avatar
chrispy.q2 years ago
4

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.

  • discord user avatar
    tylandavis
    2 years ago

    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
    chrispy.q2 years ago

    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."

    @783701636165402624
  • discord user avatar
    tylandavis
    2 years ago
    @690590499202924574

    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
    chrispy.q2 years ago

    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

    @783701636165402624
Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.