Cloud bot is a solution which allows us to start/stop EC2 instances and GCE instances via chatbot. Cloud bot contains 3 main parts:
- Cloud bot lambda: This is the fulfillment webhook which will be requested whenever we interact with the chatbot. The lambda will execute the action based on our command.
- Cloud bot admin: This is a Spring application which is used to manage the permissions of individuals who are using the chatbot. Those permissions will be validated by cloud bot lambda before it makes the execution.
- Dialogflow agent: This is an agent in Dialog which allows us to communicate with the chatbot (Slack, Skype...) using natural language. Based on that, it will then make the fulfillment request to the fullfillment webhook which was the API gateway link of the cloud bot lambda
- Deploy cloud-bot-lambda
- Deploy cloud-bot-admin
- Deploy cloud-bot-agent
> Ec2 overview
Ec2 Overview
Ec2Instance(id=i-050fd2b4cd3f386b2, name=test123, type=t2.micro, state=stopped)
Ec2Instance(id=i-023bdcd9a310ae47b, name=test123, type=t2.micro, state=stopped)
> Start ec2 with name test123
Starting EC2: i-050fd2b4cd3f386b2, i-023bdcd9a310ae47b
> Start ec2 with name test123
Stopping EC2: i-050fd2b4cd3f386b2, i-023bdcd9a310ae47b
> Gce overview
Compute Engine Overview
GceInstance(id=7004539054369853569, name=test-cos, machineType=n1-standard-1, status=TERMINATED)
GceInstance(id=358782599305738022, name=test-from-gcloud, machineType=n1-standard-1, status=TERMINATED)
> gce start test-from-gcloud
Starting GCE: test-from-gcloud
> Gce stop test-from-gcloud
Stopping GCE: test-from-gcloud