S3 as Storage backend¶
I chose S3 when initializing the repository!¶
S3 selected
This section assumes you chose S3 when bootstrapping the instance.
If you are reading this section, you are lucky! You will only have to perform a few configuration changes.
Bucket and data location¶
A default bucket (default
) is created automatically in your minio container. This bucket will be used as the default files' location for your InvenioRDM instance.
If you want to change the bucket name, open a shell window and type pipenv run invenio files location s3-default s3://new-bucket --default
. You will also need to manually create the new bucket in minio or your S3 storage system. The new bucket will only be used for new records or drafts (existing drafts and records will use default
).
Set your minio credentials¶
The last step is to set your credentials so your instance can authenticate against the S3 container.
By default, the ROOT_USER
and the ROOT_USER_PASSWORD
of MinIO are "CHANGE_ME". For security reasons, you should change them. This will require you to:
- Stop your services by using the CLI:
invenio-cli services stop
(Or stop only your minio container). - In the
docker-services.yaml
file change theMINIO_ROOT_USER
andMINIO_ROOT_PASSWORD
values. - Update the credentials in the
invenio.cfg
file: The root user value corresponds toS3_ACCESS_KEY_ID
and the password toS3_SECRET_ACCESS_KEY
. - Start your services:
invenio-cli services start
.
It's done! Ready to roll!
Amazon S3¶
If you're using Amazon S3, you'll want to provide the endpoint url and set the region if you're not using us-east-1 (the default) like
S3_ENDPOINT_URL='https://s3.us-west-2.amazonaws.com/'
S3_REGION_NAME='us-west-2'
For the previewer to work, you'll also need to set the CORS configuration in your AWS bucket. You can accomplish this by going to the AWS console, selecting the S3 permissions tab, and pasting the following into the CORS section
[
{
"AllowedHeaders": [],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]