Technical requirements
Wherever possible, we will provide samples or instructions to guide you through the setup. However, to complete the activities in this chapter, you will need to ensure you have the following prerequisites available. Our command-line examples will be executed using Ubuntu, but most flavors of Linux should also work without modification.
You will need internet access to GitHub, S3, and the AWS Console.
You will also require a computer with the following installed:
- Chrome, Safari, or Microsoft Edge
- The AWS CLI
In addition, this chapter requires you to have an AWS account and accompanying IAM user (or role) with sufficient privileges to complete the activities in this chapter. Throughout this book, we will provide detailed IAM policies that attempt to honor the age-old best practice of "least privilege." For simplicity, you can always run through these exercises with a user that has full access, but we recommend that you use scoped-down IAM policies to avoid making costly mistakes and to learn more about how to best use IAM to secure your applications and data. You can find the suggested IAM policy for this chapter in this book's accompanying GitHub repository, listed as chapter_1/iam_policy_chapter_1.json
:
https://github.com/PacktPublishing/Serverless-Analytics-with-Amazon-Athena/tree/main/chapter_1
This policy includes the following:
- Read and Write access to one S3 bucket using the following actions:
s3:PutObject
: Used to upload data and also for Athena to write query results.s3:GetObject
: Used by Athena to read data.s3:ListBucketMultipartUploads
: Used by Athena to write query results.s3:AbortMultipartUpload
: Used by Athena to write query results.s3:ListBucketVersions
s3:CreateBucket
: Used by you if you don't already have a bucket you can use.s3:ListBucket
: Used by Athena to read data.s3:DeleteObject
: Used to clean up if you made a mistake or would like to reattempt an exercise from scratch.s3:ListMultipartUploadParts
: Used by Athena to write a result.s3:ListAllMyBuckets
: Used by Athena to ensure you own the results bucket.s3:ListJobs
: Used by Athena to write results.
- Read and Write access to one Glue Data Catalog database, using the following actions:
glue:DeleteDatabase
: Used to clean up if you made a mistake or would like to reattempt an exercise from scratch.glue:GetPartitions
: Used by Athena to query your data in S3.glue:UpdateTable
: Used when we import our sample data.glue:DeleteTable
: Used to clean up if you made a mistake or would like to reattempt an exercise from scratch.glue:CreatePartition
: Used when we import our sample data.glue:UpdatePartition
: Used when we import our sample data.glue:UpdateDatabase
: Used when we import our sample data.glue:CreateTable
: Used when we import our sample data.glue:GetTables
: Used by Athena to query your data in S3.glue:BatchGetPartition
: Used by Athena to query your data in S3.glue:GetDatabases
: Used by Athena to query your data in S3.glue:GetTable
: Used by Athena to query your data in S3.glue:GetDatabase
: Used by Athena to query your data in S3.glue:GetPartition
: Used by Athena to query your data in S3.glue:CreateDatabase
: Used to create a database if you don't already have one you can use.glue:DeletePartition
: Used to clean up if you made a mistake or would like to reattempt an exercise from scratch.
- Access to run Athena queries.
Important Note
We recommend against using Firefox with the Amazon Athena console as we have found, and reported, a bug associated with switching between certain elements in the UX.