{"id":657,"date":"2026-04-25T12:53:38","date_gmt":"2026-04-25T03:53:38","guid":{"rendered":"https:\/\/kitayama.jp\/?p=657"},"modified":"2026-04-25T13:47:49","modified_gmt":"2026-04-25T04:47:49","slug":"mac%e3%81%a7%e3%80%81aws%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%b3%e3%82%b9%e3%81%ae%e7%a8%bc%e5%83%8d%e7%8a%b6%e6%85%8b%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/kitayama.jp\/?p=657","title":{"rendered":"MAC\u3067\u3001AWS\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u7a3c\u50cd\u72b6\u614b\u3092\u8868\u793a\u3059\u308b\u3002"},"content":{"rendered":"\n<p>\u3064\u3044\u3067\u306b\u3001AWS\u306e\u8d77\u52d5\u505c\u6b62\u3092Mac\u306e\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc\u304b\u3089\u884c\u3046\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>AWS\u3067VPN\u3092\u69cb\u6210\u3057\u3066\u4f7f\u3063\u3066\u3044\u308b\u3093\u3060\u3051\u3069\u3001\u4f7f\u3063\u3066\u3044\u306a\u3044\u6642\u306f\u6b62\u3081\u3066\u304a\u304d\u305f\u3044\u3002<\/p>\n\n\n\n<p>10\u5206\u4f7f\u3063\u3066\u306a\u3044\u3068\u81ea\u52d5\u7684\u306b\u6b62\u3081\u308b\u51e6\u7406\u5165\u308c\u3066\u3044\u308b\u3093\u3060\u3051\u3069\u3001VPN\u3092\u4f7f\u3046\u6642\u306f\u7a3c\u50cd\u3055\u305b\u305f\u3044\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001Mac\u3067\u3001VPN\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u7a3c\u50cd\u72b6\u6cc1\u3092\u898b\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u3068\u540c\u6642\u306b\u3001\u8d77\u52d5\u505c\u6b62\u3092\u884c\u3048\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" src=\"https:\/\/kitayama.jp\/wp-content\/uploads\/2026\/04\/fb4a66464b5b028d0a19870449dd9000.png\" alt=\"\" class=\"wp-image-658\" width=\"173\" height=\"234\" srcset=\"https:\/\/kitayama.jp\/wp-content\/uploads\/2026\/04\/fb4a66464b5b028d0a19870449dd9000.png 392w, https:\/\/kitayama.jp\/wp-content\/uploads\/2026\/04\/fb4a66464b5b028d0a19870449dd9000-222x300.png 222w\" sizes=\"(max-width: 173px) 100vw, 173px\" \/><\/figure>\n\n\n\n<h2>\u307e\u305a\u306f\u3001AWS CLI\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>brew install awscli\naws configure<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>aws configure\u3092\u3059\u308b\u3068\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3068\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u3092\u805e\u304b\u308c\u308b\u3002<\/p>\n\n\n\n<p><strong>\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u306f\u3001IAM\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210<\/strong><\/p>\n\n\n\n<p>\u4f5c\u6210\u3059\u308b\u3068\u3001\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3068\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u304c\u3082\u3089\u3048\u308b\u3002<br>\u3053\u306e\u969b\u306b\u3001\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u306f\u3053\u306e\u6642\u3057\u304b\u53d6\u308c\u306a\u3044\u306e\u3067\u30e1\u30e2\u3092\u6b8b\u3057\u3066\u304a\u304f\u3068\u3044\u3044\u3002<br>\u3082\u3057\u3082\u30e1\u30e2\u3092\u5fd8\u308c\u305f\u3089\u3001\u4f5c\u6210\u3057\u306a\u304a\u3057\u3067\u3002<\/p>\n\n\n\n<p>\u4f5c\u6210\u5f8c\u8a31\u53ef\u3092\u8ffd\u52a0\u3067\u3001<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>AmazonEC2FullAccess\nAmazonEC2ReadOnlyAccess\nIAMUserChangePassword<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3053\u306e\uff13\u500b\u3092\u6709\u52b9\u306b\u3057\u3066\u304a\u304f<\/p>\n\n\n\n<p>\u305d\u308c\u3068\u3001input\u3068output\u3092\u805e\u304b\u308c\u308b\u3002<br>\u3053\u3053\u306f\u3001<br>ap-northeast-1<br>\u3068<br>json<br><br>\u4e07\u304c\u4e00\u9593\u9055\u3048\u305f\u6642\u306f\u3001<br>vi ~\/.aws\/config&nbsp;<br>\u3067\u4fee\u6b63\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>[default]\nregion = ap-northeast-1\noutput = json<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2>\u72b6\u614b\u3092\u78ba\u8a8d<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>aws ec2 describe-instances \\\n--instance-ids i-xxxxxxxx \\\n--query &quot;Reservations[].Instances[].State.Name&quot; \\\n--output text<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2>SwiftBar \u5165\u308c\u308b<\/h2>\n\n\n\n<p><a href=\"https:\/\/swiftbar.app\">https:\/\/swiftbar.app<\/a><\/p>\n\n\n\n<h2><strong>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u3053\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u7f6e\u304f<\/strong><\/h2>\n\n\n\n<p>~\/Library\/Application Support\/SwiftBar\/Plugins\/<\/p>\n\n\n\n<p>~\/Library\u306f\u3001\u96a0\u3057\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u3067\u3001\u898b\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229\u3002<br>\u3084\u308a\u65b9\u306f\u8abf\u3079\u3066\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u3068\u3001\u30a2\u30d7\u30ea\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001\u52dd\u624b\u306b\u3000SwiftBar\/Plugins\/\u3000\u304c\u3067\u304d\u308b\u3088\u3046\u306a\u8aac\u660e\u304c\u3042\u308b\u3051\u3069\u3001\u4e00\u822c\u7684\u306a\u74b0\u5883\u3060\u3068\u52dd\u624b\u306b\u306f\u4f5c\u3089\u308c\u306a\u3044\u306e\u3067\u3001\u81ea\u5206\u3067\u4f5c\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p><br>\u305d\u308c\u3068\u3001SwiftBar\u3000\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3067FullAccess\u3092\u8a31\u53ef\u3057\u3066\u304a\u304f\u3088\u3046\u306b\u3002<\/p>\n\n\n\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u540d\u306f\u3001<br>ec2.1m.sh<br><br>\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u610f\u5473\u304c\u3042\u308b\u306e\u3067\u6ce8\u610f\u3002\u30001m\u306f1\u5206\u3054\u3068\u306b\u30ea\u30d5\u30ec\u30c3\u30b7\u30e5\u306e\u610f\u5473\u307f\u305f\u3044\u3002<\/p>\n\n\n\n<p>chmod +x ec2.1m.sh<\/p>\n\n\n\n<p>\u3067\u5b9f\u884c\u6a29\u9650\u3092\u4e0e\u3048\u308b\u3002<\/p>\n\n\n\n<p>\u4e2d\u8eab\u306f\u3001<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>#!\/bin\/bash\nINSTANCE_ID=&quot;i-xxxxxxxxxxx&quot;\nREGION=&quot;ap-northeast-1&quot;\nSTATUS=$(aws ec2 describe-instances \\\n  --region $REGION \\\n  --instance-ids $INSTANCE_ID \\\n  --query &quot;Reservations[].Instances[].State.Name&quot; \\\n  --output text | tr -d &#39;\\r\\n\\t&#39;)\ncase &quot;$STATUS&quot; in\n  running)\n    echo &quot;\ud83d\udfe2 Running&quot;\n    ;;\n  stopped)\n    echo &quot;\ud83d\udd34 Stopped&quot;\n    ;;\n  stopping)\n    echo &quot;\ud83d\udfe1 Stopping...&quot;\n    ;;\n  pending)\n    echo &quot;\ud83d\udfe1 Starting...&quot;\n    ;;\n  *)\n    echo &quot;\u26aa Unknown: $STATUS&quot;\n    ;;\nesac\necho &quot;---&quot;\n# ===== \u30e1\u30cb\u30e5\u30fc =====\necho &quot;Status: $STATUS&quot;\nif [[ &quot;$STATUS&quot; == &quot;running&quot; ]]; then\n  echo &quot;Stop Instance | bash=&#39;$0&#39; param1=stop terminal=false refresh=true delay=5&quot;\nelse\n  echo &quot;Start Instance | bash=&#39;$0&#39; param1=start terminal=false refresh=true delay=5&quot;\nfi\necho &quot;Refresh | refresh=true&quot;\n# ===== \u30a2\u30af\u30b7\u30e7\u30f3 =====\nif [[ &quot;$1&quot; == &quot;stop&quot; ]]; then\n  aws ec2 stop-instances --region $REGION --instance-ids $INSTANCE_ID \nelif [[ &quot;$1&quot; == &quot;start&quot; ]]; then\n  aws ec2 start-instances --region $REGION --instance-ids $INSTANCE_ID\nfi<\/code><\/pre><\/div>\n\n\n\n<h2>\u8ffd\u8a18<\/h2>\n\n\n\n<p>\uff12\u53f0\u76ee\u306eMacBook AIR\u306b\u3082\u3044\u308c\u305f\u3089\u3001\u52d5\u304b\u306a\u304f\u3066\u3000Unknown \u306b\u306a\u3063\u305f\u3002<br>\u3053\u308c\u306f\u74b0\u5883\u306e\u5dee\u3089\u3057\u3044\u3002<br><br>\u305d\u306e\u6642\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30c8\u30c3\u30d7\u306b\u3053\u308c\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>export PATH=&quot;\/opt\/homebrew\/bin:\/usr\/local\/bin:\/usr\/bin:\/bin&quot;\nexport AWS_PROFILE=default\nexport AWS_DEFAULT_REGION=ap-northeast-1<\/code><\/pre><\/div>\n\n\n\n<p><br>\u3053\u308c\u3067\u3001Mac\u306e\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u53ef\u80fd\u306b\u306a\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3064\u3044\u3067\u306b\u3001AWS\u306e\u8d77\u52d5\u505c\u6b62\u3092Mac\u306e\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc\u304b\u3089\u884c\u3046\u3002 AWS\u3067VPN\u3092\u69cb\u6210\u3057\u3066\u4f7f\u3063\u3066\u3044\u308b\u3093\u3060\u3051\u3069\u3001\u4f7f\u3063\u3066\u3044\u306a\u3044\u6642\u306f\u6b62\u3081\u3066\u304a\u304d\u305f\u3044\u3002 10\u5206\u4f7f\u3063\u3066\u306a\u3044\u3068\u81ea\u52d5\u7684\u306b\u6b62\u3081\u308b\u51e6\u7406\u5165\u308c\u3066\u3044\u308b\u3093\u3060\u3051\u3069\u3001VPN\u3092\u4f7f\u3046\u6642\u306f\u7a3c\u50cd\u3055\u305b\u305f\u3044\u3002 \u305d\u3053\u3067\u3001Mac\u3067\u3001VPN\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u7a3c\u50cd\u72b6\u6cc1\u3092\u898b\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u3068\u540c\u6642\u306b\u3001\u8d77\u52d5\u505c\u6b62\u3092\u884c\u3048\u308b\u3088\u3046\u306b\u3057\u305f\u3002 \u307e\u305a\u306f\u3001AWS CLI\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb aws configure\u3092\u3059\u308b\u3068\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3068\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u3092\u805e\u304b\u308c\u308b\u3002 \u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u306f\u3001IAM\u3067\u3001\u30e6\u30fc\u30b6.. <a href=\"https:\/\/kitayama.jp\/?p=657\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/kitayama.jp\/index.php?rest_route=\/wp\/v2\/posts\/657"}],"collection":[{"href":"https:\/\/kitayama.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kitayama.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kitayama.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kitayama.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=657"}],"version-history":[{"count":14,"href":"https:\/\/kitayama.jp\/index.php?rest_route=\/wp\/v2\/posts\/657\/revisions"}],"predecessor-version":[{"id":678,"href":"https:\/\/kitayama.jp\/index.php?rest_route=\/wp\/v2\/posts\/657\/revisions\/678"}],"wp:attachment":[{"href":"https:\/\/kitayama.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kitayama.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kitayama.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}