The Web App is very simple python web server that works as a shared file server, for internal employees for example. It allows to upload and download files to/from S3. For downloads the Web App keeps a local file in the instance where Web App is running, prefixing the file with “localfile-”.
Our instance has a role with a policy attached to it that allow to read/write from S3.
pwd
to check Home Directory
sudo easy_install pip==20.3.4
3. Execute the below command to check Pip version.
pip3 --version
4. Execute the below command to create the folder to work and install boto3 library in it
sudo mkdir SampleWebApp
5. Execute the below command to install boto3 library
sudo pip install boto3
6. Execute the below command to access folder SampleWebApp then download the template of Web App
cd SampleWebApp/
sudo wget https://raw.githubusercontent.com/aws-samples/aws-kms-workshop/master/WebApp.py
7. Execute the below command to check the connection and get the Public IP of the Instance
sudo curl http://169.254.169.254/latest/meta-data/public-ipv4/
8. Execute the below command to run Web server
sudo curl http://169.254.169.254/latest/meta-data/public-ipv4/
9. Add a Security Group allow HTTP traffic into KMSWorkshop-Instance .
KMSWorkshopGroup
.KMSWorkshopGroup
.
KMSWorkshop-AdditionalPermissions
into the search bar