In instance-ids file you should write ec2 instance ids. Write ids line by line , each should be on a new line with out any comas and white-spaces. Example content of instance-ids.txt:
i-0232aae72b3e6d5a5 i-01272b45ee3232334 i-0dab2b4234ffdsfd2 i-0534543ee3e6fda36
In tags.json write your tags which should be added of updated in JSON format. It should be like tag_key : tag_value.
Example content of tags.json file:
{ "Env" : "PROD", "Owner" : "Zhantoroev" }
For Github Actions there is a main.yml file. In line 4, for cron job you can specify a time to schedule run this python code.
Lines 18-21. Add your credentials like AWS ACCESS KEY, SECRET ACCESS KEY and REGION NAME to Github Secrets.
clone repo and open it. In terminal type:python tagging_ec2.pyIf everything works fine, it will print "done"
* Copy repo * At first add your credentials to secrets on github * Change main.yml on line 19-21 if you need it * If you wish, you can change line 4 cronjob time * Push your code and it will run according to cronjob