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

AWS EC2 making experience

AWS EC2 making experience

2015.06.12 株式会社ヴァル研究所 社内研修用の資料になります

uchimanajet7

June 11, 2015
Tweet

More Decks by uchimanajet7

Other Decks in Technology

Transcript

  1. Agenda • AWS Ϛωδϝϯτίϯιʔϧ΁ͷϩάΠϯͯ͠ΈΔ • Amazon LinuxΛt2.microͰ্ཱͪ͛ͯΈΔ • ্ཱ͕ͪͬͨΠϯελϯεʹssh઀ଓͯ͠ΈΔ •

    AMIΛ࡞੒ͯ͠ΈΔ • ࡞ͬͨAMIΛར༻ͯ͠c4.xlargeΛ্ཱͪ͛ͯΈΔ • AWS CLI Λ࢖ͬͨૢ࡞Λͯ͠ΈΔ
  2. AWS Ϛωδϝϯτίϯιʔϧ ΁ͷϩάΠϯͯ͠ΈΔ • ࢦఆͷURL͔ΒϩάΠϯΛߦ͏ • Multi-Factor Authentication (MFA) Λ༗ޮԽ͍ͯ͠Δ

    ৔߹͸ೖྗ͕ඞཁ • ݴޠઃఆ͸ʮ೔ຊޠʯ͕σϑΥϧτͰબ୒͞Ε͍ͯΔ • ͜ͷݴޠઃఆͰϩάΠϯޙͷදࣔը໘ͷݴޠ͕ܾఆ͢ Δ
  3. Amazon LinuxΛt2.microͰཱ ্ͪ͛ͯΈΔ • ΩʔϖΞͷબ୒ը໘ • ͜͜Ͱ৽نʹΩʔϖΞΛ࡞੒͢Δ͔ɺطଘͷΩʔ ϖΞΛબ୒͢Δ͜ͱ͕ग़དྷΔ • Linux

    AMIͷ৔߹͸͜ͷΩʔϖΞʹΑΓެ։伴ೝ ূํࣜͰͷϩάΠϯ͕ߦ͑ΔΑ͏ʹͳΔ • ࠓճ͸طଘͷΩʔϖΞΛબ୒ͯ͠ΈΔ
  4. AWS CLI Λ࢖ͬͨૢ࡞Λͯ͠Έ Δ • aws configure ίϚϯυΛ࣮ߦͯ͠AWS CLIͷॳظઃఆΛߦ͏ •

    ࠓճ͸IAMϩʔϧΛઃఆͯ͋͠ΔͷͰAWS Access Key IDͱ AWS Secret Access Keyͷઃఆ͸ෆཁ • Default region name ͸౦ژϦʔδϣϯʮap-northeast-1ʯΛ ࢦఆ͢Δ • Default output format ͸ࢦఆ͠ͳͯ͘ʮJSONʯϑΥʔϚο τͱͳΔ
  5. AWS CLI Λ࢖ͬͨૢ࡞Λͯ͠Έ Δ • AWS CLIͷઃఆ͕ऴΘͬͨΒEC2ΠϯελϯεͷৄࡉΛදࣔ͢ ΔҎԼͷίϚϯυ࣮ߦͯ͠ΈΔ • aws

    ec2 describe-instances --filters “Name=tag- value,Values=xxxxxx" • ͜ͷίϚϯυͰࣗ෼͕࡞ͬͨEC2Πϯελϯεͷ಺༰͕JSON ܗࣜͰදࣔ͞ΕΔ • Ϛωʔδϝϯτίϯιʔϧʹදࣔ͞Ε͍ͯΔ৘ใͱݟൺ΂ͯΈ Δ
  6. AWS CLI Λ࢖ͬͨૢ࡞Λͯ͠Έ Δ • ࣍͸AWS CLI͔ΒEC2ΠϯελϯεΛ࡟আͯ͠ΈΔ • ࡟আର৅ͷEC2ΠϯελϯεΛಛఆ͢ΔͨΊʹʮΠϯελϯεIDʯ͕ ඞཁ

    • લड़ͷৄࡉදࣔίϚϯυͰΠϯελϯεIDΛऔಘ͢Δ • औಘͨ͠ΠϯελϯεIDΛ࢖ͬͯҎԼͷ࡟আίϚϯυΛ࣮ߦ͢Δ • aws ec2 terminate-instances --instance-ids i-cxxxxxxx • Ϛωʔδϝϯτίϯιʔϧ্ʹͯঢ়ଶΛ֬ೝͯ͠ΈΔ
  7. AWS CLI Λ࢖ͬͨૢ࡞Λͯ͠Έ Δ • Ϛωʔδϝϯτίϯιʔϧ͔ΒEC2ΠϯελϯεΛ࡟আ͢Δํ๏ • ΠϯελϯεҰཡը໘ͷࠨ্ʹ͋ΔʮΞΫγϣϯʯϘλϯΛΫ ϦοΫͯ͠ϝχϡʔΛදࣔ͢Δ •

    දࣔ͞ΕͨϝχϡʔͷதͰΠϯελϯεͷঢ়ଶˠ࡟আ Λબ୒͢ Δ • ࡟আΛ֬ೝ͢ΔμΠΞϩά͕දࣔ͞ΕΔͷͰɺ಺༰Λ֬ೝͯ͠ ࡟আ͢ΔΛબ୒͢Δͱ࡟আ͕࣮ߦ͞ΕΔ
  8. AWS CLI Λ࢖ͬͨૢ࡞Λͯ͠Έ Δ • Ϛωʔδϝϯτίϯιʔϧ͔ΒEC2ΠϯελϯεΛఀࢭ͢Δํ๏ • ΠϯελϯεҰཡը໘ͷࠨ্ʹ͋ΔʮΞΫγϣϯʯϘλϯΛΫϦοΫ ͯ͠ϝχϡʔΛදࣔ͢Δ •

    දࣔ͞ΕͨϝχϡʔͷதͰΠϯελϯεͷঢ়ଶˠఀࢭ Λબ୒͢Δ • ఀࢭΛ֬ೝ͢ΔμΠΞϩά͕දࣔ͞ΕΔͷͰɺ಺༰Λ֬ೝͯ͠ఀࢭ͢ ΔΛબ୒͢Δͱఀࢭ͕࣮ߦ͞ΕΔ • ఀࢭதͷEC2Πϯελϯεʹ͸EC2Πϯελϯεͷར༻ྉۚͱͯ͠ͷ ՝ۚ͸ߦΘΕͳ͍
  9. AWS CLI Λ࢖ͬͨૢ࡞Λͯ͠Έ Δ • Ϛωʔδϝϯτίϯιʔϧ͔ΒEC2ΠϯελϯελΠϓΛมߋ͢Δํ๏ • ΠϯελϯεҰཡը໘ͷࠨ্ʹ͋ΔʮΞΫγϣϯʯϘλϯΛΫϦοΫͯ͠ ϝχϡʔΛදࣔ͢Δ •

    දࣔ͞ΕͨϝχϡʔͷதͰΠϯελϯεͷઃఆˠΠϯελϯελΠϓͷม ߋ Λબ୒͢Δ • มߋΛ֬ೝ͢ΔμΠΞϩά͕දࣔ͞ΕΔͷͰɺมߋ͍ͨ͠Πϯελϯελ ΠϓΛબ୒ͯ͠ద༻͢Δͱมߋ͕࣮ߦ͞ΕΔ • ఀࢭதͷEC2ΠϯελϯεͰͳ͚Ε͹͜ͷมߋ͸ߦ͑ͳ͍ͷͰ஫ҙ͕ඞཁ
  10. ·ͱΊ • EC2ΠϯελϯεΛ্ཱͪ͛ͯૢ࡞͢Δ͜ͱ͕ग़དྷͨ • AWS CLIΛগ͚ͩ͠৮ͬͯಈ͔ͨ͠ • EC2ΠϯελϯεΛεέʔϧΞοϓ/εέʔϧμ΢ϯͤ͞Δ͜ͱ͸؆୯ʹग़ དྷΔ •

    AMIΛ࡞੒͢Δ͜ͱͰಉ͡ঢ়ଶͷEC2ΠϯελϯεΛ࡞੒͢Δ͜ͱ΋؆୯ ʹग़དྷΔ • ଞʹ΋EC2ͦͷ΋ͷͷػೳͱؔ࿈͢ΔαʔϏε͕ෳ਺͋ΔͷͰɺυΩϡϝ ϯτ΍AWS͔Βग़͍ͯΔࢿྉͰ֬ೝͯ͠Έͯཉ͍͠
  11. Appendix • AWS Ϋϥ΢υαʔϏε׆༻ࢿྉू • http://aws.amazon.com/jp/aws-jp-introduction/ • Amazon EC2 (Ծ૝Ϋϥ΢υαʔόʔ)

    • http://aws.amazon.com/jp/ec2/ • Amazon Elastic Block Store (EBS ) EC2༻ϒϩοΫετϨʔδ • http://aws.amazon.com/jp/ebs/
  12. Appendix • AWS શൠͷϦϑΝϨϯε • http://docs.aws.amazon.com/ja_jp/general/latest/gr/Welcome.html • ϗϫΠτϖʔύʔ • http://aws.amazon.com/jp/whitepapers/

    • AWS ίϚϯυϥΠϯΠϯλʔϑΣΠε • http://aws.amazon.com/jp/cli/ • Cyberduck • https://cyberduck.io/?l=ja