This Spring Boot application demonstrates different methods to connect to AWS to retrieve AWS secrets.
This project showcases various approaches to retrieve AWS secrets within a Spring Boot environment.
Ensure you have the following prerequisites:
- Java Development Kit (JDK) installed.
- AWS credentials set up and configured.
Please refer to: https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html
- Clone this repository.
- Run the application using Maven:
mvn spring-boot:run
For detailed implementation, refer to the provided AWS Secrets Retrieval Tutorial Video. https://youtu.be/1j028KYS4ps?si=tuILDHmxy5Nne_oM
- Open the IAM Dashboard by searching for IAM on the AWS Search Bar.
- Click on "Users" or "Roles" on the left side.
- Search for the user or role and open it.
- Click "Add Permissions" or "Attach Policies". For users, click "Attach existing policies directly". (Roles don't need this step.) If you search and can't find a suitable policy, click "Create Policy".
- Choose "Secrets Manager" as the service and "GetSecretValue" as Action (You can search for these on each step.)
- Click "Add" then "Next: Tags" then "Next: Review". Enter a name within the constraints, and click "Create policy".
- Go back to the Attach Policy page and click the Refresh button (just above the table, on the right side).
- Search for your policy, click the checkbox, and click "Attach policy".
- Test your application again.