Posts

AWS: On Demand Capacity Reservation (ODCR) and preventing Insufficient Capacity Error (ICE)

 What is ODCR, and why does it matter? On-Demand Capacity Reservation is one of the ways how we can reserve capacity on AWS. This feature helped to reserved capacity especially the large EC2 instance or special instances like (P series) that is very little in the Availability Zones (AZ). The service will not charge you if you have an EC2 running 24 by 7. It will ensure when you need to start/stop your EC2, the same instance family/types for that particular AZ are reserved for you. It is not commitment-based, like a Reserved Instance or Saving Plan, where you need a minimum of 1 year. ODCR is only activated once you enable it in the AWS Console. You can cancel it anytime if you do not needed. What is an Insufficient Capacity Error (ICE)? ICE is an exception where there are not enough EC2 instance families available in a particular Region or AZ. This is not common in AWS, but it has happened before, especially for large EC2 like 32x or special EC2 like P series.  How does ODCR help to pr

Redhat Repo on AWS

Image
I encountered a lot of questions, mainly about the RED HAT REPO. The Cloud Engineer asked if AMAZON has a RedHat Repo and if they can patch their EC2 without going through the Internet. The simple answer is NO. RED HAT hosts its RHUI (Red Hat Update Infrastructure) in AWS, but you can only access its Repository via the Internet (through Internet Gateway—IGW). You can refer to: https://aws.amazon.com/partners/redhat/faqs/ How can a private EC2 be updated? Depends on your company policy. Over here, I have 2 options: Option1, access through IGW via NAT Gateway You can leverage NAT Gateway to access the Internet. Red Hat maintains its Repository in each AWS region. You can update your RED HAT EC2 to point to the following URL(https://access.redhat.com/articles/4720861) Depending on your region, need to update the URL of the Red Hat report URL so your traffic can flow to it. rhui3.<<Region>>.aws.ce.redhat.com Option 2:  Create a local Red Hat Repository, and all your EC2 will ge

AWS Developer Experience

 In AWS, builder are empowered to build secure, faster and better code through the tools available to them by AWS. We shall break down those tools in this blog. 1. Amazon Q Developer (formerly known as Code Whisperer) This is AI to help builder to generate sample code that was trained by AWS. you can use your favourate programming languages like python, java, typescript/javascript and c#.  This can integrate with popular IDE like visual code, visual studio, pycharm and intelliJ.  2. Amazon Q (primarily consists of Amazon Q Business App and Amazon Q Developer) It is Generative AI asisstance can help answer your questions just like ChatGPT. If a company have common tools or API, you can also trained Amazon Q to understand how the api been use so the developer in the company can use Amazon Q to guide them how to use those tools or API. Amazon Q wont use the data to train it model. Data within the company stay in the company. Developer can integrate Amazon Q into Visual Code and they can h

AWS Local Zones - Understand the Subnets

Image
Local Zones have some attributes that we need to take notes expecially when we need to create EIP or RDS. Below some explainations: Command:    aws ec2   describe-availability-zones --filters "Name=zone-type,Values=local-zone" --region ap-southeast-1 Above is using Bangkok Local Zone ZoneName : This property can be use when we want to create subnet in Local Zone GroupName : I t is use to group all the local zones available in that place\area.  Note: The picture above i am using us-west-2-lax (LA) because Bangkok only have 1 Local Zone. NetworkBorderGroup: When we use local zone, AWS will create 2 networkBorder Group (Region and Local Zone). It use by EIP / IPv6(now only available in LA at the point of writing this blog). If EIP is for Local Zone, select the NetworkBorderGroup for it.  There is it.

AWS Local Zones - Unable to launch EC2

Image
 Background: when tries to launch ec2, based on documentation(https://aws.amazon.com/about-aws/global-infrastructure/localzones/features/), you can select the availble EC2 instance type and also the EBS type as recomended by the documentation: Once you have selected those instance type as recomended by AWS documentation, you may encounter the below error (Please note the error messages): Resolution: 1. Instead of choosing the instance type and select directly, you need to click on "Compare instance type" link instead: 2. Show the "Availabiliy Zones" column by selecting the "gear" icon first: 3.  In the Searchbox, select "availability zones: <<Local Zone Name>> to find out which instances are available for us to use in the Local Zones (if you see the below pictures, we only have 4 types):  4. Once done, launch your instances with other configuration just like how you launch your normal ec2 and ensure to select the EBS types that is supporte

AWS - Local Zones

Image
What is Local Zones? a. It is an extention of availability zone to those country where AWS do not have region in. b. Design to get closer to customer hance, enhancing latency or/and data residency due to compliances. Setup: 1. Enable Local zones, first select the region you want to connect your local zone. In this example, my region is Singapore (ap-southeast-1) and therefore enable local zone in Thailand: a. https://ap-southeast-1.console.aws.amazon.com/ec2/home?region=ap-southeast-1#Settings:tab=zones b.  c. Create VPC in ap-southeast-1 d. create Subnet in Local Zones That it for quick start in AWS Local Zones.

Terraform with Docker for Macbook M1 (ARM)

My intention is to blog how I build Terraform in a Docker image, compile it and run as "alias". Official docker image for Terraform do not provide ARM64 architecture at the point of writing this article. In addition to that, I wanted to play with Google Distroless image. Step:1 Create a docker file with multiple build stage: DockerFile Step:2  Build the docker image, for my case, I intend to save the image in DockerHub hence I am running the following command: "docker build -t wongchuinhun/terraform" and upload into my docker hub wongchuinhun/terraform Step: 3 I want to create an alias in my Macbook instead of typing the full docker command, hence I added the following in my zshrc file: alias t = "docker run -it --rm wongchuinhun/terraform" Step:4 To use it, I simple go to my terraform working folder and type the following code in my Terminal: t init