in Education by
I want to list the public IP addresses of my EC2 instances using Bash, separated by a delimiter (space or a new-line). I tried to pipe the output to jq with aws ec2 describe-instances | jq, but can't seem to isolate just the IP addresses. Can this be done by aws alone, specifying arguments to jq, or something else entirely? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Use this in the AWS CLI to get the required outputs: aws ec2 describe-instances \ --query "Reservations[*].Instances[*].[PublicIpAddress]" \ --output=text

Related questions

0 votes
    I am trying to use aws container service as per the documentation in http://docs.aws.amazon.com/AmazonECS/latest/ ... in a console? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I'm starting a bash script which will take a path in S3 (as specified to the ls command) and dump the ... finding which does it? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Amazon recently added the wonderful feature of tagging EC2 instances with key-value pairs to make the management of ... the tags? Select the correct answer from above options...
asked Feb 3, 2022 in Education by JackTerrance
0 votes
    I've got two different apps that I am hosting (well the second one is about to go up) on Amazon EC2. ... path ; ec2-describe-instances Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I want to automate the launch of a set of Linux EC2 instances. Basically, I want to write a script/program that ... in Amazon AWS/EC2? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    When you setup an Auto Scaling groups in AWS EC2 Min and Max bounds seem to make sense: The minimum number of ... is larger than Min? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to migrate my webapp from Amazon EC2 to ECS. I ECS I have to allocate memory and vCPU for the ... needed for the process? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    A guy I work with gave me the EC2 credentials to log onto his EC2 console. I was not the one who set it up ... these show up as blank. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I'm trying to deploy a Docker container image to AWS using ECS, but the EC2 instance is not being created. I have ... , to begin with!! Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    We currently use multiple web servers accessing one MySQL server and fileserver. Looking at moving to the cloud, ... another solution? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Any easy way to move and custom AMI image between regions? (North Virginia -> Singapore) I know you can mess up with ... way to do it? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    How can I delete instance in Amazon EC2. I have terminated the instance but still it was showing in ... instance gets terminated Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to change the time zone set in my Amazon EC2 instance running Ubuntu Linux to local time. My Question ... zone in Amazon EC2? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    We have a large ec2 instance running in Asia pacific region. We want to reserve that particular instance.In aws ... out on something Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have thought a lot recently about the different hosting types that are available out there. We can get ... added probably. Thanks Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
...