Step 11: Query the Data Lake Using Amazon Athena - AWS Lake Formation

Step 11: Query the Data Lake Using Amazon Athena

Use the Amazon Athena console to query the CloudTrail data in your data lake.

  1. Open the Athena console at https://console.aws.amazon.com/athena/ and sign in as the data analyst, user datalake_user.

  2. If necessary, choose Get Started to continue to the Athena query editor.

  3. For Data source, choose AwsDataCatalog.

  4. For Database, choose lakeformation_cloudtrail.

    The Tables list populates.

  5. On the overflow menu (3 dots arranged horizontally) beside the table cloudtrailtest-cloudtrail, choose Preview table, then choose Run.

    The query runs and displays 10 rows of data.

    If you have not used Athena before, you must first configure an Amazon S3 location in the Athena console for storing the query results. The datalake_user must have the necessary permissions to access the Amazon S3 bucket that you choose.

Note

Now that you have completed the tutorial, grant data permissions and data location permissions to the principals in your organization.