Skip to content

BabashovI/InfoMinfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InfoMinfo. Idea of this small project come from daily get electricity price from "https://www.ote-cr.cz/". To realise this idea i used AWS, TF, Ansible, Python.

Plan of action:

  1. Write python program for scraping daily prices for electricity. Used libraries exported to requirements.txt.
  2. Telegram bot for sending results of scraped info to InfoMinfo channel.
  3. TF: create AWS(ec2_ins, sg, CloudWatch, IAM_role+policy, Lamda_python_func)
  4. Ansible: configure ec2_ins after deploying

How it works. By default CloudWatch runs 2 scheduler at 08:00 UTC (start) and 09:00 UTC (stop). Invokes lambda-function which depending on "Event pattern" starts or stops instances with filtered tags. Onces instance starts cronjob executes python script which sends info to telegram channel.

How to use. First clone the repo. There are "aws_tf/" & "ansible/" folders.

  • "aws_tf/" for deploying all required resources on AWS:

    • terrafomr init
    • terraform plan
    • terraform apply
  • "ansible/" for configuring after deployment:

    • ansible-playbook host-conf.yml -i hosts --private-key $(PRIVATE_KEY)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published