How can I use advanced regex in a boto3 ec2 instance filter?
When using the CLI and various APIs, EC2 instance filtering is not done by "regex". Instead, the filters are simple *
and ?
wildcards.
According to this document, Listing and Filtering Your Resources, it does mention regex filtering. However, it's unclear in that section whether it's supported in the APIs or just the AWS Management Console.
However, later in the same document, in the "Listing and Filtering Using the CLI and API", it says:
You can also use wildcards with the filter values. An asterisk (*) matches zero or more characters, and a question mark (?) matches exactly one character. For example, you can use database as a filter value to get all EBS snapshots that include database in the description.
In this section, there is no mention of regex support.
Conclusion, I suspect that regex filtering is only supported in the Management Console UI.