- Newest
- Most votes
- Most comments
hi. after trying this for myself. I got the same result. Went to docs and found this. Appears the SDK has the 'bones' (errors if providing the wrong Key Names (Name,Values), but not fully implemented.
http://boto3.readthedocs.io/en/latest/reference/services/rds.html#RDS.Client.describe_db_instances
(dict) --
This type is not currently supported.
Name (string) -- [REQUIRED]
This parameter is not currently supported.
Values (list) -- [REQUIRED]
This parameter is not currently supported.
response = client.list_tags_for_resource(
ResourceName='arn:aws:rds:ap-south-1:XXXX:db:deletemedb',
Filters=[{'Name' : 'Environment', 'Values' : ['Production']}])
print(response)
<snip>
botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the ListTagsForResource operation: Unrecognized filter name: Environment
</snip>
HTH
Edited by: shallawe on Jul 26, 2017 3:24 AM
Thanks for the help and sanity check. After a little more digging, other post mentioned getting the ARN of the snapshot and use list_tags_for_resource to find the Taglist. From there, it could be filtered.
There's probably a little bit of a better way to verify the tag but this does work. Source is the client connection to RDS.
#Gets the tags of the snapshot based on the snapshot ARN
tagresponse = source.list_tags_for_resource(ResourceName=source_snap_arn)
print ("Response", tagresponse)
taglist = tagresponse['TagList']
#Looks for the Value Production
for tag in taglist:
print (tag['Key'], tag['Value'])
if tag['Value'] == 'Production':
print ("Found Production Snapshot")
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago