简体   繁体   中英

Fetch specific Secret value for a specific key in AWS Secrets Manager via Powershell

I am fetching a secret from AWS Secrets Manager, but currently getting a list of all the key-value pairs. I just want secret value for a specific key in return.

Get-SECSecretValue -SecretId "secret-arn" -Select SecretString

I was not able to find any solution on inte.net sadly.

You can use the ConvertFrom-Json to parse the json response and then use json object to get the corresponding value.

username = (ConvertFrom-Json -InputObject (Get-SECSecretValue -SecretId secret-arn ).SecretString).username

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM