あめがえるのITブログ

頑張りすぎない。ほどほどに頑張るブログ。

AWS Amplifyアプリケーション作成(CLI)してみた(amplify init)


やること

AWS AmplifyのアプリケーションをCLIで作成する。

前提

実践!

1.AWS Amplifyアプリケーション作成
1-1.PowerShellを起動し、下記を実行

> mkdir amplify
    ディレクトリ: C:\

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        2024/05/19     20:15                amplify

> cd .\amplify\

> amplify init
Note: It is recommended to run this command from the root of your app directory
? Enter a name for the project amplify
The following configuration will be applied:

Project information
| Name: amplify
| Environment: dev
| Default editor: Visual Studio Code
| App type: javascript
| Javascript framework: none
| Source Directory Path: src
| Distribution Directory Path: dist
| Build Command: npm.cmd run-script build
| Start Command: npm.cmd run-script start

? Initialize the project with the above configuration? Yes
Using default provider  awscloudformation
? Select the authentication method you want to use: AWS profile

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

? Please choose the profile you want to use testvault
Adding backend environment dev to AWS Amplify app: d2xkmspbawol3p

Deployment completed.
Deployed root stack amplify [ ======================================== ] 4/4
        amplify-amplify-dev-97308      AWS::CloudFormation::Stack     CREATE_COMPLETE
        DeploymentBucket               AWS::S3::Bucket                CREATE_COMPLETE
        UnauthRole                     AWS::IAM::Role                 CREATE_COMPLETE
        AuthRole                       AWS::IAM::Role                 CREATE_COMPLETE

√ Help improve Amplify CLI by sharing non-sensitive project configurations on failures (y/N) · yes


    Thank you for helping us improve Amplify CLI!
Deployment state saved successfully.
√ Initialized provider successfully.
✅ Initialized your environment successfully.
✅ Your project has been successfully initialized and connected to the cloud!
Some next steps:

"amplify status" will show you what you've added already and if it's locally configured or deployed
"amplify add <category>" will allow you to add features like user login or a backend API
"amplify push" will build all your local backend resources and provision it in the cloud
"amplify console" to open the Amplify Console and view your project status
"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud


Pro tip:
Try "amplify add api" to create a backend API and then "amplify push" to deploy everything

1-2.作成確認
 1-2-1.[AWS]-[Amplify]
 1-2-2.一覧に作成したアプリケーションが表示されていること。



感想

Amplifyよくわからない。