# S3

[Amazon Simple Storage Service (S3)](https://aws.amazon.com/s3/) is an object storage service. Tenzir can treat it like a local filesystem to read and write files.

Use [`from_s3`](https://preview.docs.tenzir.com/375/375/reference/operators/from_s3.md) to read files from S3. It supports glob patterns, automatic format detection, and IAM role assumption. For writing, use [`to_s3`](https://preview.docs.tenzir.com/375/375/reference/operators/to_s3.md) with a print operator.

## Configuration

See [AWS Authentication](https://preview.docs.tenzir.com/375/375/reference/aws-authentication.md) for the available AWS authentication mechanisms.

## Examples

### Read from an S3 bucket

```tql
from_s3 "s3://my-bucket/path/to/file.json.gz"
```

### Read all JSON files from an S3 bucket

```tql
from_s3 "s3://my-bucket/logs/**.json"
```

### Write to an S3 bucket

```tql
from {foo: 42}
to_s3 "s3://my-bucket/path/to/file.json.gz" {
  write_json
  compress_gzip
}
```