Loading

Elastic S3 connector reference

The Elastic S3 connector is a connector for Amazon S3 data sources.

Important

As of Elastic 9.0, managed connectors on Elastic Cloud Hosted are no longer available. All connectors must be self-managed.

This connector is available as a self-managed connector. This self-managed connector is compatible with Elastic versions 8.6.0+. To use this connector, satisfy all self-managed connector requirements.

To create a new Amazon S3 connector:

  1. In the Kibana UI, navigate to the Search → Content → Connectors page from the main menu, or use the global search field.
  2. Follow the instructions to create a new Amazon S3 self-managed connector.

You can use the Elasticsearch Create connector API to create a new self-managed Amazon S3 self-managed connector.

For example:

 PUT _connector/my-s3-connector {
  "index_name": "my-elasticsearch-index",
  "name": "Content synced from Amazon S3",
  "service_type": "s3"
}

Refer to the Elasticsearch API documentation for details of all available Connector APIs.

To use this connector as a self-managed connector, see Self-managed connectors.

For additional operations, see Connectors UI in Kibana.

S3 users will also need to Create an IAM identity

Users need to create an IAM identity to use this connector as a self-managed connector. Refer to the AWS documentation.

The policy associated with the IAM identity must have the following AWS permissions:

  • ListAllMyBuckets
  • ListBucket
  • GetBucketLocation
  • GetObject

Currently the connector does not support S3-compatible vendors.

The following configuration fields are required to set up the connector:

buckets

List of S3 bucket names. * will fetch data from all buckets. Examples:

  • testbucket, prodbucket
  • testbucket
  • *
Note

This field is ignored when using advanced sync rules.

aws_access_key_id
Access Key ID for the AWS identity that will be used for bucket access.
aws_secret_access_key
Secret Access Key for the AWS identity that will be used for bucket access.
read_timeout
The read_timeout for Amazon S3. Default value is 90.
connect_timeout
Connection timeout for crawling S3. Default value is 90.
max_attempts
Maximum retry attempts. Default value is 5.
page_size
Page size for iterating bucket objects in Amazon S3. Default value is 100.

You can deploy the Amazon S3 connector as a self-managed connector using Docker. Follow these instructions.

Refer to DOCKER.md in the elastic/connectors repo for more details.

Find all available Docker images in the official registry.

Tip

We also have a quickstart self-managed option using Docker Compose, so you can spin up all required services at once: Elasticsearch, Kibana, and the connectors service. Refer to this README in the elastic/connectors repo for more information.

Note
  • Content from files bigger than 10 MB won’t be extracted by default. You can use the self-managed local extraction service to handle larger binary files.
  • Permissions are not synced. All documents indexed to an Elastic deployment will be visible to all users with access to that Elastic Deployment.

Basic sync rules are identical for all connectors and are available by default.

Note

A full sync is required for advanced sync rules to take effect.

Advanced sync rules are defined through a source-specific DSL JSON snippet.

Use advanced sync rules to filter data to be fetched from Amazon S3 buckets. They take the following parameters:

  1. bucket: S3 bucket the rule applies to.
  2. extension (optional): Lists which file types to sync. Defaults to syncing all types.
  3. prefix (optional): String of prefix characters. The connector will fetch file and folder data that matches the string. Defaults to "" (syncs all bucket objects).


Advanced sync rules examples

Fetching files and folders recursively by prefix

Example: Fetch files/folders in folder1/docs.

[
  {
    "bucket": "bucket1",
    "prefix": "folder1/docs"
  }

]

Example: Fetch files/folder starting with folder1.

[
  {
    "bucket": "bucket2",
    "prefix": "folder1"
  }
]

Fetching files and folders by specifying extensions

Example: Fetch all objects which start with abc and then filter using file extensions.

[
  {
    "bucket": "bucket2",
    "prefix": "abc",
    "extension": [".txt", ".png"]
  }
]

See Content extraction.

The connector framework enables operators to run functional tests against a real data source. Refer to Connector testing for more details.

To execute a functional test for the Amazon S3 self-managed connector, run the following command:

make ftest NAME=s3

By default, this will use a medium-sized dataset. To make the test faster add the DATA_SIZE=small argument:

make ftest NAME=s3 DATA_SIZE=small

There are no known issues for this connector.

See Known issues for any issues affecting all connectors.

See Troubleshooting.

See Security.

This connector is built with the Elastic connector framework.

View the source code for this connector (branch main, compatible with Elastic 9.0).