所在机器需要配置
aws_access_key_id
和aws_secret_access_key
go get -u github.com/aws/aws-sdk-go
$ 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
可以根据需求进行stop和start