marmotdata/athena
Discover databases, tables, workgroups and saved queries from Amazon Athena
The Athena plugin discovers data catalogs, databases, tables, views, workgroups and saved queries from Amazon Athena.
Athena keeps no catalog of its own: the tables it queries live in the Glue Data Catalog. Databases, tables and views are therefore filed under the Glue provider with the same names the Glue plugin uses, so an Athena run and a Glue run land on one asset. Names are the full path, <database>.<table> for the default AwsDataCatalog and <catalog>.<database>.<table> for any other catalog. Set zone to tell two accounts or regions apart (a name you choose, not a cloud availability zone); it becomes part of every MRN, for example mrn://asset/table/glue@prod-eu/shop.orders, and must match the zone set on the Glue plugin for the two to share assets. Workgroups, saved queries and data catalogs are Athena's own objects and are filed under Athena.
Databases and tables are read through the Athena metadata API, which also serves federated catalogs. When that API does not answer for a Glue-backed catalog, the plugin reads the Glue Data Catalog directly instead. Set metadata_api to athena or glue to pin the choice.
Query history is not read, so this plugin produces no usage statistics or query-derived table-to-table lineage.
Required Permissions
sts:GetCallerIdentity is only needed with tags_to_metadata, because Athena does not return workgroup or catalog ARNs and the plugin builds them from the account id.
AWS Configuration
See AWS Configuration for the supported AWS configuration options.
Keyless authentication
On Marmot Cloud or Marmot Enterprise the pipeline can present its own identity instead of access keys. Register your Marmot instance as an IAM OIDC identity provider (client id sts.amazonaws.com), create a role whose trust policy allows sts:AssumeRoleWithWebIdentity for that provider with <issuer host>:sub equal to the pipeline's subject, pipeline:<name> as reported by the pipeline API, and set credentials.role_arn and credentials.region. No key exists anywhere; Marmot mints a short-lived token for each run.
In the UI
Point and click, no config file needed.
- Open Runs and choose Create pipeline.
- Pick AWS Athena from the plugin list.
- Fill in the settings, set a schedule and save.
With the CLI
Save a YAML config, then run marmot ingest.
Not using plugins? Other ways to populate Marmot
Configuration
Fields marked Required must be set.
tagsList of textTags to apply to discovered assets
external_linksList of groupsExternal links to show on all assets
nameTextDisplay name for the link
iconTextIcon identifier for the link
urlTextURL to the external resource
filterGroup of settingsFilter discovered assets by name (regex)
includeList of textInclude patterns for resource names (regex)
excludeList of textExclude patterns for resource names (regex)
zoneTextTells this system apart from others of the same technology and becomes part of every asset's MRN
credentialsGroup of settingsAWS credentials configuration
use_defaultYes or noUse AWS credentials from environment or default profile (recommended)
idTextAWS access key ID
secretSecretAWS secret access key
tokenSecretAWS session token
profileTextAWS profile to use from shared credentials file
role_arnTextIAM role to assume with the Marmot identity token (AssumeRoleWithWebIdentity); its trust policy names the Marmot issuer as an OIDC provider. Setting it federates: no keys are needed, and region is required. role, if also set, is assumed on top of it
roleTextAWS IAM role ARN to assume with AssumeRole from the base credentials (static keys, a profile, the default chain, or role_arn)
role_external_idTextExternal ID for cross-account role assumption
regionTextAWS region for services
endpointTextCustom endpoint URL for AWS services
tags_to_metadataYes or noConvert AWS tags to Marmot metadata
include_tagsList of textList of AWS tags to include as metadata. By default, all tags are included.
audienceTextAudience of the Marmot identity token. Derived from the credentials' federation settings; set it only when the cloud side expects another
catalogsList of textData catalogs to discover. All catalogs when empty
exclude_catalogsList of textData catalogs to skip
databasesList of textDatabases to discover. All databases when empty
exclude_databasesList of textDatabases to skip
workgroupsList of textWorkgroups to discover. All workgroups when empty
include_workgroupsYes or noWhether to catalog workgroups
include_saved_queriesYes or noWhether to catalog saved queries
include_columnsYes or noWhether to include table columns
include_partitionsYes or noWhether to include partition keys
discover_lineageYes or noWhether to discover lineage between catalogs, databases, tables, buckets and saved queries
metadata_apiOne ofWhich API reads databases and tables: auto, athena or glue
Assets emitted
Metadata this plugin attaches to each discovered asset.
Table
The metadata the plugin records for a table or view. The fields live under the `athena` key of the asset metadata, because the asset itself is owned by the Glue provider and shared with the Glue plugin.
Database
The metadata recorded for a database, under the `athena` key of the asset metadata.
Column
The per-column fields embedded in a table asset's schema.
Work Group
The metadata recorded for a workgroup.
Saved Query
The metadata recorded for a saved query.
Catalog
The metadata recorded for a data catalog.