01 AWS Academy Learning Lab. AWS Cli para crear laboratorio

01 AWS Academy Learning Lab. AWS Cli para crear laboratorio

Introduction to AWS Academy and Learning Lab

In this section, the speaker introduces the topic of AWS Academy and explains how to create a preconfigured environment using a learning lab. The focus is on utilizing AWS CLI to launch the environment for students to work with various AWS services.

Setting up the Environment

  • The official documentation of AWS provides examples for configuring different AWS services, which can be accessed at [URL](insert URL).
  • The speaker has attempted to configure a laboratory environment with an EC2 Ubuntu instance and a Windows Server 2022 instance.
  • A public subnet was created within the previous network configuration, allowing each student to have their own unique network setup.
  • Security groups were created, allowing access to specific ports such as SSH (port 22) and RDP (port 3389).

Configuring Elastic IPs and Route Tables

  • Elastic IPs were assigned to both instances, ensuring they have fixed public IP addresses even if the lab runs for multiple days or weeks.
  • Route tables were generated to enable internet connectivity for the instances.

Exploring Different Environments

  • The speaker mentions that although they are demonstrating a basic EC2 environment, other environments like containers or EKS clusters can also be explored.

Accessing AWS Academy Learning Lab

This section focuses on how students can access the learning lab within AWS Academy. The speaker provides instructions on accessing courses and launching the preconfigured environment.

Accessing Courses in AWS Academy

  • Students can access their courses through a specific URL provided by their academy.
  • Within the learning lab module, students will find the specific lab they need to work on.

Launching Preconfigured Environment

  • To launch the preconfigured environment, students need to use a script provided by their instructor.
  • The script can be found in the instructor's repository, which students are instructed to clone.
  • By executing the script with their assigned student number as a parameter, students can configure their environment.

Running the Script and Configuring the Environment

This section explains how students can run the script provided by their instructor to configure their environment. The speaker emphasizes that this process is straightforward for students.

Running the Script

  • Students need to clone the repository containing the necessary script and navigate into it.
  • By running one of the available scripts and providing their student number as a parameter, students can configure their network, subnets, security groups, machine names, etc.

Generating Preconfigured Environment

  • The script executes various AWS CLI commands to generate an environment based on the provided parameters.
  • It creates an Ubuntu EC2 instance of type T2 micro and associates a key pair for SSH access.
  • A security group is created and associated with the instance along with a subnet.
  • User data is used to preconfigure services within the Ubuntu instance.
  • The script also assigns an internal fixed IP address within the subnet for each instance.

Conclusion

The transcript provides an overview of AWS Academy and demonstrates how to create a preconfigured environment using a learning lab. Students are guided through accessing courses, launching environments, running scripts, and configuring their own environments.

Cloning a Repository

The speaker explains the process of cloning a repository and accessing it through the console.

Cloning the Repository

  • To clone the repository, navigate to the Learning Lab console.
  • Use the command git clone followed by the repository URL to download the files.
  • Check the contents of the cloned repository using ls.
  • Move into the desired folder, such as "aws", and use ls again to view its contents.

Executing Scripts

The speaker discusses executing scripts and provides an example.

Running a Script

  • Execute a script using sh followed by the script name.
  • In this case, running sh a00018 creates a subnet, VPC, route table, security groups, and instances with specific configurations.
  • The script prompts for an input parameter (student number) before executing.

Configuration Steps

The speaker explains various configuration steps performed in the script.

Configuration Steps

  • Default routes are created in the route table to allow internet access.
  • Security groups are created and labeled for easy recognition.
  • Ubuntu instance is created and associated with an elastic IP address.
  • Similar steps are performed for Windows machine creation.

IP Addresses and Environment Setup

The speaker discusses IP addresses assigned to instances and confirms environment setup completion.

IP Addresses Assigned

  • After completing setup, specific public IP addresses are assigned to both Ubuntu and Windows instances: 54.89.59.63 and 387.151.100 respectively.

User Data Files

The speaker explains user data files used during instance creation.

User Data Files

  • User data files contain instructions for configuring instances during creation.
  • The Linux user data file installs Apache, MariaDB, PHP, and starts the Apache service.
  • The Windows user data file installs DNS services and disables the firewall.

Verification and Network Setup

The speaker verifies the setup and explains network configurations.

Verification

  • Accessing the WS console confirms successful setup for student 18.
  • All required components, such as VPC, subnets, route tables, security groups, and elastic IPs are present.

Network Setup

  • A custom VPC is created within the specified IP range (10.22.0.0/16).
  • Public subnet associated with this VPC has its own route table and a gateway for internet access.

Routing Tables and Elastic IPs

The speaker explores routing tables and elastic IPs in more detail.

Routing Tables

  • Two routing tables are created: one for directly connected networks and another for internet access.
  • These routing tables define gateways, routes, and connections to public networks.

Elastic IPs

  • Elastic IP addresses are associated with instances using private IP addresses defined in the script.
  • Public IP addresses assigned to instances are 100.x.x.x or 200.x.x.x as specified in the script.

Summary of Environment Creation

The speaker summarizes the environment creation process.

Environment Creation Summary

  • A custom VPC is created within the specified IP range (10.22.0.0/16).
  • Subnets, route tables, security groups, and instances are configured accordingly.
  • Instances have specific public IP addresses assigned: Ubuntu (54.89.59.63) and Windows (387.151.100).

Timestamps may not be available for every bullet point due to limitations in the provided transcript

Setting up Security Groups

In this section, the speaker discusses setting up security groups and configuring traffic rules between two instances.

Configuring Traffic Rules

  • The speaker mentions using DNS, TCP, UDP, HTTP, and RDP protocols for traffic.
  • A rule is created to allow all traffic from one security group to another.
  • Both Ubuntu and Windows machines have open communication between them.

Checking Security Group Rules

  • The speaker verifies the rules in the Ubuntu security group (ports 80, 22, 53).
  • The Apache web server and internal server are confirmed to be running on Ubuntu.
  • The speaker can connect to the machines from their local machine.

Verifying Communication Between Instances

This section focuses on verifying communication between instances and checking if services are running properly.

Verifying Services on Ubuntu Instance

  • The speaker checks if Apache web server is running by using sudo service apache2 status.
  • Both Apache and internal server services are installed and functioning correctly.
  • The speaker confirms communication with the Windows instance by pinging its IP address.

Direct Access to Instances

  • After setting up the environment, users can directly connect to both instances.
  • Users can use SSH or Visual Studio Code for remote access.

Cleaning Up the Environment

This section covers cleaning up the environment by deleting resources.

Deleting Resources

  • To clean up the environment, all resources need to be deleted.
  • Deleting a VPC will remove associated resources such as subnets, security groups, elastic IPs, etc.

Resetting the Environment

  • Alternatively, a reset of the environment can be done for a fresh start.
Video description

01 AWS Academy Learning Lab. AWS Cli para crear un entorno de laboratorio creado por mi. Ese entorno inicial será fácilmente configurado por los alumnos y les servirá para cubrir otras tareas propuestas por el docente. El repositorio que he utilizado en el laboratorio es: https://github.com/javiteran/AWS_Cli Y su uso en un Learning Lab se podría hacer a partir de la consola del laboratorio ejecutando los comandos: git clone https://github.com/javiteran/AWS_Cli.git cd AWS_Cli sh 00AWSLab01.sh 15 Si quieres mas información consulta mi entrada de blog https://dev.to/aws-builders/aws-academy-tarea-en-learning-lab-con-aws-cli-14hj