MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / list_instances

Function list_instances

misc/python/materialize/scratch.py:672–681  ·  view source on GitHub ↗

List AWS instances, optionally filtered by owner.

(
    owners: list[str] | None = None, all: bool = False
)

Source from the content-addressed store, hash-verified

670
671
672def list_instances(
673 owners: list[str] | None = None, all: bool = False
674) -> list[Instance]:
675 """List AWS instances, optionally filtered by owner."""
676 filters: list[FilterTypeDef] = []
677 if not all:
678 if not owners:
679 owners = [whoami()]
680 filters.append({"Name": "tag:LaunchedBy", "Values": owners})
681 return list(boto3.resource("ec2").instances.filter(Filters=filters))
682
683
684def get_old_instances() -> list[InstanceTypeDef]:

Callers 1

list_all_instancesFunction · 0.90

Calls 4

whoamiFunction · 0.85
listFunction · 0.50
appendMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected