Code Monkey home page Code Monkey logo

cron-ec2's Introduction

Handling Cron-EC2

Architecture

archi

Desc

  • 09:00, 18:00 까지만 동작하는 인스턴스 구조입니다.
  • aws_scheduler_schedule 의 cron 기능을 사용합니다.
  • EC2는 tag:Properties 가 "onoff-instance" 입니다.
  • Lambda에서는 tag:Properties 가 "onoff-instance" 인 Instance를 검색합니다 (추후 환경변수로 수정가능...)
  • Terraform + Lambda (Golang) 사용하여 구현합니다.

Folders

    infra
        |-- ec2.tf
        |-- event-bridge.tf
        |-- lambda.tf
    function

Execution

  1. .tfvars 작성 (./infra/tfvars.examples 참고)
  2. provider.tf를 수정하여야 합니다.
  3. Terraform + Provisioning
    alias tf='terraform'

    ## Provisioning
    cd infra
    tf init
    tf plan -var-file=[tfvars file] OR Make plan
    tf apply -var-file=[tfvars file] OR Make apply

    ## Lambda Function Update
    cd function
    make run

혹시

  • Lambda에서 Timeout이 난다면, Timeout 시간을 늘려줘야 합니다 (Default 3초)
  • Slack 기능은 귀찮아서 그냥 안함

cron-ec2's People

Contributors

zkfmapf123 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.