Query encrypted Amazon S3 data with Amazon Athena

Lab Steps

Logging in to the Amazon Web Services Console
Create an S3 bucket
Configuring Athena Query Results for encrypted storage on S3
Preparing the Data and Storing it on S3
Defining the Schema and Creating the Database Table in Athena
Confirming Athena Query Results

The hands-on lab is part of this learning path

Security - Specialty Certification Preparation for AWS
course-steps 23 certification 2 lab-steps 12 quiz-steps 5

Ready for the real environment experience?

Time Limit55m
star star star star star-half


Use Amazon Athena to query encrypted data on S3

Lab Overview

In this Lab you will use Amazon Athena to query server-side encrypted data stored on Amazon Simple Storage Service (S3). Amazon Athena is an interactive query service that allows you to issue standard Structured Query Language (SQL) commands to analyze data on S3. You will also learn how to encrypt the query results. This will provide an end-to-end data security model:

  • The data is stored encrypted (data at rest)
  • All communications within AWS are encrypted (data in transit)
  • The query results are encrypted (data at rest)

In addition to security, you will also learn several other features/benefits of using Athena and S3, such as speed, and the ability to query compressed data (which provides cost savings as well).

Lab Objectives

Upon completion of this lab you will be able to:

  • Encrypt data on S3
  • Define a schema in order to create a database and table in Amazon Athena
  • Perform basic queries in Athena
  • Encrypt the query results

Lab Prerequisites

You should be familiar with:

  • Amazon Simple Storage Service (S3) bucket creation and file uploads
  • Basic Standard Query Language (SQL) knowledge is not necessary, but is helpful

Lab Environment

After completing the lab instructions the environment should look similar to:



January 10th, 2019 - Added a validation Lab Step to check the work you perform in the Lab

About the Author


Greg has been a consistent high performer for pioneering technologies in the wireless web industries with an illustrious career that is a testament to his breadth of knowledge. Dabbling with MS Azure, at Cloud Academy, Greg really thrives on evangelizing the benefits of Amazon Web Services. A dedicated and passionate professional who learns new and emerging technologies quickly, Greg always ensures the highest quality and caliber of everything he produces.