How to use AWS secret manager(secret name) in gradle/Jenkins AWS plugin for liquibase deployment

How to use AWS secret manager(secret name) in gradle for liquibase deployment.

Instead using url, username and password as shown below, i would like to use AWS secret name for RDS db connection

I am looking for two options either through Jenkins AWS secret manager credential plugin or through gradle itself

Could any one please guide me to implement this?

task(‘qa’) << {
println “executing qa”
liquibase {
activities {
main {
changeLogFile changeLog
url ‘jdbc:mysql://’
username ‘admin’
password ‘1234’

I don’t think the liquibase plugin support AwsCredentials as which can be done when defining repositories, so you have some options.

Environmental variables:

username = System.getenv('AWS_KEY') ?: ''
password = System.getenv('AWS_SECRET') ?: ''

or investigate using one of the many credentials plugins - I have used @etiennestuder 's version many times -

Thank you. I will try it out.