Upload static files to S3

The last step is to configure the client code with the new Cognito application id and upload to our S3 bucket

Step-by-steps directions

Step 1: Go to your AWS Cloud9 Environment

Step 2: Make sure you are at the root folder

mkdir unicorn_manager && cd unicorn_manager

Step 3: Download static file from S3 bucket

In this workshop, we have created static files for easy-to-use. You can download it from our Github repository

git clone https://github.com/tancloudvn/UnicornManager.git

Step 4: Open js/config.js

Step 5: From the Cognito User Pools console, copy the Client app id for the UnicornManager application as the value of the userPoolClientId property.

Note: You can find the application id in the App clients menu of the Cognito console

Step 6: Change the value of the region property to the region you are using for this workshop

Step 7: Still in the Cognito User Pools console, open the Domain name page and copy the custom prefix in the value for the authDomainPrefix property.

Step 8: Finally, open the CloudFormation console and select the pre-requisites stack we created at the beginning of this lab.

window._config = {
    cognito: {
        userPoolClientId: 'YOUR_CLIENT_ID', // e.g. 25ddkmj4v6hfsfvruhpfi7n4hv
        region: 'YOUR_REGION', // e.g. us-east-2
        authDomainPrefix: 'YOUR_AUTH_DOMAIN' // wildrydes-sapessi
    },
    api: {
        invokeUrl: 'YOUR_API_ENDPOINT' // e.g. https://xxxxxxxx.execute-api.us-west-2.amazonaws.com/prod',
    }
};

Step 10: Make sure you are in the root UnicornManager folder

Step 11: Run the following command to push your static to your last-step S3 bucket Or you can complete from the S3 console

aws s3 sync . s3://YOUR_BUCKET_NAME --region YOUR_BUCKET_REGION
UploadFromConsole