Coder Social home page Coder Social logo

itsnotsagar / ec2autoshutdown Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 24 KB

Automate EC2 instance shutdowns in your AWS region with our 'AutoShutdown' CloudFormation template. Save costs and enhance efficiency while easily excluding exceptions using the 'exception' tag. Deploy effortlessly, optimize AWS infrastructure, and streamline resource management

License: GNU General Public License v3.0

automation aws aws-cloudformation aws-ec2 aws-eventbridge aws-lambda

ec2autoshutdown's Introduction

Introduction

This template provides a streamlined solution for automatically shutting down EC2 instances in your AWS region, promoting cost savings and resource efficiency. The template includes the essential resources and configurations for scheduled shutdowns. Notably, the flexibility of the "exception" tag allows you to exclude specific instances, tailoring the solution to your needs. Deploy effortlessly in your preferred AWS region to manage EC2 shutdowns with ease, optimizing infrastructure, reducing costs, and enhancing overall resource management.

Pre-requisites

  1. AWS Account
  2. EC2 Instances in Running/Stopped State

Steps

  1. Login in to the AWS Console and search for CloudFormation
  2. Click on Create stack ---> With new resources (standard)
  3. Choose Template is ready ---> Upload a template file ---> Choose file and click on Next
  4. Give the stack some name ---> ec2-instance-auto-shutdown
  5. Configure the settings as per your need (optional) and click on Submit
  6. Once the Stack is successfully created, click on Resources tab to view all the newly created resource (Lambda Function, IAM Role and Event Rule)
  7. Now the Event Rule will trigger the Lambda function based on the cron job (by default it is MON-FRI 5 PM UTC)
  8. You can also manually test the lambda function by creating a sample test event and running it.

Note

  1. The exclusion of auto shutdown of instances is based on the tag "exception" attached to the instance, irrespective of the case.

Screenshots

Screenshot 2024-01-28 at 9 14 09 PM Screenshot 2024-01-28 at 9 42 36 PM Screenshot 2024-01-28 at 9 43 21 PM Screenshot 2024-01-28 at 9 44 52 PM Screenshot 2024-01-28 at 9 45 15 PM

ec2autoshutdown's People

Contributors

itsnotsagar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.