Terraform Infrastructure as Code: CI/CD automation

This article is part of 從零開始的 Infrastructu as Code: Terraform Get-started examples / SOP on Github Introducation to Terraform Iac: Speaker transcript Presentation Check my website chechia.net for other blog. Follow my page to get notification. Like my page if you really like it :) 上面講解 Terraform 的基本操作流程,提供範本原始碼,以及一步一步導入的詳細步驟。各位應該都可以依照上面幾篇的說明,開始快樂的使用 Terraform 了。 而當使用 Terraform 的規模越來越大,管理的資料越來越多時,開始會出現一些問題,例如重複的 terraform code 越來越多,協同工作 review 不太容易,state 的內容管理與鎖管理,等等。這些問題可以透過一些工作流程的改進,或是導入新的小工具,來改善工作效率。 接下來筆者推薦幾個心得與工具,希望能提升使用 Terraform 的效率與產值 以下幾篇文章,適合已經使用過 terraform 一點時間,有經驗的團隊,並打算更大規模導入 terraform,正在尋求改善的方向。 心得 CI/CD 全自動化 State backend 選擇 最佳實踐 https://www.terraform.io/docs/cloud/guides/recommended-practices/index.html 工具 Terraform Atlantis Terragrunt CI/CD 全自動化 當公司成功導入 terraform ,並且整合 Git-flow 的工作流程後,應該可以很明顯的感受到,整體的 infrastructure 產出穩定度有大幅提升,畢竟軟體工程中 code review 是穩定度的核心關鍵之一,而導入 terraform 與 infrastructure as code 讓 infrastructure 也能在合理的工作流程中被層層 review。 ...

October 3, 2020 · 3 min · 447 words · chechiachang

Terraform Infrastructure as Code: Example repository

This article is part of 從零開始的 Infrastructu as Code: Terraform Get-started examples / SOP on Github Introducation to Terraform Iac: Speaker transcript Presentation Check my website chechia.net for other blog. Follow my page to get notification. Like my page if you really like it :) 上面講了很多 terraform 的操作範例,應該看到這裡,對於 terraform 基本上是什麼東西,應該有些概念了。然而這樣還不能算是學會 terraform,這種工具的東西一定要有實際操作過的經驗才算是學會。 可以直接參考 Terraform 官方的 Get-started 文件來操作學習,我這邊也提供一個 Git repository 讓大家上手,當作初次操作的框架。 提供做為範例的原始碼 這個 Github Repository 是我給社群演講所使用的範例,第一次使用的可以參考 https://github.com/chechiachang/terraform-playground tree ├── README.md ├── SOP.md ├── aws/ ├── azure/ └── gcp/ TL;DR 選擇使用的雲平台,這邊提供三家範例,例如我這邊使用 gcp,當然你就要準備 GCP 的帳號,並且下載有執行權限的用戶 credential json key 等等。 ...

October 2, 2020 · 3 min · 531 words · chechiachang

Terraform Infrastructure as Code Transcript

This article is part of 從零開始的 Infrastructu as Code: Terraform Get-started examples / SOP on Github Introducation to Terraform Iac: Speaker transcript Presentation Check my website chechia.net for other blog. Follow my page to get notification. Like my page if you really like it :) 各位好 About this presentation 開始之前,先分享一些資源 投影片 講稿 程式碼 SOP 範本 Facebook 粉專 都放在這裡,因為有附逐字稿,所以如果很忙的朋友,掃了 QR code 就可以回家自己看了,不用客氣。 然後有興趣在追這系列文章的,可以幫我 facebook 粉專按個讚跟追蹤,每周新文章出來,會推播通知。 文章在 chechia.net 上,新文章通知靠 facebook 粉專這樣。也可以只追蹤不按讚。我自己看別人技術 blog 也很常這樣(XD 需求 好,今天來講得這個 Terraform ...

June 15, 2020 · 5 min · 915 words · chechiachang

從零開始的 Infrastructure as Code: Terraform - 01

This article is part of 從零開始的 Infrastructu as Code: Terraform Get-started examples / SOP on Github Introducation to Terraform Iac: Speaker transcript Presentation Check my website chechia.net for other blog. Follow my page to get notification. Like my page if you really like it :) Outlline our story: issues, steps, & results basics IaC, terraform benefits risks and 坑 to be or not to be experience oriented Our stories 100+ devs, many teams 25+ projects 50+ GKEs 80+ SQLs IAMs, redis, VPCs, load-balancers, … Issues Ops manually create resources through GUI by SOP. We have many isolated, separeated resources, VPCs. It’s our culture, and we (devops) want to change. Some projects have short life-cycle. Rapid resources created & destroy. Our user story As a devops, I would like to introduce terraform (IaC) so that I can ...

June 14, 2020 · 4 min · 747 words · chechiachang