|
| 1 | +AWS Academy Cloud Architecting 2.x - Capstone Project : |
| 2 | + |
| 3 | +Click on the start lab. |
| 4 | + |
| 5 | +Wait till the light near AWS to becomes green. |
| 6 | + |
| 7 | +Click on AWS. |
| 8 | + |
| 9 | + |
| 10 | +Steps Used to Create a project: |
| 11 | + |
| 12 | +1. Create a database in RDS |
| 13 | +DB Name: Example |
| 14 | +User Name: admin |
| 15 | +Password: lab-password |
| 16 | +VPC- Example VPC |
| 17 | +security group - Example-DB |
| 18 | + |
| 19 | +*** Don't wait for the database to become available instead of doing the next steps. |
| 20 | + |
| 21 | +2. Check security group: ALBSG, Bastion-SG, Example-DB, and Inventory-App |
| 22 | + |
| 23 | +3. Create a new keypair: vockey2 (ssh passthrough) |
| 24 | + Go to key pairs |
| 25 | + Name - vockey2 |
| 26 | + |
| 27 | +4. Download the PPK file |
| 28 | + * Go to the Capstone project page on AWS academy. |
| 29 | + * On the upper right side, go to AWS details |
| 30 | + * Click on "Download PPK." |
| 31 | + |
| 32 | +5. Create EC2-Instance Web Application. |
| 33 | + |
| 34 | + * AMI - Amazon Linux 2 AMI |
| 35 | + * Instance type- t2.Small |
| 36 | + * VPC - Example VPC |
| 37 | + * Subnet - Private Subnet 1 |
| 38 | + * Auto-assign Public IP - Disable |
| 39 | + * IAM role - Inventory-App-Role |
| 40 | + * Name - ExampleApp |
| 41 | + * Click on "Select an existing security group - after that, select the "Inventory App" security group. |
| 42 | + * Select an Existing Key - vockey2 |
| 43 | + |
| 44 | + IMP STEP - After creating the Instance, go to Security Group - Inventory App and in the inbound rule |
| 45 | + * add the type - SSH |
| 46 | + * on the search box near the source - type -> "bastion-SG" - and select it |
| 47 | + * Click on Save rules. |
| 48 | + |
| 49 | + |
| 50 | +6. Create Parameter Store in the System Manager |
| 51 | +/example/endpoint - example.cbufnmin3yj3.us-east-1.rds.amazonaws.com |
| 52 | +/example/username - admin |
| 53 | +/example/password - lab-password |
| 54 | +/example/database - example |
| 55 | + |
| 56 | +7. Access the ExampleApp via the bastion instance. |
| 57 | + * Open the pagent (go to the search box in your PC - search pagent - put the vockey2 key in the pagent - close the pagent ) |
| 58 | + * Open the putty |
| 59 | + * Click on connection, on the right side, "Seconds between keepalives" - 30 |
| 60 | + * Click on the session, and after that, on the hostname, ENTER THE IPv4 ADDRESS of the "Bastion" Instance. |
| 61 | + * Go to CONNECTION-SHH-AUTH - click on ALLOW AGENT FORWARDING. Then click on "browse" and select the location of the PPK file you downloaded earlier. |
| 62 | + * on the pop-up, click on Accept. |
| 63 | + * login as - ec2-user |
| 64 | + (after the above command you will see like this-> ec2-use@ip-<private IPv4 address of Bastion instance>) |
| 65 | + * On the command line type: ssh ec2-user@<private IPv4 address of ExampleApp instance you created earlier> |
| 66 | + * After that type- yes |
| 67 | + (after the above command, you will now log in as ExampleApp, and on the command line, you will see like this-> ec2-use@ip-<private IPv4 address of ExampleApp instance>) |
| 68 | + |
| 69 | +8. Install the Apache Web Server (httpd) and Mysql on Instance ExampleApp, on the command line : |
| 70 | + ping www.google.com |
| 71 | + click ctrl + c |
| 72 | + sudo su |
| 73 | + yum install -y httpd mysql |
| 74 | + amazon-linux-extras install -y php7.2 |
| 75 | + |
| 76 | +9. Download SQL on the command line : |
| 77 | + wget https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/ILT-TF-200-ACACAD-20-EN/capstone-project/Countrydatadump.sql |
| 78 | + |
| 79 | +10. Download the source code Web App on the command line : |
| 80 | + wget https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/ILT-TF-200-ACACAD-20-EN/capstone-project/Example.zip |
| 81 | + |
| 82 | +11. Extract the source Web App and copy it to directory /var/www/html on the command line: |
| 83 | + unzip Example.zip -d /var/www/html/ |
| 84 | + ls /var/www/html/Example/ |
| 85 | + |
| 86 | +12. Enable and start service httpd on the command line: |
| 87 | + systemctl enable httpd |
| 88 | + systemctl start httpd |
| 89 | + systemctl status httpd |
| 90 | + |
| 91 | + |
| 92 | +13. Login to your database by using the following command line : |
| 93 | + mysql -u admin -p --host example.cbufnmin3yj3.us-east-1.rds.amazonaws.com |
| 94 | + Enter the password - lab-password |
| 95 | + show databases; |
| 96 | + exit; |
| 97 | + |
| 98 | +14. Import data ke database : |
| 99 | + mysql -u admin -p --host example.cbufnmin3yj3.us-east-1.rds.amazonaws.com example < Countrydatadump.sql |
| 100 | + Enter the password - lab-password |
| 101 | + exit |
| 102 | + exit |
| 103 | + |
| 104 | +15. Create a Target Group |
| 105 | + VPC- Example VPC |
| 106 | + Advanced health check setting- |
| 107 | + Healthy threshold - 2 |
| 108 | + Interval - 10 |
| 109 | + |
| 110 | + Tags- |
| 111 | + Add tag- |
| 112 | + Name - TG-Example |
| 113 | + Click on create target group |
| 114 | + |
| 115 | +16. Create a Load Balancer |
| 116 | + Select Application Load balancer |
| 117 | + Name - LB-Example |
| 118 | + VPC- Example VPC |
| 119 | + select first region - us-east-1a |
| 120 | + select subnet - public subnet 1 |
| 121 | + select second region - us-east-1b |
| 122 | + select subnet - public subnet 2 |
| 123 | + Security groups |
| 124 | + select - ALBSG |
| 125 | + Listeners and routing- |
| 126 | + select - TG-Example |
| 127 | + Click on create a load balancer |
| 128 | + |
| 129 | +17. Create an Auto Scaling Group |
| 130 | + Name- ASG-Example |
| 131 | + on lunch template - |
| 132 | + select - Example-LT |
| 133 | + Network - |
| 134 | + VPC - Example VPC |
| 135 | + subnets- |
| 136 | + Select private subnet 1 |
| 137 | + Select private subnet 2 |
| 138 | + Load balancing - |
| 139 | + Click on attach an existing load balancer. |
| 140 | + select - TG-Example |
| 141 | +18. Go to your Instances tab. Two more instances are launching; wait 2 to 3 min. to pass the checks. |
| 142 | + |
| 143 | +19. Test the Web Application using load balancer DNS in the new tab. |
| 144 | + Go to the Load balancer you created earlier. |
| 145 | + Copy the load balancer's DNS address and paste it into a new tab. |
| 146 | + |
| 147 | +END |
| 148 | + |
| 149 | + |
| 150 | + |
0 commit comments