Get AWS SSM Parameters Tags without Get Parameter

1k Views Asked by At

I am trying to list of all Parameters along with all their tags, I am trying to do so without listing the value of the parameters.

My initial approach was to do a describe_parameters and then loop through the Key Names and then perform list_tags, while doing so I found out that the ARNs are needed to perform list_tags which are not returned in the describe parameters.

Is there a way to get the parameters along with their tags without actually getting the parameters?

1

There are 1 best solutions below

2
On

You can do this with the resource groups tagging api IF THEY ARE ALREADY TAGGED. Here's a basic example below without pagination.

import boto3

profile = "your_profile_name"
region = "us-east-1"
session = boto3.session.Session(profile_name=profile, region_name=region)
client = session.client('resourcegroupstaggingapi')

response = client.get_resources(
    ResourceTypeFilters=[
        'ssm',
    ],
)

print(response)

If you're wanting to discover untagged parameters, this won't work. Better would be to setup config rules to highlight these issues without you having to manage searching for them.