Enter a name for the projectと問われるのですが、入力値はなしでそのままEnterを押します。
プロジェクト名にはreactamplifiedのデフォルトが表示され、以下のようにAmplifyの設定が表示されます。 Initialize the project with the above configurationとこの設定のまますすめるかを問われるのでyで進めていきます。
$amplifyinitNote:Itisrecommendedtorunthiscommandfromtherootofyourappdirectory? Enter a name for the project reactamplifiedThefollowingconfigurationwillbeapplied:Projectinformation|Name:reactamplified|Environment:dev|Defaulteditor:VisualStudioCode|Apptype:javascript|Javascriptframework:react|SourceDirectoryPath:src|DistributionDirectoryPath:build|BuildCommand:npmrun-scriptbuild|StartCommand:npmrun-scriptstart? Initialize the project with the above configuration? (Y/n) y
? Initialize the project with the above configuration? YesUsingdefaultproviderawscloudformation? Select the authentication method you want to use: (Usearrowkeys)❯AWSprofileAWSaccesskeys
? Initialize the project with the above configuration? YesUsingdefaultproviderawscloudformation? Select the authentication method you want to use: AWS profileFormoreinformationonAWSProfiles,see:https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html? Please choose the profile you want to use (Usearrowkeys)❯default
必要なAWSリソースとリソースを管理するCloudFormationが作成されていきます。
Adding backend environment dev to AWS Amplify app: d1m0h4inkb766a
Deployment completed.
Deployed root stack reactamplified [ ======================================== ] 4/4
amplify-reactamplified-dev-64… AWS::CloudFormation::Stack CREATE_COMPLETE Sat Nov 26 2022 06:49:37…
AuthRole AWS::IAM::Role CREATE_COMPLETE Sat Nov 26 2022 06:49:35…
UnauthRole AWS::IAM::Role CREATE_COMPLETE Sat Nov 26 2022 06:49:35…
DeploymentBucket AWS::S3::Bucket CREATE_COMPLETE Sat Nov 26 2022 06:49:29…
? Help improve Amplify CLI by sharing non sensitive configurations on failures (y/N) ‣
最後にHelp improve Amplify CLI by sharing non sensitive configurations on failuresとAmplifyCLIに何かあったときに情報共有をするか問われますが、デフォルトのNのままで進めます。
✔HelpimproveAmplifyCLIbysharingnonsensitiveconfigurationsonfailures (y/N) · noDeploymentbucketfetched.✔Initializedprovidersuccessfully.✅Initializedyourenvironmentsuccessfully.Yourprojecthasbeensuccessfullyinitializedandconnectedtothecloud!Somenextsteps:"amplify status"willshowyouwhatyou've added already and if it'slocallyconfiguredordeployed"amplify add <category>"willallowyoutoaddfeatureslikeuserloginorabackendAPI"amplify push"willbuildallyourlocalbackendresourcesandprovisionitinthecloud"amplify console"toopentheAmplifyConsoleandviewyourprojectstatus"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud
Protip:Try"amplify add api"tocreateabackendAPIandthen"amplify push"todeployeverything
import ReactDOM from'react-dom/client';import'./index.css';import App from'./App';import reportWebVitals from'./reportWebVitals';import { Amplify } from'aws-amplify';import awsExports from'./aws-exports';Amplify.configure(awsExports);constroot=ReactDOM.createRoot(document.getElementById('root'));root.render( <React.StrictMode> <App /> </React.StrictMode>);// If you want to start measuring performance in your app, pass a function// to log results (for example: reportWebVitals(console.log))// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitalsreportWebVitals();