Trước khi thực hiện nội dung chính của workshop này, chúng ta cần thiết lập lại ứng dụng web bằng AWS SAM.
sam build
sam deploy --guided
fcjdmsapp
ap-southeast-1
y
y
n
y
y
y
y
y
Mở bảng điều khiển của AWS CloudFormation
Chọn Stacks ở menu bên trái và chọn stack fcjdmsapp. Sau đó chọn tab Outputs
Sao chép URL của API
git clone https://github.com/AWS-First-Cloud-Journey/FCJ-Serverless-DMS.git
cd FCJ-Serverless-Workshop
npm install
amplify init
Nhập theo các thông tin dưới đây:
? Enter a name for the project fcjdms
The following configuration will be applied:
Project information
| Name: fcjdms
| Environment: dev
| Default editor: Visual Studio Code
| App type: javascript
| Javascript framework: react
| Source Directory Path: src
| Distribution Directory Path: build
| Build Command: npm run-script build
| Start Command: npm 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 default
? Help improve Amplify CLI by sharing non sensitive configurations on failures (y/N) › No
amplify import auth
amplify import storage
Chọn S3 bucket - Content (Images, audio, video, etc.) cho Select from one of the below mentioned services
Chọn bucket mà bạn đã tạo từ các bước trên
Chạy câu lệnh: amplify push
để cập nhật tài nguyên cloud.
yarn build
aws s3 cp build s3://fcjdmswebstore --recursive