Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Terraform
Everything is Code
HELLO!
I am smalltown (Tom Tsai)
I am here because I want to share
something with you
You can find me at
smalltown@awsug.t...
3
Demo Code:
https://goo.gl/ubspPP
Why Coding?!
4
Handmade?
5
6
7
8
就 警
是 察
這 叔
個 叔
人 !
Benefits!!
▪ Reproducible
▪ Save Your Valuable Time
▪ Avoid Human Error
▪ Not Out of Date Like Document
9
11
Infrastructure = Code
Why Terraform
Best My Practice
Integrate CI/CD Case Study
12
Infrastructure = Code
Why Terraform
Best My Practice
Integrate CI/CD Case Study
Infrastructure As Code in 200X...
13
YA! I can write code to
manage server
package 'tar' do
version '1.16.1'
action :insta...
Infrastructure As Code in 200X...
▪ Provision Procedure CM
Tool
14
Document:
- Easy Out of Date
- Hard to Maintain
Infrastructure As Code in 201X...
15
YA! I can write code to
manage cloud resource
resource "aws_s3_bucket" "b" {
bucket =...
Infrastructure As Code in 201X...
▪ Cloud Resource
Infrastructure As Code Tool
16
Document:
- Easy Out of Date
- Hard to M...
Infrastructure As Code in 202X...
17
YA! I can write code to
manage cloud provider
resource "cloud_provider" "poc" {
type ...
Infrastructure As Code in 202X...
▪ Cloud Provider Cloud
Provider As Code tool
18
Document:
- Easy Out of Date
- Hard to M...
19
Infrastructure = Code
Why Terraform
Best My Practice
Integrate CI/CD Case Study
My Tool Choose Guideline
20
用 HashiCorp
出的就對了!!
My Tool Choose Guideline
21
自從用了 HashiCorp 之後長高了
,變壯了,考試都得一百分呢!
呿...
不就只是長大了而已,我也會啊!
My Tool Choose Guideline
▪
▪
▪
▪
▫
▫
▫
22
Why Terrafrom?
23
Meet Requirement Yes Yes Yes Yes
Documentation Yes Yes Yes Yes
CLI Tool Yes Yes Yes Yes
Configuration Wi...
24
Infrastructure = Code
Why Terraform
Best My Practice
Integrate CI/CD Case Study
Whole Picture
25
Makefile
Initial Backend
Get Modules
Plan Resources
Apply Resources
Test Resources
1. Init backend if
not...
Folder Structure
26
COnfigurations
27
terrform.tfvars
variables.tf
s3.tf
bucket = "devopsdays_taipei"
acl = "public-read"
variable "bucket" {}...
Backends
▪
▫
▫
▫
▪ “Here”
28
Modules
▪ Don’t Reinventing The Wheel !
▪ Modules Are Used to Create Reusable
Components In Terraform
▪ Sources: Refer To ...
Testing
▪
▪ !
▪
30
Makefile
▪
▪
▪
▫
▫
31
Of Course, Version COntrol
▪
▪
32
33
Infrastructure = Code
Why Terraform
Best My Practice
Integrate CI/CD Case Study
Last Mile
▪
▪
▪
▪
▪
34
Yes, Integrate CI/CD Framework
35
Buildbot Drone Concourse
Ref
36
Infrastructure = Code
Why Terraform
Best My Practice
Integrate CI/CD Case Study
How To Rolling Update AWS ASG
37 Ref
How TO MainTain K8S Cluster
38 Ref
Exception: serverLess
39
Ref
請洽 AWS TW UG Cliff Lu (呂昭寬)
THANKS!
Any questions?
40
DevOpsDays Taipei 2017 - Terraform: Everything Is Code
Upcoming SlideShare
Loading in …5
×

16

Share

Download to read offline

DevOpsDays Taipei 2017 - Terraform: Everything Is Code

Download to read offline

How to transfer you public cloud infrastructure into code, and then add testing, integrate with Jenkins to build up release pipeline

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

DevOpsDays Taipei 2017 - Terraform: Everything Is Code

  1. 1. Terraform Everything is Code
  2. 2. HELLO! I am smalltown (Tom Tsai) I am here because I want to share something with you You can find me at smalltown@awsug.tw 2
  3. 3. 3 Demo Code: https://goo.gl/ubspPP
  4. 4. Why Coding?! 4
  5. 5. Handmade? 5
  6. 6. 6
  7. 7. 7
  8. 8. 8 就 警 是 察 這 叔 個 叔 人 !
  9. 9. Benefits!! ▪ Reproducible ▪ Save Your Valuable Time ▪ Avoid Human Error ▪ Not Out of Date Like Document 9
  10. 10. 11 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  11. 11. 12 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  12. 12. Infrastructure As Code in 200X... 13 YA! I can write code to manage server package 'tar' do version '1.16.1' action :install end
  13. 13. Infrastructure As Code in 200X... ▪ Provision Procedure CM Tool 14 Document: - Easy Out of Date - Hard to Maintain
  14. 14. Infrastructure As Code in 201X... 15 YA! I can write code to manage cloud resource resource "aws_s3_bucket" "b" { bucket = "my_tf_test_bucket" acl = "private" tags { Name = "My bucket" } }
  15. 15. Infrastructure As Code in 201X... ▪ Cloud Resource Infrastructure As Code Tool 16 Document: - Easy Out of Date - Hard to Maintain Google Cloud Deployment Manager Azure Resource Manager AWS CloudFormation
  16. 16. Infrastructure As Code in 202X... 17 YA! I can write code to manage cloud provider resource "cloud_provider" "poc" { type = "AWS" region = "American" feature = ["LB", "K8S"] }
  17. 17. Infrastructure As Code in 202X... ▪ Cloud Provider Cloud Provider As Code tool 18 Document: - Easy Out of Date - Hard to Maintain
  18. 18. 19 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  19. 19. My Tool Choose Guideline 20 用 HashiCorp 出的就對了!!
  20. 20. My Tool Choose Guideline 21 自從用了 HashiCorp 之後長高了 ,變壯了,考試都得一百分呢! 呿... 不就只是長大了而已,我也會啊!
  21. 21. My Tool Choose Guideline ▪ ▪ ▪ ▪ ▫ ▫ ▫ 22
  22. 22. Why Terrafrom? 23 Meet Requirement Yes Yes Yes Yes Documentation Yes Yes Yes Yes CLI Tool Yes Yes Yes Yes Configuration Win Yes Yes Yes Modularization Win Yes Yes Yes Native No Yes Yes Yes Cross Platform Yes No No No Feeling Good Bad - -
  23. 23. 24 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  24. 24. Whole Picture 25 Makefile Initial Backend Get Modules Plan Resources Apply Resources Test Resources 1. Init backend if not exist 2. Get modules from source 3. Plan desired state with previous one 4. Apply resource, save state to backend 5. Test resources
  25. 25. Folder Structure 26
  26. 26. COnfigurations 27 terrform.tfvars variables.tf s3.tf bucket = "devopsdays_taipei" acl = "public-read" variable "bucket" {} variable "acl" {} resource "aws_s3_bucket" "app_s3" { bucket = "${var.bucket}" acl = "${var.acl}" } Generated Dynamic
  27. 27. Backends ▪ ▫ ▫ ▫ ▪ “Here” 28
  28. 28. Modules ▪ Don’t Reinventing The Wheel ! ▪ Modules Are Used to Create Reusable Components In Terraform ▪ Sources: Refer To “Here” 29
  29. 29. Testing ▪ ▪ ! ▪ 30
  30. 30. Makefile ▪ ▪ ▪ ▫ ▫ 31
  31. 31. Of Course, Version COntrol ▪ ▪ 32
  32. 32. 33 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  33. 33. Last Mile ▪ ▪ ▪ ▪ ▪ 34
  34. 34. Yes, Integrate CI/CD Framework 35 Buildbot Drone Concourse Ref
  35. 35. 36 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  36. 36. How To Rolling Update AWS ASG 37 Ref
  37. 37. How TO MainTain K8S Cluster 38 Ref
  38. 38. Exception: serverLess 39 Ref 請洽 AWS TW UG Cliff Lu (呂昭寬)
  39. 39. THANKS! Any questions? 40
  • PhilippeKhao

    Dec. 16, 2018
  • ChungYiChen

    Aug. 15, 2018
  • DerekPan2

    Aug. 14, 2018
  • jtrmnwu

    Jun. 20, 2018
  • honomoa

    May. 17, 2018
  • liweiyang5

    Nov. 21, 2017
  • jazzwang

    Oct. 2, 2017
  • RaymondWu18

    Sep. 27, 2017
  • alxcho

    Sep. 7, 2017
  • williamyeh

    Sep. 7, 2017
  • gostlike

    Sep. 6, 2017
  • AlanYAChen

    Sep. 6, 2017
  • baibaitung

    Sep. 5, 2017
  • s80275

    Sep. 5, 2017
  • elleryq

    Sep. 5, 2017
  • tequilatsai

    Sep. 5, 2017

How to transfer you public cloud infrastructure into code, and then add testing, integrate with Jenkins to build up release pipeline

Views

Total views

1,594

On Slideshare

0

From embeds

0

Number of embeds

15

Actions

Downloads

34

Shares

0

Comments

0

Likes

16

×