2023년 7월 19일 수요일

Creating an AWS VPC - The Core of Cloud Networking

 Title: Creating an AWS VPC - The Core of Cloud Networking


Introduction:

AWS VPC (Virtual Private Cloud) is a fundamental concept in AWS that allows you to configure your network environment. While it may seem like a concept you can overlook if you're only creating a single EC2 instance for a web service (since default values are in place), understanding VPC becomes essential for effectively utilizing AWS.


According to the AWS website, VPC is described as follows:


"Virtual Private Cloud (VPC) is a user's private virtual network within AWS. VPC is logically isolated from other virtual networks in the AWS Cloud. It enables you to run AWS resources, such as Amazon EC2 instances, within your own virtual network." - What is Amazon VPC? (URL: https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html)


Although AWS VPC provides defaults, the underlying VPC is a shared space where instances (servers) are logically separated from other unused instances. While VPC itself provides logical network isolation, you can think of it as creating a separate space for the instances you use, distinct from the shared environment.


Now, let's dive deeper into the process of creating an AWS VPC and its key components.







1. Sign in to the AWS Console:

To begin creating an AWS VPC, sign in to the AWS Console. If you don't have an AWS account, create one on the AWS website and then proceed with logging in.


2. Navigate to the VPC Dashboard:

Once logged in to the AWS Console, navigate to the VPC Dashboard. The VPC Dashboard allows you to create and manage VPCs effectively.


3. Create a VPC:

In the VPC Dashboard, click on the "Create VPC" button to initiate the creation of a new VPC. Provide a name for your VPC and specify the CIDR (Cloud IP address range). The CIDR represents the range of IP addresses used within the VPC and should be unique.


4. Create Subnets:

After creating the VPC, you need to create subnets. Subnets define network segments within the VPC. Each subnet should have a unique CIDR range and must be within the CIDR range of the VPC.


5. Connect an Internet Gateway:

To connect your AWS VPC to the internet, you need to associate an internet gateway with the VPC. This enables instances within the VPC to communicate with the internet.


6. Configure Routing Tables:

Routing tables determine the path for packet transmission within the VPC. A default routing table is automatically created when you create a VPC, but you may need to create custom routing tables based on your requirements.


7. Configure Security Groups:

Security groups are used to define security rules for instances. They control inbound and outbound traffic for instances and enforce security policies.


8. Test the VPC:

Once you have successfully created the VPC, test its functionality by launching instances and verifying that they are operating correctly within the VPC. The IP addresses assigned to the instances should fall within the CIDR range of the VPC.




2023년 7월 17일 월요일

[AWS] Setting Up AWS CLI Connection on Windows

 "Setting Up Ubuntu on Windows Store for AWS CLI Configuration"


Note: I am assuming that you are referring to the process of installing Ubuntu from the Windows Store and using it for AWS CLI configuration on a Windows machine.


Currently, I'm studying and experimenting with AWS, including launching EC2 instances and various other tasks. While following a book, I came across the process of configuring AWS CLI using the command line interface. On macOS, it's as simple as opening the Terminal and proceeding. However, on Windows, there are several installations and settings required, which can be quite cumbersome.


Instead of using the default Windows terminal (cmd), I found it quite inconvenient to work with PowerShell (in administrator mode). Hence, I will document an alternative method using Ubuntu, which can be downloaded and installed from the Windows Store.


Please note that I have followed online tutorials and guides, so there may be some inaccuracies in my instructions.


1. Installing Ubuntu from the Windows Store

Please refer to the following URL for detailed instructions: [Link to Microsoft Documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10)

1) Launch PowerShell in administrator mode.


2) Enter the following command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux


3) Reboot your system.

4) Go to the Microsoft Store and search for Ubuntu.

- Perform a search for "Ubuntu" within the store.

- Download and install the Ubuntu application.

(The documentation might mention logging in, but you can proceed with the installation without logging in.)

Please note that the above instructions are for installing Ubuntu from the Windows Store, specifically for configuring AWS CLI.



5) The installation will be completed in a few minutes.


2. Installing Python and PIP

To use AWS CLI, you need to have Python and PIP installed.


1) Launch Ubuntu.

2) When running Ubuntu for the first time, it will prompt you to create a user account.

3) Proceed with Python installation.

 Please refer to the following URL for detailed instructions: [Link to AWS Documentation](https://docs.aws.amazon.com/cli/latest/userguide/install-linux-python.html)

 - Check the installation: python3 --version




 If Python is not installed: sudo apt install python3

4) Install PIP.

 - Install Python script: curl -O https://bootstrap.pypa.io/get-pip.py



 - Install necessary utilities for executing the Python script. It is recommended to update all packages before proceeding to avoid any potential errors. If you proceed without updating, errors may occur.

     sudo apt update

     sudo apt-get install python3-distutils

   - Install PIP: python3 get-pip.py --user


5) Configure the PATH.

   When installing PIP, you may encounter the following warning related to PATH. As the warning suggests, it is necessary to set the PATH accordingly.

  export PATH=~/.local/bin:$PATH

  source ~/.profile

  pip --version

   Running the above commands should display the version of pip without any errors, indicating a successful configuration.



6) Install AWS CLI.

   Please refer to the following URL for detailed instructions: [Link to AWS Documentation](https://docs.aws.amazon.com/cli/latest/userguide/install-linux.html)


   pip install awscli --upgrade --user


   aws --version


   After a successful installation, running the command "aws --version" should display the installed version of AWS CLI.


Please note that the above instructions are for installing Python, PIP, and AWS CLI on Ubuntu within the Windows environment.