Configuring AWS VPC for beginner
Tags: aws, vpc
Published: 2023-07-06 11:10:50

**About AWS VPC:**

> Amazon Virtual Private Cloud (VPC) is a logical isolation of your AWS resources in the cloud. It provides you with a private and secure network that you can use to connect your EC2 instances, S3 buckets, and other AWS resources.
> A VPC is a virtual network that closely resembles a traditional network that you’d operate in your own data center, with the benefits of using the scalable infrastructure of AWS.

**Followings are optional Component of a VPC:**

**Internet gateways (IGWs):** An internet gateway allows communication between your VPC and the public internet.

**Elastic IP (EIP):** AWS Elastic IP is a feature provided by Amazon Web Services (AWS) that allows you to allocate a static public IPv4 address to your AWS resources, such as Amazon EC2 instances, NAT gateways, or Network Load Balancers.

**VPC Endpoints:** Virtual Private Cloud (VPC) endpoints enable you to privately access AWS services within your VPC without going over the internet.

**VPC Peering:** Peering refers to the process of connecting two Amazon Virtual Private Clouds (VPCs) together to enable communication between them using private IP addresses.

**NAT Instance NAT Gateway:** NAT Gateway simplifies outbound internet connectivity for resources in private subnets and provides a managed and scalable solution for address translation.

**Virtual private gateways:** A virtual private gateway allows communication between your VPC and your on-premises network.
The benefits of using a VPC:

**Security:** VPCs provide a layer of security for your AWS resources by isolating them from the public internet.

**Scalability**: VPCs can be scaled to meet the needs of your applications.

**Cost-effectiveness:** VPCs can help you to save money by allowing you to control the amount of traffic that goes to the public internet.

## Configuring A Simple VPC with Single Availability Zone (AZ)

## To create the VPC

1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc
2. On the dashboard, choose Create VPC.
3. For Resources to create, choose VPC and more.
4. Configure the VPC.
5. Enter a name for the VPC.
6. For IPv4 CIDR block, you can keep the default suggestion, or alternatively you can enter the CIDR block required by your application or network.
7. (Optional) If your application communicates by using IPv6 addresses, choose IPv6 CIDR block, Amazon-provided IPv6 CIDR block.
8. Configure the subnets
9. For Number of Availability Zones, choose 1. You can keep the default Availability Zone, or alternatively you can expand Customize AZs and select an Availability Zone.
10. For Number of public subnets, choose 1.
11. For Number of private subnets, choose 0.
12. You can keep the default CIDR block for the public subnet, or alternatively you can expand Customize subnet CIDR blocks and enter a CIDR block.
13. For NAT gateways, keep the default value, None.
14. For VPC endpoints, choose None. A gateway VPC endpoint for S3 is used only to access Amazon S3 from private subnets.
15. For DNS options, keep both options selected. As a result, your instance will receive a public DNS hostname that corresponds to its public IP address.
16. Choose Create VPC.

## Now Launch A EC2 Instance on your Created VPC:

## Click EC2 Dashboard:

1. Click Launch instance
2. Name you ec2 instance
3. Chose AMI for instance
4. Keep the architecture file as defaults.
5. Select Instance type t2.micro for Free tire or you can chose as per your need
6. Select your key pair or create a new key pair for your instance
7. Edit Network settings and select your created VPC from here.
8. Enable Auto-assign public IP
9. Select Security Group for your instance or select executing one if you have. By default the security group has an ssh port open for all.
10. Keep the rest of the things as default.
11. If everything is ok click Launch Instance to create your instance on your VPC.

## For Video Tutorial

{% embed https://www.youtube.com/watch?v=dlMsvFLnIRs %}