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,220 points
177 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,260 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,420 points
58 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
• 56,920 points
122 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,270 points
431 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,220 points
256 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,260 points
95 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,260 points
104 views