Search code examples
amazon-web-servicesamazon-ec2amazon-vpcaws-security-groupelastic-ip

How to Find Previously Created EC2 Instance, Elastic IP and Security Group Inbound Rules?


I created an EC2 instance almost a year ago. A few months ago, I could no longer find the EC2 instance in the EC2 management page but I could still SSH into my instance and see my website with the Elastic IP it was on.

Now, I had to change my IP and went to update security group inbound rule for SSH. However, I could not find the previous inbound rules I set: 80, 443, and 22.

I can't even find the Elastic IP but I still can access my website. I see that my instance is now considered a VPC.

How can I access my EC2 instance, Elastic IP, and security group inbound rules?


Solution

  • Make sure you're in the correct region, you can only see resources in the region that you currently have selected.

    To get this run curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone.

    Ignore the letter at the end to get the region, rather than AZ. For example if it returns eu-west-1b then eu-west-1 would be the region.