-
Notifications
You must be signed in to change notification settings - Fork 85
Description
Expected Behavior
This is the error : 7 January 2026, 19:06 | Message: Could not resolve placeholder ${DB_PASSWORD} we are facing when starting our app on ECS this error appears when we we are using application.yml which has global variable defined .
NOTE: This application start woring with application-dev.ym where we have hardcoded value .
| 7 January 2026, 19:06 | at io.micronaut.runtime.Micronaut.run(Micronaut.java:333) | 7a39a4b6b05a472aa41637bd42221ede | service |
|---|---|---|---|
| 7 January 2026, 19:06 | at com.eqw.Application.main(Application.java:8) | 7a39a4b6b05a472aa41637bd42221ede | service |
| 7 January 2026, 19:06 | Caused by: io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [javax.sql.DataSource] | 7a39a4b6b05a472aa41637bd42221ede | service |
| **7 January 2026, 19:06 | Message: Could not resolve placeholder ${DB_PASSWORD}** | 7a39a4b6b05a472aa41637bd42221ede | service |
| 7 January 2026, 19:06 | Path Taken: | service | |
| 7 January 2026, 19:06 | @i.m.c.a.Context o.h.SessionFactory i.m.c.h.j.c.SessionFactoryPerDataSourceFactory.buildHibernateSessionFactoryBuilder#buildHibernateSessionFactoryBuilder(SessionFactoryBuilder sessionFactoryBuilder) |
This is bootstrap.properties
micronaut.application.name=-service
micronaut.config-client.enabled=true
aws.client.system-manager.parameterstore.enabled=true
aws.client.system-manager.parameterstore.use-secure-parameters=true
aws.distributed-configuration.search-active-environments=false
aws.distributed-configuration.search-common-application=true
this is my application.yml
micronaut:
config-client:
enabled: true
application:
name: -service
security:
authentication: cookie
token:
jwt:
signatures:
jwks:
admin:
url: ${ADMIN_OAUTH_JWKS_URL}
authentication:
providers:
datasources:
default:
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
this is ECS IAM ROLE of ECS
{
"Statement": [
{
"Action": [
"ssm:GetParameter",
"ssm:GetParameters",
"ssm:GetParametersByPath"
],
"Effect": "Allow",
"Resource": [
"arn:aws:ssm:us-east-1:613**529796:parameter/config/application_dev/"
]
},
{
"Action": [
"kms:Decrypt"
],
"Condition": {
"StringEquals": {
"kms:ViaService": "ssm.us-east-1.amazonaws.com"
we have given in Environment variable: MICRONAUT_ENVIRONMENT: dev
this is how we stored our parameters in Parameter store : (we tried all three ways )
/config/DB_PASSWORD
/config/service/DB_PASSWORD
/config/application_dev/DB_PASSWORD
In Pom.xml we have added dependency for Parameter store.
Actual Behaviour
It should have fetched the AWS SSM (secrets) automatically to AWS ECS container .
Steps To Reproduce
No response
Environment Information
No response
Example Application
No response
Version
4.5