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

0

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

{"username":"my_real_username","password":"my_real_password","engine":"mysql","host":"my_real_host","port":"my_real_port","dbname":"my_real_dbname","dbInstanceIdentifier":"database-1"}

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


env:
  secrets-manager:
    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.

已提問 2 年前檢視次數 1347 次
1 個回答
0

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

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南