Slide 1

Slide 1 text

ҏ౻Յ༸@michimani210 AWS CLI ͷΤΠϦΞεػೳ͸͍͍ͧ

Slide 2

Slide 2 text

#ॴଐɾ୲౰ ● หޢ࢜υοτίϜגࣜձࣾ ● όοΫΤϯυΤϯδχΞ #޷͖ͳ AWS ͷαʔϏε ● AWS CLI ● AWS Lambda #झຯ ● εϐʔυΩϡʔϒ ● ಓͷӺ८Γ ࣗݾ঺հ ҏ౻ Յ༸/Yoshihiro Ito ɹɹ@michimani210

Slide 3

Slide 3 text

1.AWS CLI ͱ͸ 2.AWS CLI ͷΤΠϦΞεػೳͱ͸ 3.AWS CLI ͷΤΠϦΞεػೳͰग़དྷΔ͜ͱ 4.ઃఆ͓ͯ͘͠ͱศརͳΤΠϦΞε 5.·ͱΊ ※࿩͞ͳ͍͜ͱ ● AWS CLI ͷΠϯετʔϧํ๏ ● ݸผͷίϚϯυͷৄࡉͳઆ໌ ※ຊεϥΠυͷ಺༰͸ݸਓͷݟղͰ͋Γɺॴଐ͢ΔاۀΛ୅ද͢Δ΋ͷͰ͸͋Γ·ͤΜ ΞδΣϯμ

Slide 4

Slide 4 text

1. AWS CLI ͱ͸

Slide 5

Slide 5 text

https://aws.amazon.com/jp/cli/ 1.AWS CLI ͱ͸

Slide 6

Slide 6 text

ίϚϯυͷߏ੒ 1.AWS CLI ͱ͸

Slide 7

Slide 7 text

ίϚϯυͷߏ੒ 1.AWS CLI ͱ͸ શͯͷ command ʹ ڞ௨ͷΦϓγϣϯ --profile --query ͳͲ

Slide 8

Slide 8 text

ίϚϯυͷߏ੒ 1.AWS CLI ͱ͸ ૢ࡞ର৅ͷαʔϏε s3api lambda iam ͳͲ શͯͷ command ʹ ڞ௨ͷΦϓγϣϯ --profile --query ͳͲ

Slide 9

Slide 9 text

ίϚϯυͷߏ੒ 1.AWS CLI ͱ͸ ૢ࡞ର৅ͷαʔϏε s3api lambda iam ͳͲ αʔϏεʹର͢ΔΞΫγϣϯ create-bucket list-functions get-role ͳͲ શͯͷ command ʹ ڞ௨ͷΦϓγϣϯ --profile --query ͳͲ

Slide 10

Slide 10 text

ίϚϯυͷߏ੒ 1.AWS CLI ͱ͸ ૢ࡞ର৅ͷαʔϏε s3api lambda iam ͳͲ αʔϏεʹର͢ΔΞΫγϣϯ create-bucket list-functions get-role ͳͲ શͯͷ command ʹ ڞ௨ͷΦϓγϣϯ --profile --query ͳͲ ΞΫγϣϯ࣮ߦ࣌ͷ ύϥϝʔλ --buket-name --max-items --role-name ͳͲ

Slide 11

Slide 11 text

ྫ: us-east-1 Ϧʔδϣϯʹ͋Δ Lambda ؔ਺Λ 5 ͚݅ͩऔಘͯ͠ɺ ɹ ͦΕͧΕͷؔ਺໊͚ͩग़ྗ͍ͨ͠৔߹ 1.AWS CLI ͱ͸

Slide 12

Slide 12 text

2. AWS CLI ͷΤΠϦΞεػೳͱ͸

Slide 13

Slide 13 text

● AWS CLI ίϚϯυͷγϣʔτΧοτΛ࡞੒Ͱ͖Δػೳ ● v1.11.24 ͓Αͼ 2.0.0 Ҏ߱Ͱར༻Մೳ ● ~/.aws/cli/alias ϑΝΠϧ಺ʹ೚ҙͷΤΠϦΞεΛهड़ 2. AWS CLI ͷΤΠϦΞεػೳͱ͸

Slide 14

Slide 14 text

● AWS CLI ίϚϯυͷγϣʔτΧοτΛ࡞੒Ͱ͖Δػೳ ● v1.11.24 ͓Αͼ 2.0.0 Ҏ߱Ͱར༻Մೳ ● ~/.aws/cli/alias ϑΝΠϧ಺ʹ೚ҙͷΤΠϦΞεΛهड़ 2. AWS CLI ͷΤΠϦΞεػೳͱ͸ ΤΠϦΞεͷ໊લ

