Skip to main content

Posts

Showing posts from 2020

How to deploy Lambda function in AWS from developers machine?

  In previous post , we saw how to setup local development environment and test a Lambda function locally. As a developer, you may want to test the function in AWS environment quickly to make sure your code is working. In this post we will look at how to deploy the function in your AWS account. We will look at CI/CD pipeline to automatically build and deploy Lambda function in next post.  If you followed the instruction in previous post , you will notice there are three files in your solution LambdaEntrypoint.cs - This is the entrypoint for AWS Lambda.  aws-lambda-tools-defaults.json - This is the configuration file used by Lambda tooling. Update this file to add AWS profile you created while configuring AWS CLI and region you want to deploy your code. Note make sure you have this setting in your template as for some reason, it is missing from default template.  "function-runtime" : "netcoreapp3.1" , serverless.template - This is CloudFormation Serverless applicatio

How to get started with .Net Core and Lambda functions?

 Recently I started experimenting with .Net Core and AWS Lambda functions, I thought I will share the steps I took to get started Tools to install .Net Core 3.1 -  https://dotnet.microsoft.com/download/dotnet-core/3.1 AWS CLI -  https://aws.amazon.com/cli/   AWS Account - 12 months Free Tier -  https://aws.amazon.com/free Terminal - on iOS I use iTerm2 -  https://www.iterm2.com   Once you installed the above tools, head to AWS console and login with your root account to create an account which will be used by AWS CLI. Please see steps here   Now you can configure AWS CLI as detailed here . Verify that you able to connect to AWS service using CLI. To make life little easy with dotnet core and Lambda functions, you need to install AWS Extensions nuget pack for .Net CLI dotnet tool install -g Amazon.Lambda.Tools You can also install templates to get started quickly  dotnet new -i Amazon.Lambda.Templates That's it. Now the fun part!!!  Create a new project In terminal window, check the

AWS Architect Associate Notes - EC2

  EC2 - Elastic Compute Cloud Resizable compute capacity Pricing models On demand Low, flexible, no upfront cost Suitable for short term spike Reserved Suitable for steady state Pricing Standard reserved instance - 75% cheaper Convertible reserved instances - 54% cheaper Scheduled reserved instances SPOT For application have low compute usage Upto 90 % cheaper compared to on DEMAND Flexible start and end time You are not charged for the hour if AWS terminates your instance but are charged if you terminate the instance Suitable for fault tolerant or HPC application where downtime on short notice is acceptable. You get 2 minutes notice before an instance is terminated SPOT blocks stops an instance from being terminated

AWS S3 Transfer acceleration

AWS S3 Transfer Acceleration is a service provided by AWS to speed up the upload of file to S3. It basically uses Edge locations to upload the files and then uses AWS backbone to transfer the file to S3. You can view the results of a test I ran from London. As you can see there is no benefit of using it when you are uploading to a region closer to you but 25% gain for other regions https://s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/accelerate-speed-comparsion.html?result=3424-5714-9638-19209&identityId=unknown

AWS Architect Associate Notes - S3

S3 is a simple key based object store. S3 has globally unique namespace i.e. bucket name has be unique across all region but S3 bucket is created in a region. The data is stored on multiple devices spanning at least 3 AZs S3 has three URL scheme Global (legacy) Virtual Domain Based Path Based File size 0 bytes to 5 TB. Largest PUT 5GB Successful uploads produces a HTTP 200 Consistency Read after write for PUTS of new objects Eventual consistency for overwrites PUTS and DELETES S3 as objects and has following properties Key Value Version id Metadata Sub resources Access control list Torrents 99.99% availability, Amazon guarantees 99.9% and  99.999999999% durability (unlikely it will be lost) Tiered storage Standard S3 - IA S3 - one Zone - IA S3 - Intelligent Tiering

More than one way to skin a cat

Software Engineering is one engineering field where there is always more than one way to solve a problem. Now this can be a blessing or a curse depending on the situation. There are so many instances I have seen where developers argue to nth degree which is the right way to solve a problem or write code. Should code be centralised or should be near to place where it is used? How do we make sure we dont miss updating the code if the code changes somewhere else in future? How do we make sure if someone else picks up the code and doesn't follow the convention? It is like as if you are building an extension to your house and the builder will use complete different bricks and not check what colour of bricks were already there even though it is right there in front of his eyes. So how do we solve the problem? How can we help the team to focus on the solution and not gold plate the solution? This is where patterns and principles come in. People have solved problems, If you study

Reboot 2020

Wow! it has been two years since I have written a post here. Time to Reboot/ Restart here. Lots has changed in last two years. I have changed couple of jobs. Learnt a lot from leading different teams - from a mature team of site reliability Engineers working for a multinational Fintech to a young team of developers working for a start up. It has been a journey of ups and downs in last two years. 2020 has been a challenging year with lockdown and working from home. Again lots of learning and working on new stuff like mobile development echo system.... So time to kick things off....