Search Syntax
- Component name: Search for
prodto find components with prod in their name. - Schema name: Search for
Instanceto find EC2 instances. - Combine them: Search for
prod Instanceto find EC2 instances with prod in their name!
When you need more than mere words can convey, you can use more advanced search features like attribute searches and boolean logic.
Attribute Search Syntax
To search inside components, you can use attribute searches. InstanceType:, for example, will search for instances with that type. Specific syntax for attribute searches:
Basic Syntax:
InstanceType:m8g.mediumwill search for m8g.medium instances.Alternatives:
InstanceType:m8g.medium|m8g.smallwill search for m8g.medium or m8g.large instances.Wildcards:
InstanceType:m8g.*will search for all m8g instances regardless of size.Wildcards can be placed anywhere in the value:
InstanceType:m*.largewill matchm8g.large,m7g.largeand evenm7i-flex.large.Tip: While building your infrastructure, you may want to find things where you did not specify an attribute. For example,
!AvailabilityZone:*will bring back instances where you did not specify an AvailabilityZone, so you can add one!Exact Matches:
Runtime:"python3.11"will match only thepython3.11runtime on a lambda function, but notpython3.You can use quotes (
") to pin down your search and match an exact value. If you don't use quotes, things that start with the value you specify are matched.Quotes will also allow you to use spaces in your search:
Description:"Production Access".Attribute Paths:
LaunchTemplate/Version:1will match instances withLaunchTemplate version 1.Sometimes an attribute has a generic name, and you need to specify more of its path.
LaunchTemplate/Version:1is useful because it will not bring in every other AWS resource with a randomVersionfield set to 1.Schema:
schema:AWS::EC2::Instance, orschema:Instance, will find all EC2 instances.
All of these features can be mixed and matched: InstanceType:m8g.*|"mac1.metal" will find m8g instances as well as mac1.metal instances.
Boolean Logic
Sometimes you need more precise logic than just "find things matching A, B and C." For this, we support full boolean logic, with nesting.
- Negation:
!InstanceType:m8g.largewill match all instances that are not m8g.large. - Alternatives:
Instance | Imagewill match all instances and images. - Grouping:
(prod Instance) | (dev Image)will match Instances in prod, and images with "dev" in the name. - "And" (narrowing a search) is done by putting spaces between things.
&is supported but redundant:prod Instanceandprod & Instancedo the same thing.
Putting It All together
This search will bring back m8g.medium instances, and load balancers with MaxSize>1, in prod:
prod (schema:Instance InstanceType:m8g.* | schema:LoadBalancer !MaxSize:0|1)