Slide 15

Slide 15 text

● AWS CLI ίϚϯυͷγϣʔτΧοτΛ࡞੒Ͱ͖Δػೳ ● v1.11.24 ͓Αͼ 2.0.0 Ҏ߱Ͱར༻Մೳ ● ~/.aws/cli/alias ϑΝΠϧ಺ʹ೚ҙͷΤΠϦΞεΛهड़ 2. AWS CLI ͷΤΠϦΞεػೳͱ͸ ΤΠϦΞεͷ໊લ ίϚϯυ

Slide 16

Slide 16 text

● AWS CLI ίϚϯυͷγϣʔτΧοτΛ࡞੒Ͱ͖Δػೳ ● v1.11.24 ͓Αͼ 2.0.0 Ҏ߱Ͱར༻Մೳ ● ~/.aws/cli/alias ϑΝΠϧ಺ʹ೚ҙͷΤΠϦΞεΛهड़ 2. AWS CLI ͷΤΠϦΞεػೳͱ͸ ΤΠϦΞεͷ໊લ ίϚϯυ aws whoami Ͱ aws sts get-caller-identity ͕࣮ߦ͞ΕΔ

Slide 17

Slide 17 text

3. AWS CLI ͷΤΠϦΞεػೳͰग़དྷΔ͜ͱ

Slide 18

Slide 18 text

● ΤΠϦΞεʹଓ͚ͯΦϓγϣϯɺύϥϝʔλΛ௥ՃͰ͖Δ ● ΤΠϦΞείϚϯυͷதͰଞͷΤΠϦΞεΛ࢖༻Ͱ͖Δ 3. AWS CLI ͷΤΠϦΞεػೳͰग़དྷΔ͜ͱ

Slide 19

Slide 19 text

● ೚ҙͷ਺ͷҾ਺Λड͚औΔΤΠϦΞεΛ࡞੒Ͱ͖Δ 3. AWS CLI ͷΤΠϦΞεػೳͰग़དྷΔ͜ͱ 実行例: aws fnls 2

Slide 20

Slide 20 text

4. ઃఆ͓ͯ͘͠ͱศརͳΤΠϦΞε

Slide 21

Slide 21 text

● ΞΧ΢ϯτ ID Λදࣔ͢Δ 4. ઃఆ͓ͯ͘͠ͱศརͳΤΠϦΞε

Slide 22

Slide 22 text

● ϥϯλΠϜΛࢦఆͯ͠ Lambda ؔ਺ΛҰཡͰऔಘ͢Δ 4. ઃఆ͓ͯ͘͠ͱศརͳΤΠϦΞε 実行例: aws lambda-fn-runtime python3.6

Slide 23

Slide 23 text

● ECR ʹϩάΠϯ͢Δ 4. ઃఆ͓ͯ͘͠ͱศརͳΤΠϦΞε 実行例: aws ecr-login ap-northeast-1

Slide 24

Slide 24 text

● ೚ҙͷ IAM Role Λࢦఆͯ͠εΠονϩʔϧ͢Δ 4. ઃఆ͓ͯ͘͠ͱศརͳΤΠϦΞε 実行例: aws switch-role hoge-role

Slide 25

Slide 25 text

5. ·ͱΊ

Slide 26

Slide 26 text

● AWS CLI ͸ίϚϯυϥΠϯ͔Β AWS ͷϦιʔεΛૢ࡞͢Δπʔϧ ● ”aws” ίϚϯυʹଓ͘ΤΠϦΞεΛઃఆͰ͖Δػೳ͕͋Δ ● සൟʹ࢖͏ίϚϯυΛΤΠϦΞεʹઃఆ͓ͯ͘͠ͱ࡞ۀ͕ḿΔ ● AWS CLI ͸͍͍ͧ 5. ·ͱΊ

Slide 27

Slide 27 text

● AWS ίϚϯυϥΠϯΠϯλʔϑΣΠεʢCLI: AWSαʔϏεΛ؅ཧ͢Δ౷߹πʔϧʣ| AWS
 https://aws.amazon.com/jp/cli/ ● AWS CLI ΤΠϦΞεͷ࡞੒ͱ࢖༻ - AWS Command Line Interface
 https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/cli-usage-alias.html ● michimani/awscli-aliases (ࠓճ঺հͨ͠ΤΠϦΞε) 
 https://github.com/michimani/awscli-aliases ࢀߟࢿྉ

Slide 28

Slide 28 text

͓͠·͍