{"id":17647,"date":"2019-12-05T03:56:39","date_gmt":"2019-12-04T18:56:39","guid":{"rendered":"http:\/\/www.skyarch.net\/blog\/?p=17647"},"modified":"2020-05-22T17:15:10","modified_gmt":"2020-05-22T08:15:10","slug":"%e3%80%90aws-reinvent2019%e3%80%91dop343-rofa-introduction-to-the-aws-cli-v2-%e3%82%bb%e3%83%83%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92%e5%8f%97%e8%ac%9b%e3%81%97%e3%81%be%e3%81%97%e3%81%9f","status":"publish","type":"post","link":"https:\/\/www.skyarch.net\/blog\/%e3%80%90aws-reinvent2019%e3%80%91dop343-rofa-introduction-to-the-aws-cli-v2-%e3%82%bb%e3%83%83%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92%e5%8f%97%e8%ac%9b%e3%81%97%e3%81%be%e3%81%97%e3%81%9f\/","title":{"rendered":"\u3010AWS re:Invent2019\u3011DOP343-ROFA &#8211; Introduction to the AWS CLI v2 \u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u53d7\u8b1b\u3057\u307e\u3057\u305f"},"content":{"rendered":"<ul>\n<li><a href=\"#overview\">\u6982\u8981<\/a><\/li>\n<li><a href=\"#reflink\">\u53c2\u8003\u30ea\u30f3\u30af<\/a><\/li>\n<li><a href=\"#session\">\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066<\/a><\/li>\n<\/ul>\n<h2 id=\"overview\">\u6982\u8981<\/h2>\n<p>DOP343-ROFA - Introduction to the AWS CLI v2 \u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u53d7\u8b1b\u3057\u307e\u3057\u305f<br \/>\n\u73fe\u72b6\u306f\u8a55\u4fa1\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u304c\u3001v1\u306b\u6bd4\u3079\u30d1\u30ef\u30fc\u30a2\u30c3\u30d7\u3057\u3066\u3044\u308b\u7b87\u6240\u304c\u591a\u304f\u3001\u6b63\u5f0f\u7248\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u3089\u65e9\u304f\u672c\u756a\u74b0\u5883\u306b\u3082\u6295\u5165\u3057\u305f\u3044\uff01\u3068\u611f\u3058\u307e\u3057\u305f\u3002<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u7b49\u306f\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u3068\u3057\u3066\u3001v2\u306a\u3089\u3067\u306f\u306e\u90e8\u5206\u3092\u53d6\u308a\u4e0a\u3052\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u53c2\u8003\u30ea\u30f3\u30af<\/h2>\n<ul>\n<li>AWS CLI \u30d0\u30fc\u30b8\u30e7\u30f3 2 \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/ja_jp\/cli\/latest\/userguide\/install-cliv2.html\">https:\/\/docs.aws.amazon.com\/ja_jp\/cli\/latest\/userguide\/install-cliv2.html<\/a><\/li>\n<li>AWS \u30b7\u30f3\u30b0\u30eb\u30b5\u30a4\u30f3\u30aa\u30f3 \u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e AWS CLI \u306e\u8a2d\u5b9a (AWS SSO)<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/ja_jp\/cli\/latest\/userguide\/cli-configure-sso.html\">https:\/\/docs.aws.amazon.com\/ja_jp\/cli\/latest\/userguide\/cli-configure-sso.html<\/a><\/li>\n<li>Github<br \/>\n<a href=\"https:\/\/github.com\/aws\/aws-cli\/labels\/v2\/\">https:\/\/github.com\/aws\/aws-cli\/labels\/v2\/<\/a><\/li>\n<li>AWS CLI v2 blog posts<br \/>\n<a href=\"https:\/\/aws.amazon.com\/jp\/blogs\/developer\/category\/programing-language\/aws-cli\/\">https:\/\/aws.amazon.com\/jp\/blogs\/developer\/category\/programing-language\/aws-cli\/<\/a><\/li>\n<\/ul>\n<h2 id=\"session\">\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066<\/h2>\n<h3>v2\u30cf\u30a4\u30e9\u30a4\u30c8\u7b87\u6240\u306b\u3064\u3044\u3066<\/h3>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_083247-300x206.jpg\" alt=\"\" width=\"300\" height=\"206\" class=\"aligncenter size-medium wp-image-17669\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_083247-300x206.jpg 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_083247.jpg 653w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<ul>\n<li>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb&amp;\u8a2d\u5b9a\n<ul>\n<li>ExecutableInstaller (v2\u306e\u307f)<\/li>\n<li>Developer Preview\u306e\u305f\u3081\u5b9f\u884c\u30b3\u30de\u30f3\u30c9\u540d\u306f aws2<\/li>\n<li>\u65e2\u5b58Python\u306e\u5f71\u97ff\u3092\u53d7\u3051\u305a\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u308b\u305f\u3081 v1\u3068\u306e\u5171\u5b58\u304c\u53ef\u80fd<\/li>\n<li>AWS SSO\u306b\u5bfe\u5fdc (\u5f8c\u8ff0)<\/li>\n<\/ul>\n<\/li>\n<li>CommandI\/O (\u5f8c\u8ff0)<\/li>\n<li>\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u6a5f\u80fd (\u5f8c\u8ff0)<\/li>\n<\/ul>\n<h4>AWS SSO\u306b\u5bfe\u5fdc (v2\u306e\u307f)<\/h4>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_084143-300x215.jpg\" alt=\"\" width=\"300\" height=\"215\" class=\"aligncenter size-medium wp-image-17668\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_084143-300x215.jpg 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_084143.jpg 642w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<p>\u30c7\u30e2\u4e2d\u3067\u306fSSO\u306b\u3066\u8a2d\u5b9a\u3057\u305fRole\u3092\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306b\uff08\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u4e0a\u3067\u30ea\u30b9\u30c8\u304c\u8868\u793a\u3055\u308c\u9078\u629e\u3059\u308b\u5f62\uff09\u5207\u308a\u66ff\u3048\u3066<br \/>\n\u9078\u629e\u3057\u305fRole\u306b\u3088\u308a <code>aws2 s3 ls<\/code> \u3092\u5b9f\u884c\u3057\u8868\u793a\u3055\u308c\u308bS3\u30d0\u30b1\u30c3\u30c8\u304c\u7570\u306a\u308b\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<h4>SSO\u8a2d\u5b9a\u306b\u3064\u3044\u3066<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_084520-300x200.jpg\" alt=\"\" width=\"300\" height=\"200\" class=\"aligncenter size-medium wp-image-17667\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_084520-300x200.jpg 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_084520.jpg 634w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\n\u30c7\u30e2\u4e2d\u3067\u306f\u4e0b\u8a18\u3092\u5b9f\u65bd\u3057\u3066\u3044\u307e\u3057\u305f<\/p>\n<ul>\n<li>aws2 configure sso \u306b\u3066 start url\u7b49\u3092\u8a2d\u5b9a<\/li>\n<li>\u30d6\u30e9\u30a6\u30b6\u304c\u958b\u304f\u305f\u3081\u305d\u3061\u3089\u3067ID\/PW\u3092\u5165\u529b<br \/>\n\u203b\u5185\u90e8\u3067Token\u3092\u53d6\u5f97\u3057\u305d\u3061\u3089\u3092\u5229\u7528\u3057\u4e00\u5b9a\u6642\u9593Login\u30aa\u30da\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u4e0d\u8981\u3068\u306a\u308b<\/li>\n<\/ul>\n<h3>CommandI\/O<\/h3>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085158-300x207.jpg\" alt=\"\" width=\"300\" height=\"207\" class=\"aligncenter size-medium wp-image-17666\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085158-300x207.jpg 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085158.jpg 624w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<h4>\u30ea\u30bd\u30fc\u30b9\u540d\u306e\u81ea\u52d5\u88dc\u5b8c<\/h4>\n<p>CLI v1\u304b\u3089\u306e\u6a5f\u80fd\u3067\u3059\u304c v2\u306e\u5834\u5408\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a2d\u5b9a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ complete -C aws2_completer aws2\n<\/pre>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085331-300x209.jpg\" alt=\"\" width=\"300\" height=\"209\" class=\"aligncenter size-medium wp-image-17665\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085331-300x209.jpg 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085331.jpg 620w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085419-300x212.jpg\" alt=\"\" width=\"300\" height=\"212\" class=\"aligncenter size-medium wp-image-17664\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085419-300x212.jpg 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085419.jpg 611w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<p>v2\u3067\u306eUpdate\u306f\u5b9f\u969b\u306b\u5b58\u5728\u3059\u308b\u30ea\u30bd\u30fc\u30b9\u540d\u306e\u88dc\u5b8c\u307e\u3067\u9032\u3081\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f<\/p>\n<h4>yaml\u5bfe\u5fdc<\/h4>\n<p>v1\u3067\u306f JSON(\u30d1\u30e9\u30e1\u30fc\u30bf\u306fjson), text, table\u306e\u307f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ aws2 ec2 describe-instances --output yaml\n<\/pre>\n<p>\u203bOutput\u30d1\u30e9\u30e1\u30fc\u30bf\u3067v1\u3067\u6307\u5b9a\u51fa\u6765\u305f\u5024\u3082\u6307\u5b9a\u53ef\u80fd<\/p>\n<p>yaml\u3092\u6a19\u6e96\u306b\u3059\u308b\u5834\u5408\u4e0b\u8a18\u3092\u5b9f\u884c\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ aws2 configure set output yaml\n<\/pre>\n<h4>Paging\u6a5f\u80fd\u62e1\u5f35<\/h4>\n<p>Paging\u6a5f\u80fd\u3067\u6b21\u30da\u30fc\u30b8\u3092\u8981\u6c42\u3059\u308b\u3068\u7d50\u679c\u304c\u8aad\u307f\u8fbc\u307e\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f (output\u578b\u5f0f\u306b yaml-stream \u3092\u6307\u5b9a)<br \/>\n\u7279\u306b\u591a\u6570\u306eAPI\u304c\u88cf\u3067\u547c\u3070\u308c\u308b\u69d8\u306a\u30b3\u30de\u30f3\u30c9\u306e\u5834\u5408\u30ed\u30fc\u30c9\u6642\u9593\u304c\u5927\u304d\u304f\u7570\u308b\u3002<\/p>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085722-300x199.jpg\" alt=\"\" width=\"300\" height=\"199\" class=\"aligncenter size-medium wp-image-17662\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085722-300x199.jpg 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_085722.jpg 620w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ aws2 ec2 describe-snapshots\n1\u5206\u7a0b\u3057\u3066\u304b\u3089\u5168\u7d50\u679c\u304c\u5e30\u3063\u3066\u304f\u308b\n\n$ aws2 ec2 describe-snapshots --output yaml-stream\n- NextToken: eyJ2IjoiMiIsImMi....\n  Snapshots:\n  - Description: ...\n\u6570\u79d2\u3067\u6700\u521d\u306e\u30da\u30fc\u30b8\u306e\u7d50\u679c\u304c\u5e30\u3063\u3066\u304f\u308b \u30da\u30fc\u30b8\u3092\u9032\u3081\u308b\u3068\u5f15\u304d\u7d9a\u304d\u8aad\u307f\u8fbc\u307e\u308c\u305f\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u308b\n<\/pre>\n<h4>\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u6a5f\u80fd<\/h4>\n<p>Config\u306e\u6642\u70b9\u3067\u3082 wizard \u3068\u3044\u3046\u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306a\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_cli-300x95.png\" alt=\"\" width=\"300\" height=\"95\" class=\"aligncenter size-medium wp-image-17684\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_cli-300x95.png 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_cli-768x244.png 768w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_cli-728x231.png 728w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_cli.png 820w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<p>DynamoDB\u306b\u65b0\u3057\u3044\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408<br \/>\n\u4e0b\u8a18\u306e\u3088\u3046\u306a\u5f62\u3067\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u6307\u5b9a\u53ef\u80fd\u306a\u5024\u3092\u9078\u629e\u3057\u306a\u304c\u3089\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ aws2 dynamodb wizard new-table\n<\/pre>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_dynamodb-300x114.png\" alt=\"\" width=\"300\" height=\"114\" class=\"aligncenter size-medium wp-image-17685\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_dynamodb-300x114.png 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_dynamodb-768x291.png 768w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_dynamodb-728x276.png 728w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/aws2_dynamodb.png 854w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_090811-300x166.jpg\" alt=\"\" width=\"300\" height=\"166\" class=\"aligncenter size-medium wp-image-17663\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_090811-300x166.jpg 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2019\/12\/IMG_20191204_090811.jpg 615w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\n<p>\u307e\u3060\u3053\u308c\u304b\u3089\u5bfe\u5fdc\u304c\u5897\u3048\u308b\u305d\u3046\u306a\u306e\u3067\u3001\u6b63\u5f0f\u7248\u306e\u767a\u8868\u304c\u3068\u3066\u3082\u697d\u3057\u307f\u3067\u3059\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 \u53c2\u8003\u30ea\u30f3\u30af \u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066 \u6982\u8981 DOP343-ROFA &#8211; Introduction to the AWS CLI v2 \u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u53d7\u8b1b\u3057\u307e\u3057\u305f \u73fe\u72b6\u306f\u8a55\u4fa1\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u304c\u3001v1\u306b\u6bd4\u3079\u30d1\u30ef\u30fc\u30a2\u30c3\u30d7\u3057\u3066\u3044\u308b\u7b87&#8230;<\/p>\n","protected":false},"author":2,"featured_media":17587,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"17647","footnotes":""},"categories":[923],"tags":[],"class_list":{"0":"post-17647","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-aws-reinvent-2019","8":"ja"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/17647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/comments?post=17647"}],"version-history":[{"count":14,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/17647\/revisions"}],"predecessor-version":[{"id":17692,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/17647\/revisions\/17692"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media\/17587"}],"wp:attachment":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media?parent=17647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/categories?post=17647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/tags?post=17647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}