Amazon uses the idea of "describing" resources using filters quite a bit.
A filter in python terms is a list of maps, and each value in the map's key-value pairs can be a list. The documentation is a little light on details, intentionally I believe, because the format is extremely flexible. A few examples of using this in Python and Powershell are below
If you wanted to get all of the instances that have a Name tag with the value webserver, you would use
filters = [{'Name':'tag:Name', 'Values': ['*Webserver*']}]
Here is an example of using this concept in a python script:
A filter in python terms is a list of maps, and each value in the map's key-value pairs can be a list. The documentation is a little light on details, intentionally I believe, because the format is extremely flexible. A few examples of using this in Python and Powershell are below
If you wanted to get all of the instances that have a Name tag with the value webserver, you would use
filters = [{'Name':'tag:Name', 'Values': ['*Webserver*']}]
Here is an example of using this concept in a python script:
No comments:
Post a Comment