Skip to content

Instantly share code, notes, and snippets.

@siroken3
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save siroken3/9635375 to your computer and use it in GitHub Desktop.

Select an option

Save siroken3/9635375 to your computer and use it in GitHub Desktop.
botocore でいつも忘れる ec2.DescribeInstances の filterの書き方
import botocore
import botocore.session
s = botocore.session.get_session()
ec2 = s.get_service('ec2')
ep = ec2.get_endpoint()
op = ec2.get_operation('DescribeInstances')
# Nameタグの値がhogeあるいはfuga
status, resp = op.call(ep, filters=[{"Name":"tag:Name", "Values":["hoge","fuga"]}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment