Deploying a Python Flask Web Application on AWS Cloud ☁️

AWS FREE-TIER ACCOUNT

LAUNCHING AN EC2 INSTANCE

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:GetEncryptionConfiguration",
"s3:GetBucketAcl",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::dcp-685169213993-eu-west-2-logs"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"cloudwatch:PutMetricData",
"logs:DescribeLogGroups",
"logs:DescribeLogStreams",
"kms:*",
"ssm:*",
"ec2messages:*",
"ssmmessages:*",
"logs:CreateLogGroup",
"logs:PutLogEvents",
"kms:ReEncrypt*",
"ec2:DescribeInstanceStatus"
],
"Resource": "*"
},
{
"Sid": "VisualEditor2",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:AbortMultipartUpload"
],
"Resource": "arn:aws:s3:::dcp-685169213993-eu-west-2-logs/session-manager/*"
}
]
}

LOGGING INTO THE EC2 INSTANCE

$ sudo su
$ yum update -y
$ yum install -y git docker
$ mkdir /apps
$ cd /apps
$ git clone https://github.com/artk-dev/simple-dockerised-flask-app.git
$ cd simple-dockerised-flask-app
$ systemctl start docker
$ docker build -t app:latest .
$ docker run -d -p 80:90 -t app:latest
$ curl localhost:80

CREATING A SECURITY GROUP FOR OUR INSTANCE

--

--

--

Budding software engineer with experience in full-stack development and DevOps engineering. 📚 Love to code. ⌨️ Love to write.✒️

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Interview Experience At Glovo — Senior Back

CS373 Spring 2021: Sruthi Rudravajjala

Nature 2.0 at the Odyssey Hackathon

Introducing Special K: A Library for Safe Machine Learning Model Serialization

Garnet Silver nice wholesale Ring Red L-1in UK KMOQ

My Non-Traditional Journey into Programming.

Splunk — ing Azure Event Hubs with HTTP Event Collector — Step by Step guide

Building the Web: Sockets and Servers for Dummies

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abdul Rahman

Abdul Rahman

Budding software engineer with experience in full-stack development and DevOps engineering. 📚 Love to code. ⌨️ Love to write.✒️

More from Medium

How to configure Code Pipeline (CICD) using CodeCommit and gitlab

Deploy Containerized Flask app to Heroku

Install Airlfow 2.0 on AWS’s Free Tier EC2

Integrating AWS APIs in Python — Using AWS S3 with the boto3 SDK