Create your own VPC in AWS
Mar 31, 2023
IAM Role
VPC
Route Table creation in a VPC
Select app-routetable-public route table, choose routes and then choose edit routes.
Launching EC2 instance in VPC
Scroll down to Advanced Details. Paste in the following into the User data box:
#!/bin/bash -exwget https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/DEV-AWS-MO-GCNv2/FlaskApp.zipunzip FlaskApp.zipcd FlaskApp/yum -y install python3 mysqlpip3 install -r requirements.txtamazon-linux-extras install epelyum -y install stressexport PHOTOS_BUCKET=${SUB_PHOTOS_BUCKET}export AWS_DEFAULT_REGION=<INSERT REGION HERE>export DYNAMO_MODE=onFLASK_APP=application.py /usr/local/bin/flask run --host=0.0.0.0 --port=80
Configure security group as below
This application is not connected to the database so you will not see anything. It shows Saved! status but data is not saving in the database.
Now stop instance.
Hope now, you are confident about how to create the VPC in the AWS.