How to self terminate an EC2 instance

0 votes
Is there a way to self-terminate an EC2 instance in AWS after running for a couple of hours?
Jul 26, 2018 in Cloud Computing by code_ninja
• 6,300 points
4,799 views

1 answer to this question.

0 votes

To self-terminate an EC2 instance, follow the given steps:

  1. Start the instance with "--instance-initiated-shutdown-behavior terminate" or through the AWS console 
  2. Login as root user and run "shutdown -h now". On Ubuntu, you could set this up to happen in 55 minutes using:

    echo "sudo halt" | at now + 55 minutes
answered Jul 26, 2018 by Gopalan
• 1,360 points

Related Questions In Cloud Computing

0 votes
1 answer

AWS: How can you connect to an EC2 Linux instance using Putty?

1. Select your instance in the EC2 ...READ MORE

answered Aug 6, 2018 in Cloud Computing by Meci Matt
• 9,460 points
1,133 views
0 votes
2 answers

How can I route request to EC2 instance behind AWS ELB?

You can have a look at the ...READ MORE

answered Aug 17, 2018 in Cloud Computing by Priyaj
• 58,020 points
1,191 views
0 votes
1 answer

Does it make sense to have an Amazon Elastic Load Balancer with just one EC2 instance?

ELB automatically distributes incoming application traffic across ...READ MORE

answered Jul 12, 2018 in Cloud Computing by ArchanaNagur
• 2,360 points
1,128 views
+1 vote
1 answer

Is it possible to get an ec2 pricing programmatically?

Yes absolutely. You may get AWS pricing programmatically ...READ MORE

answered Apr 10, 2018 in Cloud Computing by code_ninja
• 6,300 points
2,008 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to increase the EBS volume size of an instance that is on running state ?

Unluckily, it is not possible to increase ...READ MORE

answered Jul 17, 2018 in Cloud Computing by Gopalan
• 1,360 points
884 views
0 votes
1 answer

How to duplicate AWS EC2 instance without any downtime?

Technically it is not possible, because the ...READ MORE

answered Jul 24, 2018 in Cloud Computing by Gopalan
• 1,360 points
1,552 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP