Area: Ingestion
Sub-Area: S3
Applies to: OSS + Cloud
Issue
The S3 source fails to extract metadata for your S3 assets, or you expect lineage for S3 files and don't see any.
You Might Be Asking
- Why does my S3 recipe fail with "AWS config is required for S3 file sources" or "path_spec.include cannot contain '**'"?
- Does the S3 source create lineage?
- Does
profile_patternsturn on detailed metadata?
Cause
-
AWS settings are in the wrong place. In the
s3source,aws_access_key_id,aws_secret_access_key,aws_regionand the other AWS keys are fields of theaws_configblock. They are not top-level keys. When the platform iss3andaws_configisn't set, ingestion fails withAWS config is required for S3 file sources. The S3 source config rejects keys it doesn't define, so AWS keys at the top level also fail validation. -
**ininclude. Anincludethat contains**fails withpath_spec.include cannot contain '**'unless you setallow_double_stars: trueon that path spec. The default isfalse. -
profile_patternsdoes nothing on its own. It defaults to allow all and only filters which tables get profiled. Profiling is off until you setprofiling.enabled: true. - The S3 source doesn't emit lineage. Its declared capabilities are containers, data profiling, operation capture, schema metadata, tags and probe. It declares no lineage capability.
Solution
1. Fix the recipe
Put AWS settings under aws_config, and use {table} in include to mark the folder that becomes one dataset:
source:
type: s3
config:
path_specs:
- include: "s3://your-bucket/data/{table}/*.parquet"
aws_config:
aws_region: "us-east-1"
aws_access_key_id: "${AWS_ACCESS_KEY_ID}"
aws_secret_access_key: "${AWS_SECRET_ACCESS_KEY}"
profiling:
enabled: true
- Instead of access keys,
aws_configalso acceptsaws_roleoraws_profile. - Without
{table}ininclude, each file becomes its own dataset. - To group partition folders such as
year=2024into one dataset, end the include at the table folder, for examples3://your-bucket/data/{table}/. Partitions are auto-detected (autodetect_partitionsdefaults totrue). An include that ends in{table}or{table}/is allowed withoutallow_double_stars. - Schema inference is on by default (
enable_schema_inference: true). - Remove the
profilingblock if you don't want profiling. Profiling slows ingestion. - If you use
table_name, every named variable in it must appear ininclude. Don't use{folder}, which is reserved. - The
s3source type covers thes3andfileplatforms only. For Google Cloud Storage, use thegcssource.
To check your path_specs before you ingest, use datahub recipe probe. See Checking path_specs before you ingest and Path Specs.
2. Check IAM permissions
The minimum IAM actions are s3:ListBucket, s3:GetBucketLocation and s3:GetObject. s3:GetObject is needed for schema inference. Add s3:GetBucketTagging or s3:GetObjectTagging only if you turn on use_s3_bucket_tags or use_s3_object_tags. If GetObjectTagging is denied, ingestion fails. If GetBucketTagging is denied, ingestion logs a warning and attaches no bucket tags. A wildcard bucket in include also needs s3:ListAllMyBuckets.
3. Add lineage from outside the S3 source
Because the S3 source emits no lineage, create it yourself with the Python SDK. DataHubClient.from_env() reads DATAHUB_GMS_URL and DATAHUB_GMS_TOKEN, or the ~/.datahubenv file that datahub init creates. The lineage client has add_lineage(*, upstream, downstream, column_lineage=False, transformation_text=None). See Adding lineage with the Python SDK for a worked example.