Skip to content

XionZhao/instance-status-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

通过tag对aws ec2实例进行stop和start

所在机器需要配置aws_access_key_idaws_secret_access_key

依赖

go get -u github.com/aws/aws-sdk-go

Build

$ go build .

执行命令

$ ./instance-status-manager -h
Usage of ./instance-status-manager:
  -status string
    	Select start or stop
  -tagkey string
    	Choose to stop or start ec2 tag key
  -tagvalue string
    	Choose to stop or start ec2 tag value

启动实例

./instance-status-manager -tagkey=Name -tagvalue=SystemTest -status=start

停止实例

./instance-status-manager -tagkey=Name -tagvalue=SystemTest -status=stop

执行crontab

可以根据需求进行stop和start

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages