Skip to main content

S3

S3 runtime

The S3Runtime can be used to interact with object storage APIs that are S3 compatible. Object storages like S3 are commonly used to cover app needs around large blob data like uploading and serving images. Most object storage services provide S3 compatible APIs including the open-source MinIO engine which you can run locally for development.

For the following example, you'll need to setup your S3 compatible store first. The following snippet can get you started using minio on docker compose:

services:
minio:
image: bitnami/minio:2022
platform: linux/amd64
restart: always
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_REGION_NAME: local
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: password
MINIO_DEFAULT_BUCKETS: "bucket:none"

We then provide the following secrets to our typegraph through metatype.yml.

typegates:
dev:
secrets:
# ..
# replace "files-upload" by the name of your typegraph
files-upload:
S3_HOST: http://localhost:9000
S3_REGION: local
S3_ACCESS_KEY: minio
S3_SECRET_KEY: password
S3_PATH_STYLE: true

Our typegraph will then look something like:

Loading...

Peruse the reference on the S3Runtime for more information.