-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
AWS SecretsManager JSON number value results in "unable to unmarshal secret" #510
Copy link
Copy link
Closed
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
Describe the solution you'd like
If a secret contains a JSON number value, this value should be converted to a string value.
What is the added value?
AWS SecretsManager includes the ability to automatically rotate RDS credentials. The credentials secret that it creates include "port", and the value is a number in JSON.
AWS SecretManager Secret (JSON):
{
"database": "my-db",
"password": "%K>U~(_b.&RJs#xFE!P-B?tmWDp3JXcd",
"masterarn": "arn:aws:secretsmanager:us-east-1:1234567890:secret:secretMySqlMasterUser-ABC-ABC",
"engine": "mysql",
"port": 3306,
"dbInstanceIdentifier": "abc123",
"host": "abc123.us-east-1.rds.amazonaws.com",
"username": "my-db-user"
}
should produce Secret data:
database: "my-db",
password: "%K>U~(_b.&RJs#xFE!P-B?tmWDp3JXcd",
masterarn: "arn:aws:secretsmanager:us-east-1:1234567890:secret:secretMySqlMasterUser-ABC-ABC",
engine: "mysql",
port: "3306",
dbInstanceIdentifier: "abc123",
host: "abc123.us-east-1.rds.amazonaws.com",
username: "my-db-user"
Observations (Constraints, Context, etc):
In code: /pkg/provider/aws/secretsmanager/secretsmanager.go: 117
Error message: secret my-secret: json: cannot unmarshal number into Go value of type string
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.