rekcah78 / terraform-module-autostop-ec2

A Terraform module to manage stopping or starting EC2 Instances.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

autostop-ec2 Terraform module

A Terraform module to manage stopping or starting EC2 Instances.

This module creates Lambda functions, cloudwatch events, permissions and IAM role to stopping or starting EC2 Instance at a scheduled time selected by filters.

Module Input Variables

Name Description Type Default Required
enabled_start string "true" no
enabled_stop string "true" no
filters_start string "[{'Name': 'tag:autoOff','Values':['True']},{'Name':'instance-state-name','Values':['stopped']}]" no
filters_stop string "[{'Name': 'tag:autoOff','Values':['True']},{'Name':'instance-state-name','Values':['running']}]" no
memory_size string "128" no
name string n/a yes
schedule_start string "cron(0 7 ? * MON-FRI *)" no
schedule_stop string "cron(0 19 ? * MON-FRI *)" no
tags Additional tags (e.g. map(Env,dev) map <map> no
timeout string "3" no

Usage

module "autostop-preprod" {
  source = "./autostop-ec2/"
  name   = "eco-preprod"
}

Authors

Originally created and maintained by:

About

A Terraform module to manage stopping or starting EC2 Instances.


Languages

Language:HCL 71.3%Language:Python 28.7%