Hey All, Anyone used `aws paramstore` storing the ...
# ktor
t
Hey All, Anyone used
aws paramstore
storing the config value and resolving at runtime at the application start?
b
I’ve used it in a spring project before and it worked well.
a
yes, looks like this for me:
Copy code
return MapApplicationConfig(
  ...
  Pair("db.password", ssmService.getSsmParameter("${stage}.db.password", true)),
  ...
)
and the
ssmService
utilize the AWS
SsmClient
Straight forward.
t
@Alex thanks.. It's really simple one..
Actually I'm planning to migrate from DW to ktor.. in the current setup we have
application.yml
which has value like
Copy code
db:
   name: test
   username: {{user_name}}
In these user name should be replaced by the
ssmService
at runtime. How do i go about this one?
a
When you use
application.conf
you still need to create your db-connection somehow at the start of the app .. so you can decide: • are the keys for
db.*
in your config just ssm-keys? and you resolve them when you initialize your db • or do you prefix your ssm keys with
ssm:
(or stuff like this) in your config, to just resolve specific values from ssm (when
config._startsWith_(*"ssm:"*)
) For me I found it personally easier to use
embeddedServer
and use
MapApplicationConfig
.
t
Ah! It give me some idea to look into . Thanks
a
nice 👍