1
votes

I'm looking for a programmatic way to retrieve parameters just by giving the name or a part of the complete path (instead of giving the full path with the name).

It's pretty easy using the Parameter Store AWS Systems Manager console, if I type tokens, I retrieve all parameters where the Name contains tokens :

tokens_search

Is there a way to do the same but using AWS CLI or AWS SDK (python or Go preferably) ?

2

2 Answers

3
votes

I think this is what you are after:

aws ssm describe-parameters --parameter-filters Key=Name,Values=token,Option=Contains
1
votes

Or with Python:

import boto3

response = boto3.client("ssm").describe_parameters(
    ParameterFilters=[
        {
            'Key': 'Name',
            'Option': 'Contains',
            'Values': [
                'token',
            ]
        },
    ]
)