Change EC2 External IP Without Restarting? - amazon-ec2

Hey is it possible to change the external IP address of my Amazon EC2 instance without restarting the thing?
Any help would be appreciated, the reason why I want to do this is because restarting will charge me for the full hour.

Yes, you can associate/disassociate an Elastic IP without restarting the EC2 instance. It can be done from the "Elatic IPs" screen of the AWS Management Console, EC2 section.

Related

Adding a CNAME to an AWS EC2 Public Domain Name

I have a test application running at
http://ec2-34-215-196-193.us-west-2.compute.amazonaws.com/
(This is a Test application, it wont be live for long. When I try to add a CNAME to this, like the screenshot below
. is added by the DNS system.
However, my app seems to be accessible only via us-west-2.compute.amazonaws.com or us-west-2.compute.amazonaws.com.
I can make it to resolve it either one of them.
But adding anything, does not seem to resolve with a CNAME. It gives 503 Service Unavailable.
I am using AWS EC2 to host the app with a HAProxy Load Balancer.
Using Google Domains for DNS Name.
Any suggestions for troubleshooting this problem?
All dns entries have a dot in the end like subdomain.domain.com.
It's not suggested to create CNAMEs to your ec2 instance because that IP may vary in time and it's not reassignable, that's what elastic ip's are made for, just create an elastic IP, assign it to your ec2 instance and assign it as an A record on your DNS provider.
Amazon AWS documentation
First create elastic IP and assign to your instance. Then create A record and point IP. Your site should work normal.

How to access elasticsearch in EC2?

I am new with AWS, and recently spun up an EC2 instance, and installed elasticsearch on it. I can now access elasticesearch via http://localhost:9200 after ssh into the box, but I am a little stuck on how to access this from external.
What's the best practice if I would like to write some app to access this EC2 instance? And how can I configure it so it can be access externally?
Any help would be appreciated.
Thanks.

AWS instance private IP changing after stop/restart (did not happen before)

Yes, I read an article by Eric Hammond here where he mentions that the private IP would also change when restarting. A few months ago, when I first got an AWS cluster up for hadoop, I used the internal IP to configure /etc/hosts and the internal IP wouldn't change (even when the instance is stopped, i can see the internal IP).
To replicate this cluster as part of our corporate account, I created a few AMIs and used those to launch the instances. Now, the IPs are changing each time the machine is restarted.
On checking the machines that did not have the IP change, there doesn't seem to be anything special about them. They are the same simple EBS backed instances with volumes. Hmm, so what's the difference between them?
Check whether your EC2 instance is inside a VPC or not.
Instances inside VPC will retain their private IP addresses when stopped and restarted. But instances outside VPC (ie. EC2-Classic) will change their private IP address when stopped and restarted.
Unfortunately, it's not possible to move an EC2 instance from EC2-Classic to EC2-VPC. However, in many cases, you can create an AMI image of the instance and launch a new instance from the AMI inside the VPC.

AWS EC2 Instance OS repair

I have Apache server running on Centos5.4 Ec2 instance. Unfortunately while removing Bash from Centos, it also removed basic shared libraries.
Now afterward I can't SSH to that EC2 instance but Apache server is still running (I can access my site through URL).
Any idea how can I get the SSH access back? or can repair Centos Ec2 instance?
Thanks!
You can always contact the AWS support directly. They are very accommodating. send a message to them and they will recover your access, if it is doable from their end.
You may call, or you may send a message from your AWS account.

Amazon AWS Ec2 + Elastic IP

I'm trying to set up an EC2 instance with a public domain name that I bought from 123-reg.
Aside from associating the elastic IP with the instance that's running, and changing the DNS at 123-reg, is there anything else I need to do to access the site?
Any ideas or tutorial links would be greatly appreciated.
You just need to set an A record on your DNS entry for the domain to point at the Elastic IP, that's it.

Resources