-1

I'm not looking for the public IP address of CloudShell; I know that I can find it out by hitting some external website.

I would like to find out what my public IP address is when I'm connected to CloudShell.

I'm connected to the internet. I've logged into AWS console and opened a new CloudShell session in a browser tab. On a different browser tab, of course, I could visit the external site and see my public IP address, but how do I do it from inside CloudShell?

Purpose: I want to do this programmatically so that one step in our process could be automated (adding the user's IP to security group).

1 Answer 1

3

You can do the same as what you did on the browser - Request an external service to check your public IP.

But, in the CloudShell case, you have to use another HTTP client like curl instead of a browser. And here is some examples:

curl https://httpbin.org/ip
curl icanhazip.com
curl ifconfig.me
2
  • 1
    I think the question is how they can find their laptop's/desktop's public IP address, from inside CloudShell. I don't think it's possible unless CloudShell exposes some sort of connected session information.
    – Mark B
    Commented Apr 29 at 11:56
  • Sorry, that's not what I'm looking for. My first statement explicitly states it: "I'm not looking for the public IP address of CloudShell; I know that I can find it out by hitting some external website." Like Mark B says, I want to find my laptop's / desktop's IP address (from which I'm browsing the CloudShell).
    – m01010011
    Commented May 6 at 6:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.