Preparation
Before doing the main content of this workshop, we prepare the SAM project and download the front-end source to your machine.
- Download theh below source code of SAM project
fcjdmssam.zip
(2366 ko)
- Run the following command
sam build
sam deploy --guided
- Enter the following content:
- Stack Name []:
fcjdmssam
- AWS Region []:
ap-southeast-1
- Confirm changes before deploy [Y/n]:
y
- Allow SAM CLI IAM role creation [Y/n]:
y
- Disable rollback [y/N]:
n
- DocsList may not have authorization defined, Is this okay? [y/N]:
y
- DocsUpload may not have authorization defined, Is this okay? [y/N]:
y
- DocsDelete may not have authorization defined, Is this okay? [y/N]:
y
- GeneralInforUpload may not have authorization defined, Is this okay? [y/N]:
y
- GeneralInforGet may not have authorization defined, Is this okay? [y/N]:
y
- Save arguments to configuration file [Y/n]:
y
-
Open the CloudFormation console
-
Select Stacks on the left menu and select the stack you just created.

- Select Outputs tab, write down the API URL

- If you have not downloaded the source code of the application, run the following commands:
git clone https://github.com/AWS-First-Cloud-Journey/FCJ-Serverless-DMS.git
cd FCJ-Serverless-DMS
npm install
- Open the src/constant.js file and replace the value of APP_API_URL with the URL you just wrote down

- Run the command
amplify init
to initialize a new Amplify project. Answer the questions with the following list:
- Enter a name for the project (
FCJServerlessDMS
)
- Initialize the project with the above configuration? (Y/n) (
Yes
)
- Select the authentication method you want to use: (AWS profile)
- Please choose the profile you want to use (default)
- Help improve Amplify CLI by sharing non sensitive configurations on failures (y/N) (N)`
- Run the command
amplify import auth
to import the Amazon Cognito resource we created into the project. Answer the questions with the following list:
- What type of auth resource do you want to import? · (Cognito User Pool and Identity Pool)
- Select the User Pool you want to import: (cognito-fcj-dms)
- Run the command
amplify import storage
to import the bucket we created into the project. Answer the questions with the following list:
- Select from one of the below mentioned services: (S3 bucket - Content (Images, audio, video, etc.))
- Select the S3 Bucket you want to import: · (fcjdmsstore)
- Run the command
amplify push
to update the cloud resources.
- Run the following command to build and upload the build directory to the S3 bucket:
yarn build
aws s3 cp build s3://fcjdmswebstore --recursive
We have prepared the necessary source for the next steps.