/l3/users/slm/2018-12-minsk-aws/student04.BigClassRoom/user :1 :2 |
|
$aws configure
AWS Access Key ID [****************XQQQ]: AWS Secret Access Key [****************O5re]: Default region name [eu-west-1]: Default output format [json]: |
$aws configure
AWS Access Key ID [****************XQQQ]: AKIAIPTEFNENKAHEXQQQ AWS Secret Access Key [****************O5re]: Default region name [eu-west-1]: Default output format [json]: |
$sudo cat /root/credentials.csv | tr , '/n'
user4/}E-(C9rwuVY&/AKIAIPTEFNENKAHEXQQQ/tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re/https://chubin.signin.aws.amazon.com/console |
$sudo cat /root/credentials.csv | tr , '\n'
user4 }E-(C9rwuVY& AKIAIPTEFNENKAHEXQQQ tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re https://chubin.signin.aws.amazon.com/console |
$aws ec2 describe-instances
{ "Reservations": [ { "Groups": [], "ReservationId": "r-0ebb430cd3f1917cf", "OwnerId": "886677986286", "Instances": [ { "InstanceId": "i-080515adaa7956592", "AmiLaunchIndex": 0, ... "Placement": { "AvailabilityZone": "eu-west-1a", "GroupName": "", "Tenancy": "default" } } ] } ] } |
$aws ec2 describe-instances | jq
{ "Reservations": [ { "Groups": [], "OwnerId": "886677986286", "ReservationId": "r-0ebb430cd3f1917cf", "Instances": [ { "SourceDestCheck": true, "SecurityGroups": [ ... ], "PrivateDnsName": "ip-10-1-1-251.eu-west-1.compute.internal", "AmiLaunchIndex": 0, "RootDeviceType": "ebs", "SubnetId": "subnet-060d8c5c243f86664" } ] } ] } |
$aws ec2 describe-instances | jq[0]
![]() bash: jq[0]: command not found |
$aws ec2 describe-instances | jq.[0]
![]() bash: jq.[0]: command not found |
$history | grep jq
52 sudo apt install jq 54 cat 1.json | jq 57 cat 1.json | jq 58 cat 1.json | jq .[1].computer 59 cat 1.json | jq .[2].name 60 cat 1.json | jq .[1].name 61 cat 1.json | jq .[1] 62 cat 1.json | jq .[0].name 63 cat 1.json | jq .[0].computer 64 curl -s https://uinames.com/api/?region=belarus\&amount=5 | jq 65 curl -s https://uinames.com/api/?region=poland\&amount=5 | jq 66 curl -s https://uinames.com/api/?region=poland\&amount=5 | jq '.[] | .name + " " + .surname' 67 curl -s https://uinames.com/api/?region=poland\&amount=5 | jq '.[] | .name + " " + .surname' 246 aws ec2 describe-instances | jq 247 aws ec2 describe-instances | jq[0] 248* aws ec2 describe-instances | jq 249 history | grep jq |
$aws ec2 describe-instances | jq .[1]
![]() jq: error (at <stdin>:1666): Cannot index object with number |
$aws ec2 describe-instances | jq
{ "Reservations": [ { "ReservationId": "r-0ebb430cd3f1917cf", "OwnerId": "886677986286", "Groups": [], "Instances": [ { "InstanceId": "i-080515adaa7956592", "RootDeviceName": "/dev/xvda", ... "DeleteOnTermination": true, "AttachTime": "2018-12-19T09:42:51.000Z" } } ] } ] } ] } |
$aws ec2 describe-instances | jq .Reservations
[ { "Groups": [], "Instances": [ { "Monitoring": { "State": "disabled" }, "State": { "Code": 16, ... "StateTransitionReason": "", "Architecture": "x86_64", "InstanceType": "t2.micro", "AmiLaunchIndex": 0 } ], "ReservationId": "r-0c0e59eec99ee07d6", "OwnerId": "886677986286" } ] |
$aws ec2 describe-instances | jq .Reservations | less -R
|
|