Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[2024-06-19 Japanglish Tech Talk] Building My F...

zakisan
June 19, 2024
68

[2024-06-19 Japanglish Tech Talk] Building My First Infrastructure The way from EC2 to ECS

英語LT会資料
なんかモチベーションアップの発表にしてしまったorz..

zakisan

June 19, 2024
Tweet

Transcript

  1. whoami 
 @k_zakisan - SRE role (SWE) - love competitive

    programming - LeetCode: Top 2% rating - https://leetcode.com/u/k-zakisan - my new challenges in this year - speak at a tech events - LT - Conference - improve my English skill - ELSA speak(App) - join English events
  2. today’s topic 
 About this project - 2 years ago

    - containerize PHP/Laravel web application - running on EC2 server for four years - migrate the server to ECS - my first SRE-like work - through the project, I became SRE
  3. beginning of project(upgrade middleware???) 
 my boss me Hey Zakisan,

    Could you upgrade PHP/Laravel? EOL is coming… (Upgrading PHP means changing middleware) (If something happen wrong it would be hard to revert middleware on EC2) (I don't want to do it...) No, I …(Wait!)
  4. beginning of project(containerization proposal) 
 my boss me (If we

    can containerize, it will make changing the middleware easier.) Before upgrading PHP, Why don't we containerize to ECS? It would be hard to revert middleware on EC2. That’s true. Hmm, go ahead. (start the containerized project)
  5. content of project 
 my skill at 2 years ago

    - 2+ years experience of web development - no experience of building infrastructure(what is container?🤣) - no experience of building CD
  6. content of project 
 Steps 1. try running the app

    on ECS in a testing environment 2. change functions that relies on local files on EC2 3. release service on ECS
  7. content of project( 1 step)
 1. try running the app

    on ECS in a testing environment I understand ECS and AWS through this part - build infra to use Terraform - make dockerfile and push dockerimage to ECR check functions to use web brower
  8. content of project( 2 step)
 2. change functions that depended

    on local environment on EC2 fixing function list - login session - local file → ElastiCache(Redis) - export temporary file storage location - local file → S3 - GCP credential source - local file → ssm parameter - mail service - postfix → sendgrid api
  9. content of project( 3 step)
 3. release service on ECS

    - build ECS for stg/prod enviroment - make CD to use GitHub Actions - use OIDC to get credential - update ECR and restart ECS task - Changed the target group on ALB from EC2 to ECS when it released - migrate batch to use CloudWatch Events - used cron jobs on EC2 - override the CMD command in Dockerfile with 'php artisan' - chose CW Events because the similar way to cron jobs on EC2
  10. content of project( feedback)
 feedback this project Functional requestment is

    not difficult to understand the basics knowledge of infra(AWS) But no functional requestment is a little difficult, because I have no knowledge for them😥 - logs - how to manage and stock some types of logs (to use Fluent Bit) ? - alert conditions is Good? - security - response header include dangerous info? - when we use ECS Exec, how to manage logs of who executed which commands?
  11. after project 
 my boss me Congratulations Zakisan, you did

    it. Thanks boss, I could complete this project with our team. By the way, If possibility…
  12. after project 
 my boss me Congratulations Zakisan, you did

    it. Thanks boss, I could complete this project with our team. By the way, If possibility… Could you move me to an SRE role? !!!!????