2024-06-18 15:53:06 +02:00
---
2024-09-25 10:49:44 +05:30
title: Run the S3 Storage Connector Externally
2024-06-18 15:53:06 +02:00
slug: /connectors/storage/s3/yaml
---
{% connectorDetailsHeader
2024-09-25 10:49:44 +05:30
name="S3 Storage"
2024-06-18 15:53:06 +02:00
stage="PROD"
platform="OpenMetadata"
availableFeatures=["Metadata"]
unavailableFeatures=[]
/ %}
This page contains the setup guide and reference information for the S3 connector.
Configure and schedule S3 metadata workflows from the CLI:
- [Requirements ](#requirements )
- [Metadata Ingestion ](#metadata-ingestion )
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/external-ingestion-deployment.md" /%}
2024-06-18 15:53:06 +02:00
## Requirements
{%inlineCallout icon="description" bold="OpenMetadata 1.0 or later" href="/deployment"%}
To deploy OpenMetadata, check the Deployment guides.
{%/inlineCallout%}
To run the metadata ingestion, we need the following permissions in AWS:
### S3 Permissions
For all the buckets that we want to ingest, we need to provide the following:
- `s3:ListBucket`
- `s3:GetObject`
- `s3:GetBucketLocation`
- `s3:ListAllMyBuckets`
Note that the `Resources` should be all the buckets that you'd like to scan. A possible policy could be:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:ListAllMyBuckets"
],
"Resource": [
"arn:aws:s3:::*"
]
}
]
}
```
### CloudWatch Permissions
Which is used to fetch the total size in bytes for a bucket and the total number of files. It requires:
- `cloudwatch:GetMetricData`
- `cloudwatch:ListMetrics`
The policy would look like:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"cloudwatch:GetMetricData",
"cloudwatch:ListMetrics"
],
"Resource": "*"
}
]
}
```
### Python Requirements
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/python-requirements.md" /%}
2024-06-18 15:53:06 +02:00
To run the Athena ingestion, you will need to install:
```bash
pip3 install "openmetadata-ingestion[athena]"
```
### OpenMetadata Manifest
In any other connector, extracting metadata happens automatically. In this case, we will be able to extract high-level
metadata from buckets, but in order to understand their internal structure we need users to provide an `openmetadata.json`
file at the bucket root.
`Supported File Formats: [ "csv", "tsv", "avro", "parquet", "json", "json.gz", "json.zip" ]`
You can learn more about this [here ](/connectors/storage ). Keep reading for an example on the shape of the manifest file.
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/storage/manifest.md" /%}
2024-06-18 15:53:06 +02:00
## Metadata Ingestion
All connectors are defined as JSON Schemas.
[Here ](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/storage/s3Connection.json )
you can find the structure to create a connection to Athena.
In order to create and run a Metadata Ingestion workflow, we will follow
the steps to create a YAML configuration able to connect to the source,
process the Entities if needed, and reach the OpenMetadata server.
The workflow is modeled around the following
[JSON Schema ](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/workflow.json )
### 1. Define the YAML Config
This is a sample config for Athena:
{% codePreview %}
{% codeInfoContainer %}
#### Source Configuration - Service Connection
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/common/aws-config-def.md" /%}
2024-06-18 15:53:06 +02:00
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/storage/source-config-def.md" /%}
2024-06-18 15:53:06 +02:00
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/ingestion-sink-def.md" /%}
2024-06-18 15:53:06 +02:00
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/workflow-config-def.md" /%}
2024-06-18 15:53:06 +02:00
#### Advanced Configuration
{% codeInfo srNumber=11 %}
2024-06-27 00:12:11 +05:30
**Connection Options (Optional)**: Enter the details for any additional connection options that can be sent to storage service during the connection. These details must be added as Key-Value pairs.
2024-06-18 15:53:06 +02:00
{% /codeInfo %}
{% codeInfo srNumber=12 %}
2024-06-27 00:12:11 +05:30
**Connection Arguments (Optional)**: Enter the details for any additional connection arguments such as security or protocol configs that can be sent to storage service during the connection. These details must be added as Key-Value pairs.
2024-06-18 15:53:06 +02:00
{% /codeInfo %}
{% codeInfo srNumber=13 %}
- **Bucket Names (Optional)**: Provide the names of buckets that you would want to ingest, if you want to ingest metadata from all buckets or apply a filter to ingest buckets then leave this field empty.
{% /codeInfo %}
{% /codeInfoContainer %}
{% codeBlock fileName="filename.yaml" %}
```yaml {% isCodeBlock=true %}
source:
type: s3
serviceName: local_s3
serviceConnection:
config:
type: S3
awsConfig:
```
2025-03-24 09:07:16 +05:30
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/common/aws-config.md" /%}
2025-03-24 09:07:16 +05:30
2024-06-18 15:53:06 +02:00
```yaml {% srNumber=13 %}
2024-10-04 02:55:53 +05:30
bucketNames:
2024-06-18 15:53:06 +02:00
- s3-testing-1
- s3-testing-2
```
```yaml {% srNumber=11 %}
# connectionOptions:
# key: value
```
```yaml {% srNumber=12 %}
# connectionArguments:
# key: value
```
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/storage/source-config.md" /%}
2024-06-18 15:53:06 +02:00
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/ingestion-sink.md" /%}
2024-06-18 15:53:06 +02:00
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/workflow-config.md" /%}
2024-06-18 15:53:06 +02:00
{% /codeBlock %}
{% /codePreview %}
2025-04-18 08:42:17 +02:00
{% partial file="/v1.8/connectors/yaml/ingestion-cli.md" /%}
2024-06-18 15:53:06 +02:00
## Related
{% tilesContainer %}
{% tile
icon="mediation"
title="Configure Ingestion Externally"
description="Deploy, configure, and manage the ingestion workflows externally."
link="/deployment/ingestion"
/ %}
{% /tilesContainer %}