AwsCLI
Материал из noname.com.ua
AWS CLI
Сниппеты работы с AWS CLI - шпаргалка
Вывод в тексте
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[Placement.AvailabilityZone, State.Name, InstanceId]'
ap-southeast-1b running i-0cddd1f1b8d20e34b ap-southeast-1b running i-0e3450c0c7052f960 ...
Пример с таблицей
aws ec2 describe-instances --query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`]|[0].Value,PublicIP:PublicIpAddress}' --output table
----------------------------------------------------------------------------------------------- | DescribeInstances | +---------------------------------------------------------------------------+-----------------+ | Name | PublicIP | +---------------------------------------------------------------------------+-----------------+ | some-host | 52.0.0.0 | +---------------------------------------------------------------------------+-----------------+
Еще пример с выводом таблицы
aws ec2 describe-instances --query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`]|[0].Value,PublicIP:PublicIpAddress, AvailabilityZone:Placement.AvailabilityZone, State:State.Name}' --output table