---
title: S3
summary: Fastly will upload log messages to the S3 bucket in the format specified in the S3 object.
url: https://www.fastly.com/documentation/reference/api/logging/s3
---

Fastly will upload log messages to the S3 bucket in the format specified in the S3 object.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `access_key` | string | The access key for your S3 account. Not required if <code>iam_role</code> is provided. |
| `acl` | string | The access control list (ACL) specific request header. See the AWS documentation for <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadInitiate.html#initiate-mpu-acl-specific-request-headers">Access Control List (ACL) Specific Request Headers</a> for more information. |
| `bucket_name` | string | The bucket name for S3 account. |
| `domain` | string | The domain of the Amazon S3 endpoint. |
| `file_max_bytes` | integer | The maximum number of bytes for each uploaded file. A value of 0 can be used to indicate there is no limit on the size of uploaded files, otherwise the minimum value is 1048576 bytes (1 MiB.). |
| `iam_role` | string | The Amazon Resource Name (ARN) for the IAM role granting Fastly access to S3. Not required if <code>access_key</code> and <code>secret_key</code> are provided. |
| `path` | string | The path to upload logs to. |
| `public_key` | string | A PGP public key that Fastly will use to encrypt your log files before writing them to disk. |
| `redundancy` | string | The S3 redundancy level. |
| `secret_key` | string | The secret key for your S3 account. Not required if <code>iam_role</code> is provided. |
| `server_side_encryption` | string | Set this to <code>AES256</code> or <code>aws:kms</code> to enable S3 Server Side Encryption. |
| `server_side_encryption_kms_key_id` | string | Optional server-side KMS Key Id. Must be set if <code>server_side_encryption</code> is set to <code>aws:kms</code> or <code>AES256</code>. |
| `compression_codec` | string | The codec used for compressing your logs. Valid values are <code>zstd</code>, <code>snappy</code>, and <code>gzip</code>. Specifying both <code>compression_codec</code> and <code>gzip_level</code> in the same API request will result in an error. |
| `format` | string | A Fastly <a href="https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/">log format string</a>. |
| `format_version` | integer | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in <code>vcl_log</code> if <code>format_version</code> is set to <code>2</code> and in <code>vcl_deliver</code> if <code>format_version</code> is set to <code>1</code>. |
| `gzip_level` | integer | The level of gzip encoding when sending logs (default <code>0</code>, no compression). Specifying both <code>compression_codec</code> and <code>gzip_level</code> in the same API request will result in an error. |
| `log_processing_region` | string | The geographic region where the logs will be processed before streaming. Valid values are <code>us</code>, <code>eu</code>, and <code>none</code> for global. |
| `message_type` | string | How the message should be formatted. |
| `name` | string | The name for the real-time logging configuration. |
| `period` | integer | How frequently log files are finalized so they can be available for reading (in seconds). |
| `placement` | string | Where in the generated VCL the logging call should be placed. If not set, endpoints with <code>format_version</code> of 2 are placed in <code>vcl_log</code> and those with <code>format_version</code> of 1 are placed in <code>vcl_deliver</code>. |
| `response_condition` | string | The name of an existing condition in the configured endpoint, or leave blank to always execute. |
| `timestamp_format` | string | A timestamp format. (Read-only) |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `deleted_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `service_id` | string | Alphanumeric string identifying the service. (Read-only) |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `version` | string | String identifying a service version. (Read-only) |

## API endpoints

### List AWS S3 log endpoints

**GET** `/service/{service_id}/version/{version_id}/logging/s3`

List all of the S3s for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Create an AWS S3 log endpoint

**POST** `/service/{service_id}/version/{version_id}/logging/s3`

Create a S3 for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Get an AWS S3 log endpoint

**GET** `/service/{service_id}/version/{version_id}/logging/s3/{logging_s3_name}`

Get the S3 for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_s3_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Update an AWS S3 log endpoint

**PUT** `/service/{service_id}/version/{version_id}/logging/s3/{logging_s3_name}`

Update the S3 for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_s3_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Delete an AWS S3 log endpoint

**DELETE** `/service/{service_id}/version/{version_id}/logging/s3/{logging_s3_name}`

Delete the S3 for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_s3_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

