{"id":13277,"date":"2023-07-29T12:07:59","date_gmt":"2023-07-29T03:07:59","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=13277"},"modified":"2023-08-01T06:51:25","modified_gmt":"2023-07-31T21:51:25","slug":"aws-cloud9%e3%81%ae%e7%92%b0%e5%a2%83%e3%82%92aws-cli%e3%81%a7%e4%bd%9c%e6%88%90%ef%bc%8f%e5%89%8a%e9%99%a4%ef%bc%8f%e7%a2%ba%e8%aa%8d%e3%81%99%e3%82%8b%ef%bc%81","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/13277","title":{"rendered":"AWS Cloud9\u306e\u74b0\u5883\u3092AWS CLI\u3067\u4f5c\u6210\uff0f\u524a\u9664\uff0f\u78ba\u8a8d\u3059\u308b\uff01"},"content":{"rendered":"<p>AWS Cloud9\u306e\u74b0\u5883\u3092AWS CLI\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002AWS Cloud9\u306e\u74b0\u5883\u304b\u3089\u3001\u958b\u767a\u74b0\u5883\u3068\u3057\u3066AWS CLI\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u30b7\u30a7\u30eb\u3067\u5bb9\u6613\u306b\u74b0\u5883\u306e\u69cb\u7bc9\u304a\u3088\u3073\u524a\u9664\u3092\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>AWS Cloud9\u306e\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u30b7\u30a7\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>AWS Cloud9\u306e\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u30b7\u30a7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u74b0\u5883\u3092\u524a\u9664\u3059\u308b\u5834\u5408\u306e\u305f\u3081\u306b\u3001\u4f5c\u6210\u3057\u305f\u74b0\u5883\u306eID\u3092JSON\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u529b\u3057\u307e\u3059\u3002npm\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u305f\u3068\u304d\u306b\u3001\u30e1\u30e2\u30ea\u4e0d\u8db3\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3053\u3068\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u7a2e\u985e\u3092\u3001t2.small\u306b\u5909\u66f4\u3057\u3001AMI\u3092Amazon Linux 2\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ cat cloud9-env-create.sh\r\n#!\/bin\/bash\r\nTAG_NAME=demadm01\r\nDESC=Cloud9\r\n#INSTANCE_TYPE=t2.micro\r\nINSTANCE_TYPE=t2.small\r\n#IMAGE_ID=resolve:ssm:\/aws\/service\/cloud9\/amis\/amazonlinux-1-x86_64\r\nIMAGE_ID=resolve:ssm:\/aws\/service\/cloud9\/amis\/amazonlinux-2-x86_64\r\nREGION=ap-northeast-1\r\nCONNECTION_TYPE=CONNECT_SSM\r\nAUTOMATIC_STOP_TIME_MINUTES=30\r\nSUBNET_ID=subnet-04bb63af06feceda7\r\nOUTPUT=json\r\n\r\naws cloud9 create-environment-ec2 \\\r\n  --name ${TAG_NAME} \\\r\n  --description ${DESC} \\\r\n  --instance-type ${INSTANCE_TYPE} \\\r\n  --image-id ${IMAGE_ID} \\\r\n  --region ${REGION} \\\r\n  --connection-type ${CONNECTION_TYPE} \\\r\n  --automatic-stop-time-minutes ${AUTOMATIC_STOP_TIME_MINUTES} \\\r\n  --subnet-id ${SUBNET_ID} \\\r\n  --output ${OUTPUT} \\\r\n  | tee `basename $0 .sh`.json\r\n<\/pre>\n<h2>AWS Cloud9\u306e\u74b0\u5883\u3092\u30b7\u30a7\u30eb\u3067\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>\u5b9f\u969b\u306b\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ .\/cloud9-env-create.sh \r\n{\r\n    &quot;environmentId&quot;: &quot;7084bbb6e4704cfd9a95b5862d749f0d&quot;\r\n}\r\n<\/pre>\n<h2>AWS Cloud9\u306e\u74b0\u5883\u306e\u4f5c\u6210\u72b6\u6cc1\u3092\u78ba\u8a8d\u3059\u308b\u30b7\u30a7\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>AWS Cloud9\u306e\u74b0\u5883\u306e\u4f5c\u6210\u72b6\u6cc1\u3092\u78ba\u8a8d\u3059\u308b\u30b7\u30a7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u74b0\u5883\u3092\u4f5c\u6210\u3057\u305f\u30b7\u30a7\u30eb\u304c\u751f\u6210\u3057\u305fJSON\u30d5\u30a1\u30a4\u30eb\u3092\u5165\u529b\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ cat cloud9-env-describe.sh \r\n#!\/bin\/bash\r\nINPUT_JSON=cloud9-env-create.json\r\n\r\naws cloud9 describe-environment-status \\\r\n  --cli-input-json file:\/\/${INPUT_JSON}\r\n<\/pre>\n<h2>AWS Cloud9\u306e\u74b0\u5883\u306e\u4f5c\u6210\u72b6\u6cc1\u3092\u30b7\u30a7\u30eb\u3067\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>\u5b9f\u969b\u306b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ .\/cloud9-env-describe.sh \r\n{\r\n    &quot;status&quot;: &quot;ready&quot;,\r\n    &quot;message&quot;: &quot;Environment is ready to use.&quot;\r\n}\r\n<\/pre>\n<h2>AWS Cloud9\u306e\u74b0\u5883\u3092\u524a\u9664\u3059\u308b\u30b7\u30a7\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>AWS Cloud9\u306e\u74b0\u5883\u3092\u524a\u9664\u3059\u308b\u30b7\u30a7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u74b0\u5883\u3092\u4f5c\u6210\u3057\u305f\u30b7\u30a7\u30eb\u304c\u751f\u6210\u3057\u305fJSON\u30d5\u30a1\u30a4\u30eb\u3092\u5165\u529b\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ cat cloud9-env-delete.sh \r\n#!\/bin\/bash\r\nINPUT_JSON=cloud9-env-create.json\r\n\r\naws cloud9 delete-environment \\\r\n  --cli-input-json file:\/\/${INPUT_JSON}\r\n<\/pre>\n<h2>AWS Cloud9\u306e\u74b0\u5883\u3092\u30b7\u30a7\u30eb\u3067\u524a\u9664\u3059\u308b\uff01<\/h2>\n<p>\u5b9f\u969b\u306b\u524a\u9664\u3057\u3066\u307f\u307e\u3059\u3002\u524a\u9664\u6642\u306f\u7279\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u51fa\u529b\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ .\/cloud9-env-delete.sh \r\n<\/pre>\n<h2>AWS Cloud9\u306e\u74b0\u5883\u304c\u524a\u9664\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>\u74b0\u5883\u304c\u524a\u9664\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u524a\u9664\u4e2d\u306f\u4ee5\u4e0b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ .\/cloud9-env-describe.sh \r\n{\r\n    &quot;status&quot;: &quot;deleting&quot;,\r\n    &quot;message&quot;: &quot;The AWS CloudFormation stack associated with this environment is being deleted. Once the process is complete, your environment will no longer be available. To continue, create a new environment to generate a new stack.&quot;\r\n}\r\n<\/pre>\n<p>\u524a\u9664\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001\u78ba\u8a8d\u7528\u306e\u30b7\u30a7\u30eb\u3067\u306f\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n .\/cloud9-env-describe.sh \r\n\r\nAn error occurred (NotFoundException) when calling the DescribeEnvironmentStatus operation: Unable to find &#x5B;7084bbb6e4704cfd9a95b5862d749f0d] in database.\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>AWS Cloud9\u306e\u74b0\u5883\u3092AWS CLI\u3067\u4f5c\u6210\u3068\u524a\u9664\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u30ed\u30fc\u30ab\u30eb\u306ePC\u3067\u958b\u767a\u3067\u304d\u306a\u3044\u5834\u5408\u306b\u3001CloudShell\u304b\u3089Cloud9\u306e\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b\u3068\u3088\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u30b7\u30a7\u30eb\u306f\u3001CodeCommit\u306b\u767b\u9332\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/12112\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u3092\u64cd\u4f5c\u3059\u308b\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/04\/eyecatch_aws_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u3092\u64cd\u4f5c\u3059\u308b\uff01<\/div><div class=\"substr\">AWS\u3092\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWS Cloud9\u306e\u74b0\u5883\u3092AWS CLI\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002AWS Cloud9\u306e\u74b0\u5883\u304b\u3089\u3001\u958b\u767a\u74b0\u5883\u3068\u3057\u3066AWS CLI\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u30b7\u30a7\u30eb\u3067\u5bb9\u6613\u306b\u74b0\u5883\u306e\u69cb\u7bc9\u304a\u3088\u3073\u524a\u9664\u3092\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":8172,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[370],"tags":[288,353,840,759,761,630,673,697],"class_list":["post-13277","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-operation","tag-aws","tag-aws-cli","tag-aws-cloud9","tag-cloud9","tag-761","tag-630","tag-673","tag-697"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=13277"}],"version-history":[{"count":14,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13277\/revisions"}],"predecessor-version":[{"id":13371,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13277\/revisions\/13371"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/8172"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=13277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=13277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=13277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}