Skip to main content

Athena

Amazon Athena runs SQL queries directly against files in S3, using the Glue Data Catalog for table definitions. In the Data and ETL Blueprint it is the way a person looks at what the pipeline produced. No unit creates Athena resources; the service is there to use once the catalog is populated.

What it does

Athena is serverless: you pick a database from the Data Catalog, write a query, and pay for the data scanned. It reads columnar formats such as Parquet efficiently, honors partition columns to skip files, and writes query results to an S3 location you choose. When Lake Formation governs the catalog, Athena enforces the same grants as every other consumer.

How BuiltForProd uses it

The blueprint prepares everything Athena needs and leaves the query to you:

  • The Glue job writes Parquet under output/ in the processed bucket, partitioned by year, month and day. The crawler scans that same prefix and writes the tables it finds into acme-usw2-dev-processed-db, so the tables you query describe exactly what the job wrote.
  • The Glue job role already holds the Lake Formation query actions (StartQueryPlanning, GetQueryState, GetQueryStatistics, GetWorkUnits) that Athena's Lake Formation integration uses.
  • Access for people follows the Lake Formation grants: the sso_data_engineer_role_arns input gives a data-engineer permission set SELECT on the processed and curated databases, and column-level grants can hide sensitive columns from a principal. Athena applies these; a bucket policy denies any attempt to read the files directly.
  • Athena needs a query result location. The blueprint does not create one; the deployment guide has the reader create a results bucket in the stage account before the first query.

Beyond the data lake, the compliance guide lists Athena as one of the ways to query CloudTrail logs archived in the audit account's bucket when an auditor asks for evidence.

Terms you will see

TermMeaning
WorkgroupAn Athena setting group, including the query result location.
PartitionA column such as year whose value is encoded in the file path, so queries skip other paths.
ParquetThe columnar file format the Glue job writes.
Query result locationThe S3 path where Athena stores each query's output.
Data scannedWhat Athena bills on; partitions and columnar files reduce it.

Where to read more