Slide 1

Slide 1 text

TERRAFORM ࢎਊ റӝ HELLO TERRAFORM ಌನݢझ౱ ъӝక

Slide 2

Slide 2 text

ߓ҃ ▸ ݃੉௼۽ ࢲ࠺झ ҳઑܳ ਤ೧ ੋ೐ۄ ܻ࠙ ▸ AWSী ࢜۽ ҳ୷ೞӝ۽ Ѿ੿ .. যڌѱ ೞ૑?

Slide 3

Slide 3 text

৘੹੄ ঈކ ▸ AWSܳ ਢ௑ࣛ۽݅ ҙܻ೮؍ ҃೷

Slide 4

Slide 4 text

ࢎ۹ 1 “ನ౟ ׮ ৌযְחؘ ৵ ੽ࣘ੉ উغ૑..?” അ੤ ੋ೐ۄ
 ౵ঈೞӝ ൨ٞ

Slide 5

Slide 5 text

ࢎ۹ 2 “? ੉Ѥ ޖट ਊب۽ ݅ٚѢঠ?” ੉۱ ഛੋ ࠛо

Slide 6

Slide 6 text

ࢎ۹ 3 “పझ౟ਊ ੋझఢझ ૑ਕঠ૑~” ੉۞Ҋ
 ࢲ࠺झਊ RDB ࢏ઁ
 (੿݈ पച੐

Slide 7

Slide 7 text

௏٘۽ ҙܻೞ੗! ▸ੋ೐ۄܳ ௏٘۽ ઁযೞѱ غݶ..
 - ࢚కܳ ഛੋೞӝ ए਑
 - ߡ੹ ҙܻ
 - पࣻ хࣗ

Slide 8

Slide 8 text

௏٘۽ ҙܻೞ੗! ▸௏٘ܳ ҙܻೞח ੌ਷ ೦࢚ ੊ࣼ೤פ׮.

Slide 9

Slide 9 text

׮নೠ بҳٜ

Slide 10

Slide 10 text

“৵ TERRAFORMਸ ࢎਊ೮աਃ?”

Slide 11

Slide 11 text

TERRAFORM੄ ౠ૚ (1) ▸ࢲߡܳ ؀࢚ਵ۽ provision
 ࢲߡ ղࠗ ߸҃ী݅ ઁೠغ૑ ঋ਺ ▸௿ۄ਋٘ ജ҃ী ݒ਋ ੸೤
 ࢲߡ ࢤࢿ, ઁѢ ಞܻ

Slide 12

Slide 12 text

TERRAFORM੄ ౠ૚ (2) ▸ࢲߡ ߸҃ द, ࣻ੿(modify)ࠁ׮ח Ү୓(swap)

Slide 13

Slide 13 text

ࢲߡ AMI ࢲߡ AMI ৘) ࢜ ߡ੹੄ OPENSSLਸ ࢸ஖ ▸ࣻ੿ ߑध੄ ҃਋
 ӝઓ ೐۽Ӓ۔ਸ ࢜ ߡ੹ਵ۽ সؘ੉౟ (߸҃) OpenSSL 1.0.2 OpenSSL 1.1.0 ߸҃ ੹ ߸҃ റ

Slide 14

Slide 14 text

ࢲߡ AMI ࢲߡ AMI ৘) ࢜ ߡ੹੄ OPENSSLਸ ࢸ஖ ▸Ү୓ ߑध੄ ҃਋
 ࢜ ߡ੹੉ ࢸ஖ػ ࢲߡ ੉޷૑ܳ प೯ ߸҃ ੹ ߸҃ റ OpenSSL 1.0.2 OpenSSL 1.1.0

Slide 15

Slide 15 text

Ү୓ ߑध੄ ੢੼ ▸ݒߣ ജ҃ ࢜۽ ࢤࢿ ▸ ߸҃੉ ־੸غ૑ ঋ਺ ▸ ജ҃ ҳࢿ ࠛੌ஖ ޙઁীࢲ ੗ਬ܂׮.

Slide 16

Slide 16 text

ജ҃ ҳࢿ ࠛੌ஖ ޙઁ (CONFIGURATION DRIFT) ▸ ࣗ೐౟ਝযա ೞ٘ਝযо ߸҃ؼ ٸ݃׮,
 ӝ۾غ૑ ঋח ޷ࣁೠ ର੉о ߊࢤ ▸ ־੸غ׮ࠁݶ ޙઁо ߊࢤ

Slide 17

Slide 17 text

