I am trying to list the instances on tag values of different tag keys For eg> one tag key - Environment, other tag key - Role. My code is given below :
imp
Fix the Env and Role, as I am not sure mine or mootmoot's answer will work because the Array for Values expects strings.
reservervations = ec2.describe_instances(
Filters=[
{'Name': 'tag:environment', 'Values': ['%s'], 'Name': 'tag:role', 'Values': ['%s']} % (Env, Role),
]]
).get(
'Reservations', []
)