Home » AWS
Tuesday, 25 May 2021
Difference between Public & Private Subnet
The main difference between public and private subnet is how they can access the internet and who can access the instance in that subnet.
Public subnet will have the public IP address which will route to an internet gateway.
Private subnet will not have any public IP address, so this kind of traffic will be directed to NAT ( Network Address Translator) which provides the IP address to access the internet via an internet network gateway.
And public subnet has both in and out internet access while from private subnet only has out internet access i.e. no one can access the instance in the private subnet from the internet.
Tuesday, 18 May 2021
AWS Interview Question Quiz | Part 3
Here are some other posts that might be helpful :
Monday, 17 May 2021
AWS Interview Question Quiz | Part 2
Sunday, 16 May 2021
AWS Interview Question Quiz | Part 1
Thursday, 13 May 2021
CREATE EC2 AND CONNECT VIA SSH TELNET
This post provides step-by-step instructions to create an EC2 instance and access the instance via SSH telnet. As a newbie in the AWS world, I struggled a lot to understand vocabulary related to it.
Hope this is helpful and happy learning !!!
----------------------------------------------------------------------------------------------------------------------------------
Steps to create EC2 instance:
1) Navigate to https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:sort=instanceState.
2) Under the Instance tab in the EC2 dashboard. Go for launch instance and choose the AMI type. Here I am creating a Ubuntu instance.
3) Click next and choose the instance type. I have chosen the free tier here.
![]() |
| EC2 Instance Type |
4) Clik next and I am using the default VPC that is created when your AWS account is created and select any one of the subnets in which you want to launch your instance.
| EC2 Instance Details |
5) Clik next and go for “Add Storage”. Here I have chosen the basic volume type
and size as default.
| EC2 Storage |
6) Next add tag which is optional, if you have numerous number of instances running then it is better to add a unique tag name for recognition.
I have added a tag for example.
| EC2 Tag |
| EC2 Security Group |
8) After this, we can “Review and Launch” the instance. While launching the instance create a new key pair or use the existing key pair.
![]() |
| EC2 Key Pair |
Steps to convert key pair from PEM into PPK format
1) Open puttygen.exe and load the PEM file.
2) The type of key to generate should be SSH-2
RSA and the number of bits generated should be 2048.

puttygen.exe
3) Once the file is imported, go ahead and save
the file as private key.
----------------------------------------------------------------------------------------------------------------------------------
Steps to connect to the instance via SSH :
1) Open putty and use the private IP address of the instance, which will be available under the Networking tab of the instance.
2) And load converted PPK file under CONNECTION
-> SSh ->AUTH.
| Putty |
Voila !!! Now you are connected to the instance.
Tuesday, 11 May 2021
Creating And Using Lambda Layer in AWS Lambda
STEPS
TO CREATE LAMBDA LAYER:
Below are the steps to create a lambda layer in AWS.
1) Navigate to Lamdba and choose Layers from Dashboard.
![]() |
| Lambda Layer |
2) Choose create the layer, mention the layer name, description, Runtimes and select “Upload a file from Amazon S3” and click create. You can also upload the zip file directly from the remote, but the zip file size should be less than 10 MB.
3) Click create and copy the ARN of the lambda layer. You can create another version by 'CREATE VERSION' at the top right corner of the Lambda Layer page, by following the same steps as above.
| Lambda Layer |
HOW TO USE LAMBDA LAYER IN LAMBDA FUNCTION:
Below are the steps to add the lambda layer in the desired lambda function.
· 1) Go to the desired lambda function. Click on the Layers and choose the “Add a layer” option.
![]() |
| Add a layer - AWS Lambda |
2) After that choose “Specify an ARN” option and paste the ARN of the desired lambda layer.
![]() |
| Choose a layer - AWS Lambda |
3) Click “ADD” and now run the lambda function.
If Below might the error that you may face while using the lambda layer in a function.
ERROR MESSAGE: No module found
SOLUTION: Probably because your deployment package doesn't have a proper structure.
![]() |
| Lambda Layer Structure |
ERROR MESSAGE: Task timed out after 3.00 seconds
SOLUTION: Increase the timeout period, you can increase it up to 15 mins it is under the configuration tab.
| Configuration - AWS Lambda |
Monday, 10 May 2021
Creating Lambda Deployment Package Using EC2
Lambda Layers:
An archive containing additional code, such as libraries, dependencies, or even custom runtimes. When you include a layer in a function, the contents are extracted to the /opt directory in the execution environment.
Run the commands mentioned below to create the package
for lambda layers in the EC2 server.
The Lambda Layer you are creating should have the below structure or else will get the error message “No module found” while importing the module in lambda function.
![]() |
| Lambda Layer Structure |
STEPS TO CREATE PACKAGE FOR LAMBDA LAYER:
- Create a folder structure as below to
install the package for desired modules.
mkdir -p build/python/lib/python3.6/site-packages
- Below three commands are to select the python
version to install the modules and to install pip3. (Optional)
ls usr/bin/python* sudo update-alternatives --install /usr/bin/python3 python /usr/bin/python3.6 1 sudo update-alternatives --config python3 sudo apt install python3-pip
- This command is to install the desired module in the targeted folder. Here I am installing Pandas and xlrd.
pip3 install pandas xlrd -t build/python/lib/python3.6/site-packages/ --system
Below commands are to create the zip file for the lambda layer package.cd build/ zip -r9 Python3.6_Pandas_Lib.zip *
That's it now the deployment package is ready. Copy the zip file to the S3 bucket.






