AWS 179-[AWSD]-Lab - Migrate to Amazon RDS

Описание к видео AWS 179-[AWSD]-Lab - Migrate to Amazon RDS

#AWS 179-[AWSD]-Lab - Migrate to Amazon RDS

Check out my GitHub Repository - https://github.com/MFMKURIA/More-AWS-...
Portfolio
1. http://markfrancismk.sciawareness.com...
2. https://d2taxcp5hluc5o.cloudfront.net/
Detailed Step-by-Step Guide to Migrate to Amazon RDS

This guide will walk you through the process of migrating a café web application from a local MySQL database to an Amazon RDS MariaDB instance. We’ll cover each step in detail, including explanations of AWS services used and potential exam questions related to these tasks.

Lab Overview

Objective: Migrate a café web application’s local database to an Amazon RDS MariaDB instance, and reconfigure the application to use the new database.

Task 1: Generating Order Data on the Café Website

1. Open Café Web Application:
Access the café website using the URL provided (e.g., `34.55.102.33/cafe`).
This URL points to the existing café application running on an EC2 instance with a local MySQL database.

2. Place Orders:
Navigate to the "Menu" page.
Add at least one of each item to your order.
Click "Submit Order" to record the orders in the existing database.

3. Record Order History:
Go to the "Order History" page to view the number of orders you placed.
This number will be used later to verify successful data migration.

Task 2: Creating an Amazon RDS Instance Using AWS CLI

Task 2.1: Connecting to the CLI Host Instance

1. Access EC2 Management Console:
Open the AWS Management Console.
Search for and select EC2.

2. Select CLI Host Instance:
In the EC2 Dashboard, navigate to Instances.
Find and select the CLI Host instance from the list.

3. Connect Using EC2 Instance Connect:
Click Connect.
Choose the EC2 Instance Connect tab and click Connect.

Alternative: Use an SSH client if preferred. Follow the [AWS documentation](https://docs.aws.amazon.com/AWSEC2/la...) for SSH connection details.

Task 2.2: Configuring the AWS CLI

1. Configure AWS CLI:
Run the command: `aws configure`.
Enter the following details when prompted:
AWS Access Key ID: Your Access Key value.
AWS Secret Access Key: Your Secret Key value.
Default region name: The region where your resources are located (e.g., `us-west-2`).
Default output format: `json`.

Purpose: Configures the AWS CLI with your credentials and default settings to interact with AWS services.

Task 2.3: Creating Prerequisite Components

1. Create a Security Group:
Command:
```bash
aws ec2 create-security-group \
--group-name CafeDatabaseSG \
--description "Security group for Cafe database" \
--vpc-id /CafeInstance VPC ID
```
Purpose: Creates a security group for the RDS instance, allowing specific traffic.

2. Create Inbound Rule:
Command:
```bash
aws ec2 authorize-security-group-ingress \
--group-id /CafeDatabaseSG Group ID \
--protocol tcp --port 3306 \
--source-group /CafeSecurityGroup Group ID
```
Purpose: Allows MySQL traffic (port 3306) from the specified security group, securing the database access.

3. Verify Security Group Configuration:
Command:
```bash
aws ec2 describe-security-groups \
--query "SecurityGroups[].[GroupName,GroupId,IpPermissions]" \
--filters "Name=group-name,Values='CafeDatabaseSG'"
```

4. Create Private Subnets:
Command for Subnet 1:
```bash
aws ec2 create-subnet \
--vpc-id /CafeInstance VPC ID \
--cidr-block 10.200.2.0/23 \
--availability-zone /CafeInstance Availability Zone
```
Command for Subnet 2:
```bash
aws ec2 create-subnet \
--vpc-id /CafeInstance VPC ID \
--cidr-block 10.200.10.0/23 \
--availability-zone /availability-zone
```
Purpose: Creates private subnets for RDS deployment, ensuring high availability and isolation from public access.

5. Create DB Subnet Group:
Command:
```bash
aws rds create-db-subnet-group \
--db-subnet-group-name "CafeDB Subnet Group" \
--db-subnet-group-description "DB subnet group for Cafe" \
--subnet-ids /Cafe Private Subnet 1 ID /Cafe Private Subnet 2 ID \
--tags "Key=Name,Value= CafeDatabaseSubnetGroup"
```

Purpose: Groups the subnets into a DB subnet group, which RDS uses to place the database instance.

Task 2.4: Creating the Amazon RDS MariaDB Instance

1. Create RDS MariaDB Instance:
Command:
```bash
aws rds create-db-instance \
--db-instance-identifier CafeDBInstance \
--db-instance-class db.t3.micro \
--engine mariadb \
--engine-version 10.5.13 \
--allocated-storage 20 \
--db-subnet-group-name "CafeDB Subnet Group" \
--vpc-security-group-ids /CafeDatabaseSG Group ID \
--publicly-accessible false \
--master-username root \
--master-user-password Re:Start!9

Комментарии

Информация по комментариям в разработке