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

--

--

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.✒️