I have a Spring boot app which connects to PostgreSQL on AWS. I want to store database configuration like DB URL,Username and password on the AWS parameter store as secureStrings.
I want to access these parameters from AWS Parameter store in Environment variables like we set:
SERVER_PORT = 5000
SPRING_DATASOURCE_PASSWORD = /dev/databases/postgresql/awsdbinstance/password
where /dev/databases/postgresql/awsdbinstance/password
is the name of the AWS parameter store.
I have also added an IAM policy to EC2 instances for SSMReadOnly access but still the values are not accessible. What am I doing wrong and how can i achieve this?
Also, what is the standard way to achieve this?
I didn't want to add a property in YAML file which tries to retrieve value from AWS parameter store rather i assumed its better if the property is injected via Elastic Beanstalk environment variables itself.