Simple solution to run commands through event driven cloud solutions. Currently support GCP PubSub Only
For situaction where there is no ssh connection to machine, but some maintaince could be useful. As long as machine has access to pubsub scope, it can be maintained this way. It's also an alternative to startup script, since It can be runned as any user and does not require restart per change.
python3 -m pip install --upgrade google-cloud-pubsub pyfiglet
python3 client.py -n servername -t projects/sample-project/topics/yourtopic -s projects/sample-project/subscriptions/yourtopicservernameresult
You can pass json file in format:
{ "whitelist" : [ "sample-cmd1", "cmd2" ] }
as config param -c. Server will only run cmd same as whitelist. This is optional parameter. Server will allow every other cmd otherwise.
Server will create subscription and list you name (yourtopic-servername-result).
python3 server.py -n servername -t projects/sample-project/topics/yourtopic -c whitelist.json