TERRAFORM੄ ౠ૚ (3) ▸ࢶ঱੸ ೐۽Ӓې߁ (Declarative programming)

Slide 18

Slide 18 text

৘) EC2 ੋझఢझ 10ѐ ࢤࢿ द - ec2: count: 10 image: ami-v1 instance_type: t2.micro resource "aws_instance" "example" { count = 10 ami = "ami-v1" instance_type = "t2.micro" }

Slide 19

Slide 19 text

৘) EC2 ੋझఢझ 10ѐ → 15ѐ - ec2: count: 10 image: ami-v1 instance_type: t2.micro - ec2: count: 5 image: ami-v1 instance_type: t2.micro resource "aws_instance" "example" { count = 15 ami = "ami-v1" instance_type = "t2.micro" }

Slide 20

Slide 20 text

੺ର੸ ೐۽Ӓې߁੄ ױ੼ ▸௏٘݅ ࠊࢲח ੋ೐ۄо যڃ ࢚కੋ૑
 ঌӝ ൨ٜ׮. - ec2: count: 5 image: ami-v1 instance_type: t2.micro ੉Ѫ݅ ࠊࢲח ࢲߡо 15ѐо ؼ૑
 ঌ ࣻ হ׮.

Slide 21

Slide 21 text

ࢶ঱੸ ೐۽Ӓې߁੄ ױ੼ ▸ ੘সਸ ࣁࠗ੸ਵ۽ ஶ౟܀ೡ ࣻ হ׮.
 ઺р җ੿ਸ ૑੿ೡ ࣻ হਵ޲۽..

Slide 22

Slide 22 text

▸ইې ղਊਸ Terraformਵ۽ ҳഅೞ۰ݶ? ৘) BLUE-GREEN DEPLOY ҳഅ 1. GREENਸ द੘ೠ ٍ
 GREENী ߓನ 2. ࢲ࠺झܳ BLUEীࢲ
 GREENਵ۽ ߸҃
 
 3. BLUEܳ ੿૑


Slide 23

Slide 23 text

TERRAFORM ಴അ੄ ೠ҅ ▸ఋ੉߁ ઁয
 “~ೡ ٸө૑ ӝ׮۷׮о..” ▸ઑѤ ࠙ӝ
 “~ ೠ׮ݶ..” ※ ੿ഛ൤ח ࠛоמೠѤ ইפ૑݅ ಞߨਸ ॄঠೞѢա ࢚׼൤ ઁೠ੸ੑפ׮.

Slide 24

Slide 24 text

Ѿҗ ੸ਊ ߧਤ ߸҃ ߑध ௏٘ ಴അ ࢲߡө૑ ؀࢚ Ү୓ (swap) ࢶ঱੸ So good Good Not bad

Slide 25

Slide 25 text

“TERRAFORM਷ যڌѱ ࢎਊೞաਃ?”

Slide 26

Slide 26 text

੘স੄ ൒ܴ 1ױ҅: WRITE ‣ ੋ೐ۄܳ ௏٘۽ ಴അ WRITE ௏٘ ੘ࢿ PLAN Ѩష APPLY ߈৔

Slide 27

Slide 27 text

੘স੄ ൒ܴ 2ױ҅: PLAN ‣ ௏٘ܳ ੸ਊ೮ਸ ٸ ߸҃ؼ ղਊਸ ޷ܻ ୹۱ ‣ पࣻܳ ޷োী ߑ૑ೡ ࣻ ੓׮. WRITE ௏٘ ੘ࢿ PLAN Ѩష APPLY ߈৔

Slide 28

Slide 28 text

੘স੄ ൒ܴ 3ױ҅: APPLY ‣ ௏٘ ղਊਸ पઁ ੋ೐ۄী ߈৔ೠ׮. WRITE ௏٘ ੘ࢿ PLAN Ѩష APPLY ߈৔

Slide 29

Slide 29 text

৘द - EC2 ੋझఢझ प೯ೞӝ

Slide 30

Slide 30 text

৮ࢿػ ҳઑ

Slide 31

Slide 31 text

৮ࢿػ ҳઑ 1. ࢲ࠺झ ௏٘о ߸҃غݶ
 Docker Hubীࢲ ੉޷૑ܳ
 ࠽٘೤פ׮.

Slide 32

Slide 32 text

৮ࢿػ ҳઑ 2. Ӓ റ ѐߊ੗ח ECSо
 ࢜۽਍ ੉޷૑ܳ ࢎਊೞب۾ TERRAFORM ௏٘ܳ ࣻ੿೤פ׮.

Slide 33

Slide 33 text

