AWS credentials of S3 adapter on Heroku

Hello,

We are running parse server on Heroku.

Recently, we have noticed a warning message while building the server:


Passing AWS credentials to this adapter is now DEPRECATED and will be removed in a future version See: GitHub - parse-community/parse-server-s3-adapter: AWS S3 adapter for parse-server for details


So we followed steps in the link, and removed “accessKey” and “secretKey” that were explicitly set, and we have configured the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (using “s3-files-adapter”).

The parse server compiles and runs fine after the changes.

So the adapter set up looks like …

var S3Adapter = require(’@parse/s3-files-adapter’);

const config = {

filesAdapter: new S3Adapter(
process.env.AWS_ACCESS_KEY_ID, // accessKey
process.env.AWS_SECRET_ACCESS_KEY, // secretKey
“ourBucketName”,
{ directAccess: true, region: ‘ourRegionName’ }
),

}

However, during the building process, we still get the same warning:


Passing AWS credentials to this adapter is now DEPRECATED and will be removed in a future version See: GitHub - parse-community/parse-server-s3-adapter: AWS S3 adapter for parse-server for details


Do you know why we still see the same waring? (Do we have to do something about “bucketName” and “region” etc also??)
Thanks!

Since you have already set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars, you just need to initialize the Parse Server with:

const config = {
  // ...
  filesAdapter: {
    module: '@parse/s3-files-adapter',
    options: { directAccess: true, region: 'ourRegionName', bucket: 'ourBucketName' }
  },
  // ...
}

Sorry it took me a while to test this.
That works (& no more warning about AWS credential).
Thank you so so much!! :laughing: