When you have a lot of parameters in your account, it can be difficult to find information about a single or several parameters at a time.

Scenario:

You want to search a string “XYZ” in the Value of each Parameter in the AWS parameter store. If the string is found in Value then print or show the Parameter name and the Value.

 

Solution:

1. You can use the AWS Systems Manager console to search the parameters. BUT it will not allow searching the Value string of the parameters. So it helps only if you know the parameter name or part of it then you can search the parameters and check the Values for the string you are looking for. This is not that helpful.

 

2. You can use the AWS Command Line Interface (AWS CLI). Run the following command to search the string in the Values of parameter-

 

#Get the list of ALL Parameters from parameter store. (change the region accordingly)

aws ssm describe-parameters --region=eu-west-2 --query 'Parameters[*].[Name]' --output text


#Get the details of a Parameter. (replace the parameter name and change region as required)

aws ssm get-parameter   --name <REPLACE parameter name> --region eu-west-2 


#Get only Name and Value as output for a Parameter. (replace the parameter name and change region as required) 

aws ssm get-parameter   --name <REPLACE parameter name> --region eu-west-2 --query "Parameter.{Name:Name,Value:Value}"


#search the string "XYZ" in the Value of the parameter and output the parameter Name and Value. This command will take each parameter, search the string in the Value of the parameter, and if the string is found it will print the Name and Value of the Parameter. (REPLACE your search string and region) 

aws ssm describe-parameters --region=eu-west-2 --query 'Parameters[*].[Name]' --output text | xargs -I {} aws ssm get-parameter   --name {} --region eu-west-2 --query "Parameter.{Name:Name,Value:Value}" | jq 'select(.Value | contains("<REPLACE search string XYZ>"))'