Issue
I would like to use a variable collected as part of python script in the place of KEY in tag:key. I find no luck. Below is my code. But the value part works.
tag_key_f = input("Enter Tag Name to find: ")
tag_val_f = input("Enter Tag Value to find: ")
instances = ec2.describe_instances(Filters=[{'Name': 'tag:tag_key_f', 'Values': [tag_val_f]}])
Solution
This was fixed just by adding a separator.
tag_key_f = input("Enter Tag Name to find: ")
tag_val_f = input("Enter Tag Value to find: ")
instances = ec2.describe_instances(Filters=[{'Name': 'tag:'+tag_key_f, 'Values': [tag_val_f]}])
Answered By - CDP-cdp