{"id":1283,"date":"2021-03-05T20:21:27","date_gmt":"2021-03-05T11:21:27","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/?p=1283"},"modified":"2021-06-06T18:12:37","modified_gmt":"2021-06-06T09:12:37","slug":"how-to-use-systems-manager-automation","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2021\/03\/05\/how-to-use-systems-manager-automation\/","title":{"rendered":"\u5b9f\u8df5\u30fbSystems Manager Automation\u301c\u300cEC2\u306e\u7acb\u3061\u4e0a\u3052\u304b\u3089DNS\u30ec\u30b3\u30fc\u30c9\u767b\u9332\u307e\u3067\u300d\u3092\u81ea\u52d5\u3067\u301c"},"content":{"rendered":"
\u897f\u85e4\u3067\u3059\u3002<\/p>\n
\u7686\u3055\u3093\u306fEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f7f\u3063\u3066\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u30fb\u691c\u8a3c\u3092\u3059\u308b\u3068\u304d\u3001\u52d5\u4f5c\u78ba\u8a8d\u306f\u3069\u306e\u3088\u3046\u306b\u884c\u306a\u3063\u3066\u3044\u307e\u3059\u304b\uff1f<\/p>\n
\u500b\u4eba\u7528\u9014\u3067\u3001CI\/CD\u3082\u7d44\u307e\u306a\u3044\u3001\u3068\u3066\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u69cb\u6210\u3067\u3042\u308c\u3070\u3001<\/p>\n
\u3068\u3044\u3046\u5177\u5408\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n
\u3057\u304b\u3057\u3001\u3053\u308c\u3060\u3068EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8d77\u52d5\u306e\u305f\u3073\u306bDNS\u30ec\u30b3\u30fc\u30c9\u306e\u66f4\u65b0\u306e\u624b\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u624b\u9593\u3092\u7701\u304f\u305f\u3081\u306b\"ElasticIP\"\u3092\u5229\u7528\u3057\u3066\u3001IP\u30a2\u30c9\u30ec\u30b9\u306e\u56fa\u5b9a\u3092\u884c\u306a\u3063\u3066\u3082\u3001\u305d\u308c\u81ea\u4f53\u306bAWS\u5229\u7528\u6599\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n
\u305d\u3053\u3067\u3001\u4eca\u56de\u306f\u3001AWS Systems Manager Automation\u306e\u4ed5\u7d44\u307f\u3092\u4f7f\u3063\u3066\u3001<\/p>\n
\u3092\u81ea\u52d5\u5316\u3057\u3066\u3001\u5229\u7528\u6599\u3092\u7bc0\u7d04\u3057\u306a\u304c\u3089\u3001\u904b\u7528\u4e0a\u306e\u624b\u9593\u3082\u7701\u3044\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n
\u6e96\u5099\u65b9\u6cd5\u306f\u5272\u611b\u3057\u307e\u3059\u304c\u3001\u307e\u305a\u306f\u3001\u5192\u982d\u306b\u89e6\u308c\u305f\u3088\u3046\u306b\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3044\u305f\u3044\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u304c\u7a3c\u50cd\u3057\u3066\u3044\u308bEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u6e96\u5099\u3057\u307e\u3059\u3002
\n\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5185\u306bApache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001\u7c21\u6613\u7684\u306a\u30da\u30fc\u30b8\u3092\u8868\u793a\u3055\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n
EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8a73\u7d30\u753b\u9762\u3092\u898b\u308b\u3068\u300c\u30d1\u30d6\u30ea\u30c3\u30afIPv4\u30a2\u30c9\u30ec\u30b9\u300d\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002
\n
\n\u3053\u306eIP\u30a2\u30c9\u30ec\u30b9\u3078\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068
\n
\n\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n
\u305d\u3057\u3066\u3001Route53\u306e\u30ec\u30b3\u30fc\u30c9\u8a2d\u5b9a\u753b\u9762\u3067\u3001\u3053\u306e DNS\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u305f\u5f8c\u8a72\u5f53\u306e\u30c9\u30e1\u30a4\u30f3\u540d\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb \u4ee5\u4e0a\u3067\u6e96\u5099\u304c\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n \u3053\u306e\u5f8c\u3001\u4e00\u5ea6\u3067\u3082EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u505c\u6b62\u3057\u307e\u3046\u3068\u3001\u4eca\u5ea6\u8d77\u52d5\u3057\u305f\u6642\u306b\u306f\u5148\u307b\u3069\u3068\u540c\u3058 \u305d\u306e\u305f\u3081\u3001DNS\u30ec\u30b3\u30fc\u30c9\u306e\u518d\u8a2d\u5b9a\u3084ElasticIP\u3067\u306eIP\u30a2\u30c9\u30ec\u30b9\u56fa\u5b9a\u5316\u304c\u901a\u5e38\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n \u305d\u308c\u3089\u306e\u624b\u9593\u3092\u7701\u304f\u305f\u3081\u306e\u6b21\u306e\u3088\u3046\u306b\u81ea\u52d5\u5316\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n \u307e\u305a\u306f\u5f8c\u8ff0\u3059\u308bSystems Manager\u3067\u4f7f\u7528\u3059\u308b\u305f\u3081\u306eIAM\u30ed\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n \u300cAWS\u30b5\u30fc\u30d3\u30b9\u7528\u300d\u3067\"Systems Manager\"\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002 \u305d\u3057\u3066\u3001EC2\u7528\u306e\u6a29\u9650\u3068Route53\u7528\u306e\u6a29\u9650\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 \u4eca\u56de\u306e\u81ea\u52d5\u5316\u3092\u884c\u3046\u4ed5\u7d44\u307f\u3068\u3057\u3066\u306fAWS Systems Manager\u306e\"Automation\"\u306e\u4ed5\u7d44\u307f\u3092\u5229\u7528\u3057\u307e\u3059\u3002 \u307e\u305a\u3001AWS Systems Manager\u306e\u753b\u9762\u3088\u308a\u300c\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u300d\u306e\u753b\u9762\u3092\u958b\u304d\u307e\u3059\u3002 \u305d\u3057\u3066\u3001\u4eca\u56de\u306f \"Automation\"\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u305f\u3044\u306e\u3067\u3001\u300c\u30aa\u30fc\u30c8\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u300d\u3092\u30af\u30ea\u30c3\u30af \u4eca\u56de\u306f\u300c\u30d3\u30eb\u30c0\u30fc\u300d\u753b\u9762\u3067\u306f\u306a\u304f\u3001yml\u3092\u5165\u529b\u3059\u308b\u306e\u3067\u300c\u30a8\u30c7\u30a3\u30bf\u300d\u306e\u753b\u9762\u3092\u9078\u629e\u3057\u3001\u6b21\u306e\u5185\u5bb9\u3092\u5165\u529b\u6b04\u306b\u53cd\u6620\u3057\u3066\u304f\u3060\u3055\u3044\u3002 <\/p>\n \u4f5c\u6210\u3067\u304d\u305f\u3089\u3001Systems Manager\u306e\u300c\u81ea\u5df1\u6240\u6709\u300d\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3068\u3057\u3066\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002 \u3059\u308b\u3068\u3001\u3053\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u6982\u8981\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 \u300c\u3053\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u3069\u3046\u3044\u3046\u3082\u306e\u3067\u3042\u308b\u304b\u306e\u8aac\u660e\u300d\u3084\u300c\u5404\u30b9\u30c6\u30c3\u30d7\u6bce\u306b\u4f55\u304c\u884c\u308f\u308c\u308b\u306e\u304b\u300d\u306a\u3069\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3068\u3044\u3046\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u3053\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u300c\u30aa\u30fc\u30c8\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u300d\u3092\u9078\u3073\u307e\u3059\u3002 \u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n \u305d\u3057\u3066\u3001\u5165\u529b\u3092\u7d42\u3048\u305f\u3089 \u5165\u529b\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6b04\u3067\u5165\u529b\u3055\u308c\u305f\u5185\u5bb9\u3092\u542b\u3093\u3060\u5f62\u3067\u306eURL\u3068\u3001AWS CLI\u3067\u306e\u5b9f\u884c\u30b3\u30de\u30f3\u30c9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002 \u4e0a\u8a18\u307e\u3067\u306e\u6e96\u5099\u304c\u3067\u304d\u305f\u3089\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u753b\u9762\u4e0a\u306e\u300c\u5b9f\u884c\u300d\u3092\u62bc\u3057\u307e\u3059\u3002 \u3059\u308b\u3068\u3001\u30b9\u30c6\u30c3\u30d7\u306e\u9032\u884c\u72b6\u6cc1\u304c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002 \u3067\u306f\u3001\u3061\u3083\u3093\u3068\u6a5f\u80fd\u3057\u305f\u306e\u304b\u305d\u308c\u305e\u308c\u306e\u8a2d\u5b9a\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046 \u3067\u306f\u3001Route53\u306e\u8a72\u5f53\u306eDNS\u30ec\u30b3\u30fc\u30c9\u3092\u898b\u3066\u307f\u307e\u3059\u3068\u30fb\u30fb\u30fb\u30fb \u306a\u306e\u3067\u3001\u5192\u982d\u306b\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u3092\u8868\u793a\u3055\u305b\u3066\u3044\u305f\u30c9\u30e1\u30a4\u30f3\u540d\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306eIP\u30a2\u30c9\u30ec\u30b9\u304c\u5909\u308f\u3063\u3066\u3044\u3066\u3082\u540c\u3058\u3088\u3046\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3057\u305f\uff01<\/p>\n \u4ee5\u4e0a\u306e\u8a2d\u5b9a\u306b\u3088\u308a\u3001ElasticIP\u30a2\u30c9\u30ec\u30b9\u306e\u56fa\u5b9a\u8cbb\u7528\u3082\u304b\u304b\u3089\u305a\u3001EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8d77\u52d5\u306e\u305f\u3073\u5fc5\u8981\u3060\u3063\u305fDNS\u30ec\u30b3\u30fc\u30c9\u306e\u8a2d\u5b9a\u304b\u3089\u3082\u89e3\u653e\u3055\u308c\u305f\u308f\u3051\u3067\u3059\u3002<\/p>\n Systems Manager\u306f\u4eca\u56de\u306e\"Automation\"\u3092\u542b\u3081\u3066AWS\u5185\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u904b\u7528\u3059\u308b\u969b\u306e\u81ea\u52d5\u5316\u306b\u3068\u3066\u3082\u4fbf\u5229\u306a\u6a5f\u80fd\u304c\u8a70\u307e\u3063\u3066\u3044\u307e\u3059\u3002 \u4eca\u56de\u306f\u3068\u3066\u3082\u5177\u4f53\u7684\u306a\u3001\u7d30\u304b\u3044\u30b1\u30fc\u30b9\u3067\u3057\u305f\u304c\u3001\u4f55\u304b\u904b\u7528\u81ea\u52d5\u5316\u306e\u30d2\u30f3\u30c8\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u306f\u3058\u3081\u306b \u897f\u85e4\u3067\u3059\u3002 \u7686\u3055\u3093\u306fEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f7f\u3063\u3066\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u30fb\u691c\u8a3c\u3092\u3059\u308b\u3068\u304d\u3001\u52d5\u4f5c\u78ba\u8a8d\u306f\u3069\u306e\u3088\u3046\u306b\u884c\u306a\u3063\u3066\u3044\u307e\u3059\u304b\uff1f \u500b\u4eba\u7528\u9014\u3067\u3001CI\/CD\u3082\u7d44\u307e\u306a\u3044\u3001\u3068\u3066\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u69cb\u6210\u3067\u3042\u308c\u3070\u3001 EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u7acb\u3061\u4e0a\u3052\u308b \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5185\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u88c5\u3059\u308b \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30d1\u30d6\u30ea\u30c3\u30afIP\u3068\u7d10\u4ed8\u3051\u3066DNS\u30ec\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u30c9\u30e1\u30a4\u30f3\u540d\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b \u3068\u3044\u3046\u5177\u5408\u3067\u306f\u306a\u3044\u3067\u3057\u3087 […]<\/p>\n","protected":false},"author":6,"featured_media":1313,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[344,404],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/1283"}],"collection":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/comments?post=1283"}],"version-history":[{"count":12,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/1283\/revisions"}],"predecessor-version":[{"id":1600,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/1283\/revisions\/1600"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/media\/1313"}],"wp:attachment":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/media?parent=1283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/categories?post=1283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/tags?post=1283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}52.xxx.xxx.xxx<\/code> \u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u30bf\u30fc\u30b2\u30c3\u30c8\u306bDNS\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u3001\u30c9\u30e1\u30a4\u30f3\u540d\u30d9\u30fc\u30b9\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002
\n<\/p>\n
\n
\n\u5148\u307b\u3069\u540c\u3058\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n52.xxx.xxx.xxx<\/code> \u306b\u306a\u308b\u3053\u3068\u304c\u78ba\u7d04\u3055\u308c\u305a\u3001\u7570\u306a\u308bIP\u30a2\u30c9\u30ec\u30b9\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u305d\u306e\u969b\u306b\u306f\u4eca\u306eDNS\u540d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3082\u63a5\u7d9a\u304c\u3067\u304d\u306a\u3044\u308f\u3051\u3067\u3059\u3002<\/p>\n
IAM\u30ed\u30fc\u30eb\u306e\u4f5c\u6210<\/h2>\n
\n<\/p>\n
\n\uff08\u4eca\u56de\u306f FullAccess<\/code>\u3067\u5272\u308a\u5f53\u3066\u3066\u3057\u307e\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u904b\u7528\u6642\u306b\u306f\u9069\u5207\u306a\u7c92\u5ea6\u3067\u6700\u4f4e\u9650\u306e\u6a29\u9650\u306e\u307f\u3092\u4ed8\u4e0e\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff09
\n
\n
\n\u5165\u529b\u3092\u7d42\u3048\u305f\u3089\u4f5c\u6210\u3057\u307e\u3059\u3002
\n
\n\u4f5c\u6210\u304c\u5b8c\u4e86\u3057\u305f\u3089\u305d\u306eIAM\u30ed\u30fc\u30eb\u306e\u300c\u30ed\u30fc\u30ebARN\u300d\u3092\u63a7\u3048\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n
\nIAM\u30ed\u30fc\u30eb\u306e\u8a2d\u5b9a\u306f\u5b8c\u4e86\u3067\u3059\u3002
\n\u305d\u3057\u3066\u3001\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306b\u9032\u3093\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\nSystems Manager\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u8a2d\u5b9a<\/h2>\n
\n\u3053\u308c\u306fAWS\u4e0a\u306b\u304a\u3051\u308b\u8a2d\u5b9a\u64cd\u4f5c\u306a\u3069\u3092\u3042\u3089\u304b\u3058\u3081\u5b9a\u7fa9\u3055\u308c\u305f\u624b\u9806\uff08\u300c\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u300d\uff09\u306b\u57fa\u3065\u3044\u3066\u3001\u81ea\u52d5\u5316\u3059\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n
\n<\/p>\n
\n
\n\u3059\u308b\u3068\u3001\u7de8\u96c6\u753b\u9762\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n
\n\u3053\u308c\u306f\u300c\u30d3\u30eb\u30c0\u30fc\u300d\u306e\u753b\u9762\u3067Automation\u306e\u52d5\u4f5c\u3092\u30b9\u30c6\u30c3\u30d7\u6bce\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u306a\u3069\u3092\u9078\u629e\u3057\u3066\u3044\u304d\u306a\u304c\u3089\u7de8\u96c6\u3057\u3066\u3044\u304f\u3082\u306e\u3068\u306a\u308a\u307e\u3059\u3002
\n\u5fc5\u8981\u9805\u76ee\u3092\u57cb\u3081\u3066\u3044\u3051\u3070\u3001yml\u30d9\u30fc\u30b9\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u5b8c\u6210\u3057\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5171\u6709\u3057\u3084\u3059\u304f\u306a\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n
\n\u305d\u306e\u969b\u306e\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f assumeRole<\/code> \u306e\u90e8\u5206\u306b\u5148\u307b\u3069\u4f5c\u6210\u3057\u305fIAM\u30ed\u30fc\u30eb\u306e\u300c\u30ed\u30fc\u30ebARN\u300d\u3092\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n
description: Start EC2 And Set Dns Record Of Instance IP Without EIP\nschemaVersion: \"0.3\"\nassumeRole: <\u30ed\u30fc\u30ebARN\u306e\u5185\u5bb9\u3092\u3053\u3053\u306b\u8a18\u8f09>\nparameters:\n InstanceID:\n type: StringList\n description: (Required) Target EC2 Instance to start.\n HostedZoneID:\n type: String\n description: (Required) Route53 Hosted Zone ID to add DNS Record in.\n DomainName:\n type: String\n description: (Required) DNS Record Name to add.\nmainSteps:\n - name: StartEC2\n action: \"aws:changeInstanceState\"\n inputs:\n InstanceIds: \"{{InstanceID}}\"\n DesiredState: running\n CheckStateOnly: false\n - name: GetEC2InstanceIP\n action: \"aws:executeAwsApi\"\n inputs:\n Service: ec2\n Api: DescribeInstances\n InstanceIds: \"{{InstanceID}}\"\n outputs:\n - Selector: \"$.Reservations[0].Instances[0].PublicIpAddress\"\n Type: String\n Name: IP\n - name: AddRoute53Record\n action: \"aws:executeScript\"\n inputs:\n Runtime: python3.7\n Handler: script_handler\n Script: |-\n import boto3\n import json\n\n def script_handler(events, context):\n\n IP = events[\"IP\"]\n HostedZoneID = events[\"HostedZoneID\"]\n DomainName = events[\"DomainName\"]\n\n client = boto3.client(\"route53\")\n\n response = client.change_resource_record_sets(\n HostedZoneId=HostedZoneID,\n ChangeBatch={\n \"Changes\": [\n {\n \"Action\": \"UPSERT\",\n \"ResourceRecordSet\": {\n \"Name\": DomainName,\n \"Type\": \"A\",\n \"TTL\": 300,\n \"ResourceRecords\": [\n {\"Value\": IP},\n ],\n },\n },\n ]\n },\n )\n print(response)\n InputPayload:\n IP: \"{{GetEC2InstanceIP.IP}}\"\n HostedZoneID: \"{{HostedZoneID}}\"\n DomainName: \"{{DomainName}}\"<\/code><\/pre>\n
Systems Manager\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u5b9f\u884c\u65b9\u6cd5<\/h2>\n
\n\u4f5c\u6210\u3057\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u958b\u3044\u3066\u307f\u307e\u3059\u3002
\n<\/p>\n
\n<\/p>\n
\n\u4eca\u56de\u306e\u5834\u5408\u306f\u3001<\/p>\n\n
\n\u3053\u308c\u306b\u3088\u308a\u3001EC2\u306e\u8d77\u52d5\u304b\u3089DNS\u306e\u66f8\u304d\u63db\u3048\u307e\u3067\u304c\u81ea\u52d5\u5316\u3055\u308c\u308b\u306e\u3067\u3001\u3053\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3059\u308c\u3070\u3001EC2\u306e\u8d77\u52d5\u3092\u542b\u3081\u305f\u5404AWS\u64cd\u4f5c\u3092\u884c\u306a\u3063\u3066\u304f\u308c\u308b\u306e\u3067\u3059\u3002<\/p>\n
\n
\n\u3059\u308b\u3068\u5b9f\u884c\u306e\u305f\u3081\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u9078\u629e\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002
\n\u5b9f\u884c\u65b9\u6cd5\u306f\u300c\u30b7\u30f3\u30d7\u30eb\u306a\u5b9f\u884c\u300d\u3092\u9078\u3073\u3001
\n\u5165\u529b\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u3068\u3053\u308d\u3067<\/p>\n\n
\n\u300cAWS CLI\u30b3\u30de\u30f3\u30c9\u3068\u5171\u6709\u53ef\u80fd\u306a\u5b9f\u884c\u30ea\u30f3\u30af\u300d\u306e\u6b04\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002
\n<\/p>\n
\n\u305d\u306e\u305f\u3081\u3001\u3053\u306eURL\u3092\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3057\u3066\u304a\u3051\u3070\u3001\u4eca\u5f8c\u518d\u5ea6\u5b9f\u884c\u3059\u308b\u6642\u306b\u306f\u5165\u529b\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u306a\u304f\u5b9f\u884c\u753b\u9762\u307e\u3067\u9032\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002AWS CLI\u3067\u3042\u308c\u3070\u5b9f\u884c\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u304f\u3060\u3051\u3067\u540c\u3058\u51e6\u7406\u304c\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\nSystems Manager\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u5b9f\u884c\u7d50\u679c<\/h2>\n
\n\uff08\u306a\u304a\u3001\u691c\u8a3c\u306e\u305f\u3081\u3001\u3042\u3089\u304b\u3058\u3081EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306f\u505c\u6b62\u3057\u3066\u304a\u304d\u307e\u3059\u3002\uff09
\n<\/p>\n
\n
\n\u307e\u305a\u521d\u3081\u306fEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8d77\u52d5\u3067\u3059\u3002<\/p>\n
\n\u6b21\u306b\u3001\u8d77\u52d5\u3057\u305fEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306eIP\u30a2\u30c9\u30ec\u30b9\u304c\u53d6\u5f97\u3055\u308c\u3066\u30fb\u30fb\u30fb
\n
\n\u6700\u5f8c\u306bRoute53\u3067\u306eDNS\u30ec\u30b3\u30fc\u30c9\u304c\u66f8\u304d\u63db\u3048\u3089\u308c\u3066\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n
\n\u307e\u305a\u3001EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306f\u6b21\u306e\u901a\u308a
\n
\n\u81ea\u52d5\u7684\u306bEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306f\u8d77\u52d5\u3055\u308c\u3066\u304a\u308a\u3001\u300c\u30d1\u30d6\u30ea\u30c3\u30afIPv4\u30a2\u30c9\u30ec\u30b9\u300d\u306b\u306f\u65b0\u3057\u3044\u5024\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u307e\u3059\u3002
\nRoute53\u3067\u306f\u3053\u306eIP\u30a2\u30c9\u30ec\u30b9\u3067DNS\u30ec\u30b3\u30fc\u30c9\u304c\u81ea\u52d5\u7684\u306b\u4f5c\u3089\u308c\u3066\u3044\u308b\u3068\u5b09\u3057\u3044\u308f\u3051\u3067\u3059\u3002<\/p>\n
\n
\n\u5148\u307b\u3069\u306e 52.xxx.xxx.xxx<\/code> \u3067\u306f\u306a\u304f\u3001\u4eca\u56deEC2\u304c\u8d77\u52d5\u3057\u3066\u304b\u3089\u65b0\u305f\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f
54.xxx.xxx.xxx<\/code>\u304c\u53cd\u6620\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n
\n<\/p>\n\u307e\u3068\u3081<\/h2>\n
\n\u5f15\u304d\u7d9a\u304dSystems Manager\u306b\u89e6\u308c\u3066\u3044\u304d\u3001\u904b\u7528\u306e\u81ea\u52d5\u5316\u306b\u3082\u5f79\u7acb\u3066\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n