Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
TerraformではじめるInfrastructure as Code
Search
Yusuke Yasuo
October 18, 2018
820
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TerraformではじめるInfrastructure as Code
「JAWS-UG 初心者支部#14」のLT資料です。
Yusuke Yasuo
October 18, 2018
Transcript
19 slides
TERRAFORMͰ͡ΊΔ INFRASTRACTURE AS CODE yusukeyasuo@redish
ର • ඇΠϯϑϥΤϯδχΞͰɺΠϯϑϥͷߏஙɾӡ༻͠ͳ͖Ό͍ ͚ͳ͘ͳͬͨΤϯδχΞ • ·ͩInfrastructure as CodeΛ͍ͯ͠ͳ͍ΠϯϑϥΤϯδχΞ • தʙ্ڃऀ͚Ͱͳ͍Ͱ͢m(__)m
AGENDA • ࣗݾհ • Infrastructure as Codeͱ • Terraformͱ •
࣮ྫ • ·ͱΊ
ࣗݾհ • Yusuke Yasuo • ϦʔυΤϯδχΞ@redishגࣜձࣾ • NTT→ίϩϓϥ→ελʔτΞοϓΛࣾ • ελʔτΞοϓͰΤϯδχΞ1ʙ2ਓͷ࣌
ظ͕͋ΓɺAWSΛ৮ΔΑ͏ʹͳͬͨ
INFRASTRUCTURE AS CODEͱ • ίʔυʹΑΔΠϯϑϥߏཧ
ͳͥίʔυཧ͕ඞཁ͔ʁ • खಈͰཧ͢Δͱେม͔ͩΒ
͕ܦݧͨ͠खಈཧͷฐ • υΩϡϝϯτɺखॱॻ͕ͳ͍ͷͰͲ͏ͬͯߏங͔ͨ͠୲ ऀʹฉ͔ͳ͍ͱ͔Βͳ͍ • ୲ऀʹฉ͍ͯߏங࣌ͷهԱ͕ͳ͔ͯ͘Βͳ͍ • ো͕ൃੜͨ͠ࡍʹ෮چͰ͖ͳ͍ • పͰθϩ͔Βߏங͢Δ
• ୀ৬ޙো͕ൃੜ͢Δͱݺͼग़͞ΕΔ
ίʔυԽ͓͚ͯ͠ • Πϯϑϥͷઃఆ͕୭Ͱ͔ΔʢϒϥοΫϘοΫεԽ͠ ͳ͍ʣ • ো͕ൃੜͯ͠ίϚϯυҰͭͰ͙͢ʹ෮چ͕Մೳ • ࡞ۀϛεى͜Βͳ͍ • ΠϯϑϥΤϯδχΞ͕͍ͳͯ͘ཧͰ͖Δ
ओͳπʔϧ
TERRAFORMͱ • ΠϯϑϥετϥΫνϟఆٛπʔϧ • VagrantͳͲ։ൃ͍ͯ͠ΔHashiCorp͕ࣾ։ൃݩ • ΠϯϑϥͷߏΛએݴతʹఆٛͰ͖Δ ※खଓ͖తʹॻ͔ͳͯ͘ྑ͍
Πϯετʔϧ • ϏϧυࡁΈόΠφϦΛμϯϩʔυͯ͠ύεΛ௨͚ͩ͢
ࣄલ४උ • IAMϢʔβʔͷ࡞ • AWS CLIΛར༻͢ΔͨΊͷIAMϢʔβʔΛ࡞͠ɺΞΫηεΩʔΛऔಘ͢Δ • AWS CLIͷηοτΞοϓ •
$ aws configure ͰೝূใΛηοτ͢Δ ※ ~/.aws/credentials ʹೝূใ͕อଘ͞Ε͍ͯΕOK • terraformͷॳظԽ • $ terraform init
RDSΛ࡞͢Δྫ
ఆٛϑΝΠϧͷ࡞ provider "aws" { region = "ap-northeast-1" } resource "aws_db_instance"
"default" { allocated_storage = 10 storage_type = "gp2" engine = "mysql" engine_version = "5.7" instance_class = "db.t2.micro" name = "mydb" username = "foo" password = "foobarbaz" parameter_group_name = "default.mysql5.7" } rds.tf
༰ͷνΣοΫ • $ terraform plan
RDSͷ࡞ • $ terraform apply
࡞ͨ͠ΦϒδΣΫτͷ֬ೝ • $ terraform show
ҙ͢Δ͜ͱ • TerraformͰ࡞ͨ͠ΦϒδΣΫτΛखಈͰมߋ͠ͳ͍ • ෳਓͰ࡞ۀ͢Δ߹tfstateͷཧʹؾΛ͚ͭΑ͏
·ͱΊ • ϓϩμΫγϣϯ༻ͷΠϯϑϥඞͣίʔυԽ͠·͠ΐ͏ • ίʔυԽ͠ͳ͍ͷϦϦʔε͠ͳ͍ • redishͰҰॹʹInfrastructure as Code͠·͠ΐ͏w
More Decks by Yusuke Yasuo
See All by Yusuke Yasuo
Rails開発で技術的負債を増やさないためにやっていること
yusukeyasuo
0
860
コードを書く前に既に勝負は決まっている
yusukeyasuo
3
1.1k
Rails6新機能 複数DB対応について
yusukeyasuo
0
570
スクラム勉強会
yusukeyasuo
0
220
Rails×Serverless
yusukeyasuo
0
120
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.3k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
570
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
Claude Code のすすめ
schroneko
67
230k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
470
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
610
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
850
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k