{"id":3865,"date":"2020-12-28T00:44:04","date_gmt":"2020-12-27T15:44:04","guid":{"rendered":"https:\/\/tech.akat.info\/?p=3865"},"modified":"2020-12-28T00:44:04","modified_gmt":"2020-12-27T15:44:04","slug":"aws-amplify-cli%e3%82%92%e5%88%a9%e7%94%a8%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=3865","title":{"rendered":"AWS Amplify CLI\u3092\u5229\u7528\u3057\u3066\u307f\u305f"},"content":{"rendered":"<h2>node\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p><a href=\"https:\/\/qiita.com\/seibe\/items\/36cef7df85fe2cefa3ea\"><\/a>\u3092\u53c2\u8003\u306bnode\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# cat \/etc\/lsb-release\r\nDISTRIB_ID=Ubuntu\r\nDISTRIB_RELEASE=18.04\r\nDISTRIB_CODENAME=bionic\r\nDISTRIB_DESCRIPTION=&quot;Ubuntu 18.04.5 LTS&quot;\r\n\r\n# apt install -y nodejs npm\r\n# npm install n -g\r\n# n stable\r\n# apt purge -y nodejs npm\r\n# exec $SHELL -l\r\n# node -v\r\nv14.15.3\r\n<\/pre>\n<h2>Amplify CLI\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p><a href=\"https:\/\/qiita.com\/Junpei_Takagi\/items\/f2bc567761880471fd54\">AWS Amplify CLI\u306e\u4f7f\u3044\u65b9\u301c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304b\u3089\u521d\u671f\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u307e\u3067\u301c<\/a>\u3092\u53c2\u8003\u306b\u3001amplify\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# npm install -g @aws-amplify\/cli\r\n...\r\n----------------------------------------\r\nSuccessfully installed the Amplify CLI\r\n----------------------------------------\r\n...\r\n\r\n# amplify -v\r\nInitializing new Amplify CLI version...\r\nDone initializing new version.\r\nScanning for plugins...\r\nPlugin scan successful\r\n4.40.1\r\n<\/pre>\n<h2>Amplify CLI\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# amplify configure\r\nFollow these steps to set up access to your AWS account:\r\n\r\nSign in to your AWS administrator account:\r\nhttps:\/\/console.aws.amazon.com\/\r\nPress Enter to continue\r\n\r\nSpecify the AWS Region\r\n? region:  ap-northeast-1\r\nSpecify the username of the new IAM user:\r\n? user name:  amplify-i8W9E\r\nComplete the user creation using the AWS console\r\nhttps:\/\/console.aws.amazon.com\/iam\/home?region=ap-northeast-1#\/users$new?step=final&accessKey&userNames=amplify-i8W9E&permissionType=policies&policies=arn:aws:iam::aws:policy%2FAdministratorAccess\r\nPress Enter to continue\r\n<\/pre>\n<p>URL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001IAM\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u3066\u3001\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u306a\u3069\u3092\u5165\u529b\u3057\u305f\u3002<br \/>\n<a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-10-18_031028.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-10-18_031028-300x173.jpg\" alt=\"\" width=\"300\" height=\"173\" class=\"alignnone size-medium wp-image-3866\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-10-18_031028-300x173.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-10-18_031028-1024x592.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-10-18_031028-768x444.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-10-18_031028-1536x888.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-10-18_031028.jpg 2032w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233211.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233211-300x187.jpg\" alt=\"\" width=\"300\" height=\"187\" class=\"alignnone size-medium wp-image-3867\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233211-300x187.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233211-1024x638.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233211-768x478.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233211-1536x957.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233211.jpg 1872w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233228.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233228-300x186.jpg\" alt=\"\" width=\"300\" height=\"186\" class=\"alignnone size-medium wp-image-3868\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233228-300x186.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233228-1024x636.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233228-768x477.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233228-1536x954.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233228.jpg 2007w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nEnter the access key of the newly created user:\r\n? accessKeyId:  ********************\r\n? secretAccessKey:  ****************************************\r\nThis would update\/create the AWS Profile in your local machine\r\n? Profile Name:  amplify\r\n\r\nSuccessfully set up the new user.\r\n<\/pre>\n<p><a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233420.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233420-300x117.jpg\" alt=\"\" width=\"300\" height=\"117\" class=\"alignnone size-medium wp-image-3869\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233420-300x117.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233420-1024x399.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233420-768x299.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233420-1536x599.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-27_233420.jpg 1821w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>Amplify\u74b0\u5883\u306e\u69cb\u7bc9<\/h2>\n<p>CloudFormation\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304c\u4f5c\u6210\u3055\u308c\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# amplify init\r\nNote: It is recommended to run this command from the root of your app directory\r\n? Enter a name for the project amplifyproject\r\n? Enter a name for the environment dev\r\n? Choose your default editor: Vim (via Terminal, Mac OS only)\r\n? Choose the type of app that you're building javascript\r\nPlease tell us about your project\r\n? What javascript framework are you using none\r\n? Source Directory Path:  src\r\n? Distribution Directory Path: dist\r\n? Build Command:  npm run-script build\r\n? Start Command: npm run-script start\r\nUsing default provider  awscloudformation\r\n\r\nFor more information on AWS Profiles, see:\r\nhttps:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/cli-configure-profiles.html\r\n\r\n? Do you want to use an AWS profile? Yes\r\n? Please choose the profile you want to use amplify\r\nAdding backend environment dev to AWS Amplify Console app: d30innubtvg7pq\r\n\u2839 Initializing project in the cloud...\r\n\r\nCREATE_IN_PROGRESS UnauthRole                       AWS::IAM::Role             Mon Dec 28 2020 00:25:31 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642)\r\nCREATE_IN_PROGRESS DeploymentBucket                 AWS::S3::Bucket            Mon Dec 28 2020 00:25:31 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642)\r\nCREATE_IN_PROGRESS amplify-amplifyproject-dev-02103 AWS::CloudFormation::Stack Mon Dec 28 2020 00:25:27 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642) User Initiated\r\n\u283c Initializing project in the cloud...\r\n\r\nCREATE_IN_PROGRESS AuthRole         AWS::IAM::Role  Mon Dec 28 2020 00:25:33 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642) Resource creation Initiated\r\nCREATE_IN_PROGRESS UnauthRole       AWS::IAM::Role  Mon Dec 28 2020 00:25:33 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642) Resource creation Initiated\r\nCREATE_IN_PROGRESS DeploymentBucket AWS::S3::Bucket Mon Dec 28 2020 00:25:33 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642) Resource creation Initiated\r\nCREATE_IN_PROGRESS AuthRole         AWS::IAM::Role  Mon Dec 28 2020 00:25:32 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642)\r\n\u2819 Initializing project in the cloud...\r\n\r\nCREATE_COMPLETE AuthRole   AWS::IAM::Role Mon Dec 28 2020 00:25:51 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642)\r\nCREATE_COMPLETE UnauthRole AWS::IAM::Role Mon Dec 28 2020 00:25:51 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642)\r\n\u2838 Initializing project in the cloud...\r\n\r\nCREATE_COMPLETE amplify-amplifyproject-dev-02103 AWS::CloudFormation::Stack Mon Dec 28 2020 00:25:56 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642)\r\nCREATE_COMPLETE DeploymentBucket                 AWS::S3::Bucket            Mon Dec 28 2020 00:25:53 GMT+0900 (\u65e5\u672c\u6a19\u6e96\u6642)\r\n\u2714 Successfully created initial AWS cloud resources for deployments.\r\n\u2714 Initialized provider successfully.\r\nInitialized your environment successfully.\r\n\r\nYour project has been successfully initialized and connected to the cloud!\r\n\r\nSome next steps:\r\n&quot;amplify status&quot; will show you what you've added already and if it's locally configured or deployed\r\n&quot;amplify add &lt;category&gt;&quot; will allow you to add features like user login or a backend API\r\n&quot;amplify push&quot; will build all your local backend resources and provision it in the cloud\r\n&quot;amplify console&quot; to open the Amplify Console and view your project status\r\n&quot;amplify publish&quot; will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud\r\n\r\nPro tip:\r\nTry &quot;amplify add api&quot; to create a backend API and then &quot;amplify publish&quot; to deploy everything\r\n\r\n# amplify status\r\n\r\nCurrent Environment: dev\r\n\r\n| Category | Resource name | Operation | Provider plugin |\r\n| -------- | ------------- | --------- | --------------- |\r\n\r\n<\/pre>\n<p>IAM\u30ed\u30fc\u30eb\u3068S3\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002\u3053\u3053\u304b\u3089\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5fc5\u8981\u306a\u6a5f\u69cb\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304f\u4ed5\u7d44\u307f\u3068\u306a\u3063\u3066\u3044\u308b\u3002<br \/>\n<a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003751.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003751-300x100.jpg\" alt=\"\" width=\"300\" height=\"100\" class=\"alignnone size-medium wp-image-3870\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003751-300x100.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003751-1024x343.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003751-768x257.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003751-1536x514.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003751-2048x686.jpg 2048w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003831.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003831-300x160.jpg\" alt=\"\" width=\"300\" height=\"160\" class=\"alignnone size-medium wp-image-3871\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003831-300x160.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003831-1024x547.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003831-768x410.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003831-1536x820.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2020\/12\/2020-12-28_003831-2048x1093.jpg 2048w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>node\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u3092\u53c2\u8003\u306bnode\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002 # cat \/etc\/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[27],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/3865"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3865"}],"version-history":[{"count":1,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/3865\/revisions"}],"predecessor-version":[{"id":3872,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/3865\/revisions\/3872"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}