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 internet sadly.

1 Answer

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
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest