# AWS S3 Event

The AWS S3 Event Receiver consumes S3 event notifications for object creation events (`s3:ObjectCreated:*`) and emits the S3 object as the string body of a log record.

### Supported Platforms

| Platform | Supported |
| -------- | --------- |
| Linux    | ✓         |
| Windows  | ✓         |
| macOS    | ✓         |

Available in the Bindplane Distro for OpenTelemetry Collector `v1.74.0+`.

### Prerequisites

* An AWS account with access to S3 and SQS.
* An SQS queue configured to receive S3 event notifications.

1. Ensure the collector has permission to read and delete messages from the SQS queue.
2. Ensure the collector has permission to read objects from the S3 bucket.

### How It Works

1. The receiver polls an SQS queue for S3 event notifications.
2. When an object creation event (`s3:ObjectCreated:*`) is received, the receiver downloads the S3 object.
3. The receiver reads the object into the body of a new log record.
4. Non-object creation events are ignored but removed from the queue.
5. If an S3 object is not found (404 error), the corresponding SQS message is preserved for retry later.

### Configuration Fields

<table><thead><tr><th width="225.75">Field</th><th width="92.9765625">Type</th><th width="100.2421875">Default</th><th width="109.51171875">Required</th><th>Description</th></tr></thead><tbody><tr><td>sqs_queue_url</td><td>string</td><td></td><td><code>true</code></td><td>The URL of the SQS queue to poll for S3 event notifications.</td></tr><tr><td>standard_poll_interval</td><td>duration</td><td>15</td><td><code>false</code></td><td>The interval (in seconds) at which the SQS queue is polled for messages.</td></tr><tr><td>max_poll_interval</td><td>duration</td><td>2</td><td><code>false</code></td><td>The maximum interval (in seconds) at which the SQS queue is polled for messages.</td></tr><tr><td>polling_backoff_factor</td><td>float</td><td>2</td><td><code>false</code></td><td>The factor by which the polling interval is multiplied after an unsuccessful poll.</td></tr><tr><td>workers</td><td>int</td><td>5</td><td><code>false</code></td><td>The number of workers to process events.</td></tr><tr><td>visibility_timeout</td><td>duration</td><td>300</td><td><code>false</code></td><td>How long (in seconds) messages received from the queue will be invisible to other consumers.</td></tr><tr><td>visibility_extension_interval</td><td>duration</td><td>1m</td><td><code>false</code></td><td>How often to extend message visibility during processing. Should be less than visibility_timeout. Minimum is 10s.</td></tr><tr><td>max_visibility_window</td><td>duration</td><td>1h</td><td><code>false</code></td><td>Maximum total time a message can remain invisible before becoming visible to other consumers. Must be less than SQS's 12-hour limit.</td></tr><tr><td>max_log_size</td><td>int</td><td>1048576</td><td><code>false</code></td><td>The maximum size of a log record in bytes. Logs exceeding this size will be split</td></tr><tr><td>max_logs_emitted</td><td>int</td><td>1000</td><td><code>false</code></td><td>The maximum number of log records to emit in a single batch. A higher number will result in fewer batches, but more memory.</td></tr><tr><td>bucket_name_filter</td><td>string</td><td></td><td><code>false</code></td><td>When set, the source will only emit logs for bucket names that match the specified regex.</td></tr><tr><td>object_key_filter</td><td>string</td><td></td><td><code>false</code></td><td>When set, the source will only emit logs for object names that match the specified regex.</td></tr><tr><td>notification_type</td><td>enum</td><td><code>s3</code></td><td><code>false</code></td><td>Options are <code>s3</code> and <code>sns</code>. S3 notifications are the default for S3 to SQS. SNS is for S3 notifications sent via SNS to SQS.</td></tr><tr><td>enable_offset_storage</td><td>bool</td><td><code>false</code></td><td><code>false</code></td><td>When enabled, the current position into an object will be saved to Redis, and reading will resume from where it left off after a collector restart.</td></tr><tr><td>redis_hostname</td><td>string</td><td></td><td><code>false</code></td><td>The hostname or IP address of the Redis server used for offset storage.</td></tr><tr><td>redis_port</td><td>int</td><td>6379</td><td><code>false</code></td><td>The port number of the Redis server used for offset storage.</td></tr><tr><td>redis_password</td><td>string</td><td></td><td><code>false</code></td><td>The password for the Redis server used for offset storage.</td></tr><tr><td>redis_database</td><td>string</td><td></td><td><code>false</code></td><td>The Redis database number to use for offset storage.</td></tr><tr><td>redis_expiration</td><td>int</td><td>0</td><td><code>false</code></td><td>The expiration time (in seconds) for offset storage in Redis.</td></tr><tr><td>redis_tls_enabled</td><td>bool</td><td><code>false</code></td><td><code>false</code></td><td>Whether to enable TLS for the Redis connection.</td></tr><tr><td>redis_tls_ca_file</td><td>string</td><td></td><td><code>false</code></td><td>The path to the CA file for Redis TLS connection.</td></tr><tr><td>redis_tls_cert_file</td><td>string</td><td></td><td><code>false</code></td><td>The path to the client certificate file for Redis TLS connection.</td></tr><tr><td>redis_tls_key_file</td><td>string</td><td></td><td><code>false</code></td><td>The path to the client key file for Redis TLS connection.</td></tr></tbody></table>

### Example Configuration

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-50e6b533dd3177578930a744121536cd8ade736a%2Faws-s3-event.png?alt=media" alt="Bindplane docs - AWS S3 Event - image 1"><figcaption></figcaption></figure>

### Component Telemetry

This component emits telemetry that can provide insight into how it is performing. The collector is configured to emit these metrics to `localhost:8888/metrics` by default.

<table><thead><tr><th width="310.97265625">Metric Name</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td>otelcol_s3event_batch_size</td><td>histogram</td><td>The number of logs in a batch.</td></tr><tr><td>otelcol_s3event_objects_handled_total</td><td>counter</td><td>The number of S3 objects processed by the receiver.</td></tr><tr><td>otelcol_s3event_failures_total</td><td>counter</td><td>The number of failures encountered while processing S3 objects.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bindplane.com/integrations/sources/aws-s3-event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
