By using AWS re:Post, you agree to the Terms of Use

How do I retrieve my secrets from secret manager in a pipeline build?


AWS secrets-manager does not decode my key/values when retrieving... what am I missing?

Hi when I retrieve my SecretString from Secrets-manager i get:

'{"username": "***","password": "***" ,"engine":"mysql","host":"***","port":"***","dbname":"***""dbInstanceIdentifier":"database-1"}',

Instead of


I have tried using both my buildspec.yml file doing:

    DB_TEST_HOST: "test:host"
    DB_TEST_NAME: "test:dbname"
    DB_TEST_PORT: "test:port"
    DB_TEST_USER: "test:username"
    DB_TEST_USER_PASSWORD: "test:password"

And implemented the code suggested in secrets-manager. Both give the the bad result. I have also attached "SecretsManagerReadWrite" policy and kms:Decrypt policy to the role used when trying to retrieve these parameters.

1 Answer

Everything is in order. These variables are not visible anymore in code. I guess it's a new update from AWS

answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions