From 1d58f3d6f9f79c10ed3fa959e1a1d761cf7b6734 Mon Sep 17 00:00:00 2001 From: Alexius Adhitya K Date: Sat, 11 Jul 2020 03:08:37 +0700 Subject: [PATCH] Update README.md --- README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 98bc050..0206635 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# AWS Demo: Containerized Django + PostgreSQL -Let's say right now you want to try Django + Postgres. As time goes by, you want to reset it. Unconciously you had already installed so much that reinstall Django + Postgres will break something. One way to prevent this nightmare is by containerized Django + Postgres. +# AWS Demo: Containerized Django + AWS RDS PostgreSQL +Let's say right now you want to try Django. Then at some point in the future you want to reset it. Unconciously you had already installed so much that reinstall Django will break something. One way to prevent this nightmare is by containerizing Django and store it in a container registry for later use. ### Requirement * AWS account (free tier is sufficient) -### Create Django + Postgres Docker Image in EC2 +### Create Django Docker Image in EC2 1. Go to EC2 Management Console then launch an EC2 instance with this configuration: * AMI: Ubuntu Server 20.04 LTS x86_64 * Type: t2.micro @@ -44,9 +44,21 @@ sudo docker build -t demo . sudo docker run demo -d -p 80:8000 ``` -### Upload Django + Postgres Docker Image to Container Registry +### Upload Django Docker Image to Container Registry 1. Go to IAM Console then add a new user for the instance with this configuration * Access type: Programmatic Access * Set permissions: Attach existing policies directly (AmazonEC2ContainerRegistryFullAccess) -2. Save Access key ID and Secret access key. -3. +2. Save **access key ID** and **secret access key**. +3. Back to the instance's SSH and install AWS CLI. +``` +unzip awscliv2.zip +sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin +``` +4. Verify that AWS CLI is installed correctly. +``` +aws --version +``` +5. Connect AWS CLI to IAM User by entering previously saved **access key ID** and **secret access key**. +``` +aws configure +```