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

AWSをGUIで操作するのは中学生までだよねー

 AWSをGUIで操作するのは中学生までだよねー

2016/10/03
KDLインフラ勉強会 AWS勉強会#2

Shinichi Hama

October 03, 2016
Tweet

Other Decks in Technology

Transcript

  1. Ϛ ω ʛ δ ϝ ϯ τ ί ϯ ι

    ʛ ϧ ⁉︎ G U I த
  2. ୭Ͱ͔͢ʁ { ɹɹ“Myself”:{ ɹɹɹɹ“Name”: “Shinichi Hama (ᖛɹਅҰ)”, ɹɹɹɹ“BelongTo”: “Kobe Digital

    Labo Inc. WEB Section (גࣜձࣾਆށσδλϧϥϘ ιϦϡʔγϣϯຊ෦ WEBηΫγϣϯ)”, ɹɹɹɹ“Role”: “Infrastructure Engineer (ΠϯϑϥΤϯδχΞ)”, ɹɹɹɹ“LikeAWSService”:[ ɹɹɹɹɹɹ{ ɹɹɹɹɹɹɹɹ“AWS Service”: “Amazon S3”, ɹɹɹɹɹɹɹɹ“AWS Service”: “AWS IAM” ɹɹɹɹɹɹ} ɹɹɹɹ], ɹɹɹɹ“Histrory”: [ ɹɹɹɹɹɹ{ ɹɹɹɹɹɹɹɹ"TheNumberOfYearsWorked": 3(৽ଔೖࣾࡾ೥໨Ͱ͢ɻ), ɹɹɹɹɹɹɹɹ”RoutineWork”: "E-Commerce Site developments and SysOps work (ECαΠτͷ։ൃɺӡ༻อकΛͯ͠·͢)" ɹɹɹɹɹɹ} ɹɹɹɹ], ɹɹ} } [hama@Macbbok] ~ % aws-shell aws> kdl describe-presenter
  3. ։ൃݱ৔ͷΠϯϑϥ୲౰ͷ೰Έ ͍͍ͩͨಉ͡࡞ۀͷ܁Γฦ͠ ৽ָͯͦ͘͠͠͏ͳҊ݅ͱ͔͸֎஫͞ΕΔ orz • ๞͖Δɻ • ϛεΔɻ • ౖΒΕΔɻ

    • ධՁ͕Լ͕Δɻ ͍΍͔ͯɺͦ΋ͦ΋͏·͘Ͱ͖ͯ΋ධՁ͞Εͳ͍… Πϯϑϥ͸Քಇͯͯ͠౰ͨΓલɺࢭ·ΔͱධՁ͕͕͞Δɻ
  4. CLI͕͋Δͱ͖ʂ [hama@Macbbok] ~ % aws ec2 run-instances --image-id ami-374db956 --count

    1 --instance-type t2.micro --key-name hama_test_id_rsa --security-group-ids sg-××××××× --subnet-id subnet-××××××× --associate-public-ip- address | jq . { "OwnerId": "××××××××××", "ReservationId": "r-××××××××××××", "Groups": [], "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "", "RootDeviceType": "ebs", "State": { "Code": 0, "Name": "pending" }, "EbsOptimized": false, "LaunchTime": "2016-10-02T17:16:34.000Z", "PrivateIpAddress": "10.0.4.101", "ProductCodes": [], "VpcId": "vpc-××××××××", "StateTransitionReason": "", "InstanceId": "i-×××××××××××××××××", "ImageId": "ami-374db956", "PrivateDnsName": "ip-10-0-4-101.ap-northeast-1.compute.internal", "KeyName": "hama_test_id_rsa", ɾ ɾ ɾ ʙҎԼলུʙ ͜Μ͚ͩͰ͢ɻ ͦͯ͠CLI͸JSONΛಡΈࠐΜͰ࣮ߦ΋Ͱ͖ΔͷͰɺ ͦͷjsonΛ࢒͓͚ͯ͠͹ɺͦΕ͕ઃܭॻʹͳΓ·͢ɻ จࣈ௨ΓɺίʔυͰ؅ཧͰ͖Δɻ
  5. AWS-CLIΛ࢖͓͏ •for MAC(or for Linux) •PIPͷΠϯετʔϧ $ sudo easy_install pip

    (MACͷ࣌) •aws-cliͷΠϯετʔϧ $ sudo pip install awscli •for Windows ϒϥ΢β͔Βμ΢ϯϩʔυͨ͠Β ↓Έ͍ͨͳΠϯετʔϥʔ͕μ΢ϯϩʔυ͞ΕΔͷͰ ɹ͋ͱ͸ྲྀΕʹ਎Λ೚͍ͤͯͩ͘͞ʢgg͍ͬͯͩ͘͞ɻʣ
  6. $ aws configure AWS access key ID [**ABCD]: AWS secret

    access key [****************EFGH]: Default region name [ap-northeast-1]: Default output format [None]:
  7. jqͷεεϝ •୯७ͳ࢖͍ํ͸άά͍ͬͯͨͩ͘ͱͯ͠ɺҎԼͷΑ͏ͳ࢖͍ํͰ࢖ͬͨΓ͠·͢ɻ 1.Value͚ͩදࣔ $ aws ec2 describe-instances | jq '.Reservations[].Instances[].Tags[].Value'

    "app.example.com" "db.example.com" "elasticsearch.example.com" "example.com" 2.ϓϥΠϕʔτIPΞυϨεͱTagʢName)Λλϒ۠੾ΓͰදࣔ $ aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | .PrivateIpAddress + "\t" + .Tags[].Value' 192.168.1.125 app.example.com 192.168.1.14 db.example.com 192.168.1.250 elasticsearch.example.com 192.168.1.230 example.com