Reputation: 1
I am running a lambda to fetch ssm parameters in AWS and I want to filter using tags. I have tried the method recommended by aws but I keep getting this error:
"errorMessage": "An error occurred (ValidationException) when calling the DescribeParameters operation: An error occurred while calling one AWS dependency service."
Any help as to why? reference - https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html https://github.com/spulec/moto/blob/master/tests/test_ssm/test_ssm_boto3.py#L1043-L1045
This is the code that I am running:
import json
import boto3
ssm_client = boto3.client('ssm')
def lambda_handler(event, context):
print("Fetch group A ssm parameter: ")
leg_one_parameter = ssm_client.describe_parameters(
ParameterFilters=[{"Key": "tag:group", "Values":["A"]}]
)['Parameters']
parameter_name = list(map(lambda parameter: parameter['Name'], leg_one_parameter))
return parameter_name
Upvotes: 0
Views: 808
Reputation: 600
It should work. Validation error may be produced by a bug in the boto3... More info: boto3 error for creating stack instances with "deployment targets"
I tried to execute your request and it passed.
leg_one_parameter = ssm.describe_parameters(
ParameterFilters=[{"Key": "tag:group", "Values":["A"]}]
)['Parameters']
leg_one_parameter
[]
I used boto3 in version 1.24.3
Upvotes: 1