৮ࢿػ ҳઑ 3. TERRAFORM਷ ௏٘ܳ
 AWSী ߈৔೤פ׮.

Slide 34

Slide 34 text

৮ࢿػ ҳઑ 4. ECSо ӝઓ ੉޷૑ܳ ࢜ ੉޷૑۽ Ү୓೤פ׮.

Slide 35

Slide 35 text

“Ӓؘ۠ TERRAFORM..
 ॄࠁפ ੿݈ ҡଳ؍оਃ?”

Slide 36

Slide 36 text

पઁ ࢎਊ೧ࠄ ࣗх ▸৘࢚ೞ૑ ޅೠ ୶о ࠺ਊ (1) ▸ HCLਸ ੊൤ח ؘ ೙ਃೠ ೟ण ࠺ਊ Terraform ੗୓঱য

Slide 37

Slide 37 text

पઁ ࢎਊ೧ࠄ ࣗх ▸৘࢚ೞ૑ ޅೠ ୶о ࠺ਊ (2) ▸ Terraform stateܳ ਬ૑ೞח ҙܻ ࠺ਊ

Slide 38

Slide 38 text

पઁ ࢎਊ೧ࠄ ࣗх ▸৘࢚ೞ૑ ޅೠ ୶о ࠺ਊ (2) ▸ Terraform stateܳ ਬ૑ೞח ҙܻ ࠺ਊ ↳ ?

Slide 39

Slide 39 text

TERRAFORM STATE ▸Terraform प೯ द ੷੢غח ؘ੉ఠ ▸ੌઙ੄ DBэ਷ ৉ೡਸ ೠ׮.

Slide 40

Slide 40 text

TERRAFORM STATE ▸Terraform प೯ द ੷੢غח ؘ੉ఠ ▸ੌઙ੄ DBэ਷ ৉ೡਸ ೠ׮. ↳ Ӓېࢲ ҙܻب DB୊ۢ ೧ঠ ೣ

Slide 41

Slide 41 text

STATE ҙܻ ▸ ౱ਗ рী ҕਬ ▸ lockਸ ੜ ࢸ੿೧ঠ ೣ ▸ ؕ஖о ழ૑ݶ ࢿמ੉ աࡅ૗ ▸ ࠙࢑ ࢸ҅ܳ ೞח ಞ੉ જ׮.

Slide 42

Slide 42 text

STATE ҙܻ ▸ ౱ਗ рী ҕਬ ▸ lockਸ ੜ ࢸ੿೧ঠ ೣ ▸ ؕ஖о ழ૑ݶ ࢿמ੉ աࡅ૗ ▸ ࠙࢑ ࢸ҅ܳ ೞח ಞ੉ જ׮. ➠DBܳ ਍৔ೞח Ѫҗ
 ࠺तೞ׮.
 (=ҙܻ࠺ਊ)

Slide 43

Slide 43 text

Ѿۿ ▸Terraform਷ ୭Ҋ੄ ࢶఖ੉ ইק૑ب.. ▸ ই૒ ખ ࠛউೠ 0.x ؀ ߡ੹ ▸ ৘࢚ࠁ׮ ࠛಞ೮؍ Ѿҗ ࢶ঱ ߑध ▸ Ansibleҗ ߽೯ೞח Ѫب Ҋ۰೧ࠅ ೙ਃо ੓ਸ ٠..

Slide 44

Slide 44 text

Ѿۿ ▸ೞ૑݅ IAC بҳח ԙ ࢎਊ೤द׮! ▸ ࢸ۸ Ӓѱ Terraform੉ ইפ؊ۄب.. ▸ ੉۱ ҙܻ, ੗زച, ࡅܲ ࣘب, ੤ࢎਊ … Why not? ▸ ݽٚ ੉۱җ ߸҃੉ ౵ঈغҊ ੓ਸ ٸ੄ बܻ੸ উ੿х
 ঐࣁನо ࢎۄ઎णפ׮.

Slide 45

Slide 45 text

ଵҊ੗ܐ ▸ Gruntwork - Why we use Terraform and not Chef, Puppet, Ansible, SaltStack, or CloudFormation
 (https://blog.gruntwork.io/why-we-use-terraform-and-not-chef-puppet-ansible- saltstack-or-cloudformation-7989dad2865c) ▸ TERRAFORM, VPC, AND WHY YOU WANT A TFSTATE FILE PER ENV
 (https://charity.wtf/2016/03/30/terraform-vpc-and-why-you-want-a-tfstate-file-per- env/)

Slide 46

Slide 46 text

Q&A