-
Open IAM → Users in the AWS Console and click Add user
-
Enter a username (e.g.
hydration-user) -
On Permissions options, choose Add user to group and click Create group
-
Name the group (e.g.
hydration-group) and attach these managed policies:AmazonS3FullAccessAmazonAthenaFullAccess
(Skip extra policies to avoid unnecessary permissions; you can add them later if needed.)
-
Select the created group
-
Finish by clicking Create user
- Open the user previously created
- Click the Security credentials tab
- Under Access keys, click Create access key
- Choose Use case: Application running outside AWS
- Click Create access key
- Click Download .csv file — it contains your Access key ID and Secret access key.
⚠️ Important: The secret access key is shown only once. Keep the.csvfile in a safe place.
- Add environment variables in IntelliJ (local development)
- Add the following properties to your Spring configuration file:
aws.access-key=${AWS_ACCESS_KEY_ID} aws.secret-key=${AWS_SECRET_ACCESS_KEY} aws.region=${AWS_REGION:us-east-2}
- Open the Amazon S3 console
- Create the
spring-hydration-bucketS3 Bucket - Create a folder named
athena-resultsinside the Bucket - Create additional folders for each Athena table as needed
- In the Athena console, open the Workgroups section from the left-hand menu
- Click Add workgroup and enter a name (
hydration_wg) for the new workgroup - Under Query result configuration, select Custom managed and specify the S3 URI for the
athena-resultfolder
-
Open Amazon Athena → Query editor
-
Create a Database (if not already created):
CREATE DATABASE IF NOT EXISTS hydration_db;
-
Run the
create_athena_tables.sqlscript- Copy the contents of the
create_athena_tables.sqlfile - Paste the SQL queries into the query editor
- Execute the queries to create tables registered in the Glue Data Catalog and stored in S3 Buckets
- Copy the contents of the
-
Open the Amazon S3 Bucket
-
Go to the
spring-hydration-bucketbucket and open the desired folder -
Upload the
.csvfile- Click the Upload button.
- Select the
.csvfile - Click Upload to complete the process
Query the table:
SELECT * FROM hydration_db.<TABLE_NAME> LIMIT 10;