AWS Auto AMI(Instance) backup across all region

AWS Auto AMI(Instance) backup across all region

Simple Easy way AWS auto AMI backup(snapshot + image backup of ec2) across all region or cross region using lambda (node js)

Note : It will delete previous backups everyday before taking new snapshot & new image ami backup.

Link For Code

https://github.com/harsh4870/AWS-auto-ami-backup-across-all-region

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need

AWS Lambda 

AWS Sdk

Installing

A step by step series of examples that tell you how to get a development env running

  • Make AWS Policy Using File
iam-policy.json
  • Make AWS Role Using File
role-trust-policy.json
  • Assign or attach policy to Role

Create Two New Lambda Function And Assign Role That you have made

  • Use Code From File for Lambda Functions
1. Create_AMI.js

2. Delete_AMI.js

Running the tests

Run Lambda Function And Check For Snap Shot and AMI

Full Automation Using Cloud Watch

Use Cloud Watch Event as Trigger To Make Full Automation of Backup System

From Lambda Trigger Choose Cloud Watch Event 

Cron job cloud watch

Cloud Watch Cron Job Expression

Cron Expression :-
cron(fields)

Example:
The first example creates a rule that is triggered every day at 12:00pm UTC.
cron(0 12 * * ? *)

The next example creates a rule that is triggered every day, at 5 and 35 minutes past 2:00pm UTC.

cron(5,35 14 * * ? *)


Rate Expression :-
rate(value unit)

Example :
The first example creates a rule that is triggered every 5 minutes.
rate(5 minutes)

The next example creates a rule that is triggered every 1 hour.
rate(1 hour)

Code available at : GitHub

要查看或添加评论,请登录

Harsh Manvar的更多文章

  • API Gateway vs Service Mesh

    API Gateway vs Service Mesh

    Difference between an API gateway & Service Mesh and therefore the role of every in microservices and other…

    1 条评论
  • Sonarqube setup on Kubernetes

    Sonarqube setup on Kubernetes

    Static code analysis SonarQube is an open source platform to perform automatic reviews with static analysis of code to…

  • Cloud custodian on docker container

    Cloud custodian on docker container

    Run cloud custodian policies & c7n mailer on docker container. Why? To provide a standalone containerized runtime for…

  • Slack Post On Kubernetes POD Ready State

    Slack Post On Kubernetes POD Ready State

    Post slack notification when POD status change to READY in any namespace. In market, there are many plugins available…

    4 条评论

社区洞察

其他会员也浏览了