<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sourav Karmakar on Medium]]></title>
        <description><![CDATA[Stories by Sourav Karmakar on Medium]]></description>
        <link>https://medium.com/@souravkarmakar96?source=rss-434f7749e44b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DCl6F39njQo-DdiPxynkWQ.png</url>
            <title>Stories by Sourav Karmakar on Medium</title>
            <link>https://medium.com/@souravkarmakar96?source=rss-434f7749e44b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:48:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@souravkarmakar96/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploy kured with custom parameters]]></title>
            <link>https://souravkarmakar96.medium.com/deploy-kured-with-custom-parameters-59f445120496?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/59f445120496</guid>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[kured]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Tue, 08 Nov 2022 11:39:25 GMT</pubDate>
            <atom:updated>2022-11-09T06:35:05.058Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploy kured with custom parameters on kubernetes</h3><pre># Add the Kured Helm repository <br>helm repo add kubereboot <a href="https://kubereboot.github.io/charts/">https://kubereboot.github.io/charts/</a></pre><pre># Update your local Helm chart repository cache <br>helm repo update</pre><pre># Deploy <br>helm install my-kured kubereboot/kured \<br>    --namespace kured \<br>    --create-namespace \<br>    --set extraArgs.start-time=9am \<br>    --set extraArgs.end-time=5pm \<br>    --set extraArgs.time-zone=America/Toronto \<br>    --set extraArgs.reboot-days=&quot;mon\,tue\,wed\,thu\,fri&quot;</pre><p>Ref: <a href="https://learn.microsoft.com/en-us/azure/aks/node-updates-kured">Handle Linux node reboots with kured — Azure Kubernetes Service | Microsoft Learn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59f445120496" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to operate Amazon ECR with AWS CLI]]></title>
            <link>https://awstip.com/how-to-operate-amazon-ecr-with-aws-cli-87e01af2676d?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/87e01af2676d</guid>
            <category><![CDATA[ecr]]></category>
            <category><![CDATA[aws-cli]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-ecr]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 05:48:09 GMT</pubDate>
            <atom:updated>2022-07-06T10:06:21.595Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon ECR (Elastic Container Registry) is the repository for keeping container images. It is fully managed secure, scalable, reliable container registry offering high-performance hosting. It can integrate seamlessly with other AWS services such as Amazon EKS(Elastic Kubernetes Service), Amazon ECS( Elastic Container Services). You can use this service to store your container images in ECR and provide reference of the image while deploying containerized applications to any container running platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*_yy28G2LHPP7XFUB9Qnl4Q.png" /></figure><p>AWS CLI is the command line tool to interact will AWS services. Here I’m going to show how do we create, manage and perform other operations related to ECR through AWS CLI.</p><p>Two types of ECR can be created in AWS. One is public, another type is private. Images in the public repos are accessible by everyone but private repos are totally private, you need credentials to login to the repo and then only you will be able to push, pull and perform other operations. Amazon ECR supports private repositories with resource-based permissions using AWS IAM so that specified users or Amazon EC2 instances can access your container repositories and images. You also can control access to your repositories and the images within them with repository policies.</p><p>Here I will work with the private ECR and below are the operations that will be performed in this regard -</p><ol><li>Create a container registry.</li><li>Delete a container registry.</li><li>Login to ECR.</li><li>Push image to ECR.</li><li>Pull image from ECR.</li><li>Delete image from ECR.</li></ol><p>…</p><h3>1. Create Amazon Elastic Container Registry with AWS CLI:</h3><p>Run the below command to deploy a new private ECR. Modify the parameters before running.</p><pre>aws ecr create-repository --repository-name myecr376 --image-scanning-configuration scanOnPush=true --region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UtYnYJMyWTleHSTF.png" /><figcaption>Create an ECR</figcaption></figure><p><em>Ref: </em><a href="https://docs.aws.amazon.com/cli/latest/reference/ecr/create-repository.html"><em>create-repository — AWS CLI 1.25.20 Command Reference (amazon.com)</em></a></p><h3>2. Delete Amazon Elastic Container Registry:</h3><p>Run the below command to delete an ECR.</p><pre>aws ecr delete-repository --repository-name myecr376</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/0*GNoYnbB69KMdofiL.png" /><figcaption>Delete an ECR</figcaption></figure><p><em>Ref: </em><a href="https://docs.aws.amazon.com/cli/latest/reference/ecr/delete-repository.html"><em>delete-repository — AWS CLI 1.25.20 Command Reference (amazon.com)</em></a></p><h3>3. Login to ECR:</h3><p>Use the below command to login to ECR repo in order to perform other operations later in ECR. This command will fetch the credentials for the ECR and stores it in your local system.</p><pre>aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <strong>&lt;aws_account_id&gt;</strong>.dkr.ecr.us-east-1.amazonaws.com/myecr376</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2afUs-kT_YZvgces.png" /><figcaption>ECR login</figcaption></figure><p><em>Ref: </em><a href="https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login-password.html"><em>get-login-password — AWS CLI 1.25.20 Command Reference (amazon.com)</em></a></p><h3>4. Push a docker image to ECR:</h3><p>Before you push any image to ECR, prepare it in your local system where docker is already installed.</p><p>I have a docker image called ‘mycustomimage’ in my local system. Lets push it to ECR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*vryfaPNEweAMOKA5.png" /></figure><p>Tag the image first -</p><pre>docker tag mycustomimage:latest <strong>&lt;aws_account_id&gt;</strong>.dkr.ecr.us-east-1.amazonaws.com/myecr376:latest</pre><p>Push the image -</p><pre>docker push <strong>&lt;aws_account_id&gt;</strong>.dkr.ecr.us-east-1.amazonaws.com/myecr376:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/0*_3jeq_-IfUPt1_fU.png" /><figcaption>Push image to ECR</figcaption></figure><h3>5. Pull a docker image from ECR:</h3><p>Below command is used to pull container images from ECR to local environment. Just provide the proper URL of the image.</p><pre>docker pull <strong>&lt;aws_account_id&gt;</strong>.dkr.ecr.us-east-1.amazonaws.com/myecr376:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/0*JhIDYytr0F1HiOBX.png" /><figcaption>Pull image from ECR</figcaption></figure><h3>6. Delete image from ECR:</h3><p>Below command will help you to delete container images stored in ECR. Modify the parameters before running the command.</p><pre>aws ecr batch-delete-image --repository-name myecr376 --image-ids imageTag=latest --region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2a5co4MnG8YVwAtV.png" /></figure><p>Delete image from ECR</p><p><em>Ref: </em><a href="https://docs.aws.amazon.com/cli/latest/reference/ecr/batch-delete-image.html"><em>batch-delete-image — AWS CLI 1.25.20 Command Reference (amazon.com)</em></a></p><p>…………………………………………………………………………</p><p>Here are some more references to follow -</p><p><a href="https://aws.amazon.com/ecr/"><em>Fully Managed Container Registry — Amazon Elastic Container Registry — Amazon Web Services</em></a></p><p><a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html"><em>Amazon ECR private registry — Amazon ECR</em></a></p><p><a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html"><em>Using Amazon ECR with the AWS CLI — Amazon ECR</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87e01af2676d" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/how-to-operate-amazon-ecr-with-aws-cli-87e01af2676d">How to operate Amazon ECR with AWS CLI</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Amazon EKS cluster with Fargate-Linux nodes through eksctl]]></title>
            <link>https://souravkarmakar96.medium.com/deploy-amazon-eks-cluster-with-fargate-linux-nodes-through-eksctl-49ebd38036f5?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/49ebd38036f5</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[eksctl]]></category>
            <category><![CDATA[eks-fargate]]></category>
            <category><![CDATA[kubectl]]></category>
            <category><![CDATA[amazon-eks]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Wed, 22 Jun 2022 15:05:30 GMT</pubDate>
            <atom:updated>2022-06-22T15:05:30.956Z</atom:updated>
            <content:encoded><![CDATA[<h4>Follow this tutorial to configure EKS cluster with eksctl tool.</h4><p>Fargate provides you on-demand, right sized compute capacity for containers in AWS. EKS integrates with AWS Fargate. You don’t have to provision, manage and scale group of virtual machines to run your containerized application, just use EKS Fargate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*bhfeycPBOX6JCewUbB2wzw.png" /></figure><p><strong>Prerequisites:</strong><br>1. <strong>eksctl </strong>— command line tool for creating and managing Kubernetes Cluster on Amazon EKS. It automates most of the tasks for deploying EKS. Click here to see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html">installation guide of eksctl. </a><br>2. <strong>kubectl</strong> — command line tool for managing Kubernetes cluster. See, <a href="https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html">how to install kubectl</a>.<br>3. <strong>IAM permissions</strong> to deploy and manage EKS cluster.</p><h3>Deploy EKS Cluster:</h3><p>Modify and use the below command to deploy the cluster-</p><pre>eksctl create cluster --name myDemoEKS \<br>--region us-east-1 \<br>--fargate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bk-YFwrZjkeKnWJboNoIJA.png" /><figcaption>EKS with Fargate nodes deployment with eksctl</figcaption></figure><p>This will take a few minutes to deploy the cluster.</p><p>You will find the Cloud Formation template in the console that is used in the background to deploy the cluster -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQB-UZXr9ZqVbE5Ljz1-wQ.png" /></figure><p>Now that our cluster is deployed, lets check the nodes -</p><pre>kubectl get nodes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-FwVdmW1711JB7pCCTl1qA.png" /></figure><p>Great. Your cluster is now ready for container deployments.</p><h4>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — -</h4><h3>Create a cluster using config file:</h3><p>Save the below text as myFargateCluster.yaml</p><pre>apiVersion: eksctl.io/v1alpha5<br>kind: ClusterConfig<br>metadata:<br>  name: fargate-cluster<br>  region: ap-northeast-1<br>nodeGroups:<br>  - name: ng-1<br>    instanceType: m5.large<br>    desiredCapacity: 1<br>fargateProfiles:<br>  - name: fp-default<br>    selectors:<br>      - namespace: default<br>      - namespace: kube-system</pre><p>Run the below command to deploy the cluster:</p><pre>eksctl create cluster -f myFargateCluster.yaml</pre><p>For more information follow this — <a href="https://eksctl.io/usage/fargate-support/">EKS Fargate Support — eksctl</a></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>Delete the EKS Cluster:</h3><pre>eksctl delete cluster --name myDemoEKS --region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YRGFDuM8SndmaoixjxtDQA.png" /><figcaption>Delete EKS cluster</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49ebd38036f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Route 53 Private Hosted Zone and DNS resolution within VPC]]></title>
            <link>https://souravkarmakar96.medium.com/route-53-private-hosted-zone-and-dns-resolution-within-vpc-75a1efb45610?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/75a1efb45610</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[private-dns]]></category>
            <category><![CDATA[route-53]]></category>
            <category><![CDATA[private-hosted-zone]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Sun, 14 Nov 2021 06:27:25 GMT</pubDate>
            <atom:updated>2021-11-14T06:27:25.143Z</atom:updated>
            <content:encoded><![CDATA[<p>We have the below architecture in AWS, where two EC2 instances can communicate with each other by their private DNS name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*vWkjRsYm6oemDQlSPb7KLw.png" /></figure><p>The architecture consist of below components:<br>1. VPC with two subnets. (one public subnet, another private subnet)<br>2. Two EC2 instances. (a. primary-ec2 on the public subnet, it has public IP.<br> b. secondary-ec2 on the private subnet )<br>3. Route 53 Private Hosted Zone.</p><h4>You can follow this tutorial to setup the VPC and EC2 instances -</h4><p><a href="https://aws.plainenglish.io/amazon-ec2-with-cli-deploy-ec2-instance-in-a-custom-vpc-494fbb9b566f">Amazon EC2 with CLI: Deploy EC2 Instance in a Custom VPC</a></p><h4>Let’s setup the Private Hosted Zone :</h4><p>Before you create the Private Hosted Zone, make sure that your VPC has both the <strong>DNS hostnames</strong> and <strong>DNS support </strong>options enabled.</p><p><strong>Step 1:</strong> Go to the AWS Console&gt; Route 53&gt; Hosted Zones.<br><strong>Step 2:</strong> Create a new hosted zone.<br><strong>Step 3:</strong> Provide the domain name and description, choose Private Hosted Zone, select the region where your VPC resides and select the VPC ID.<br><strong>Step 4:</strong> Click on create hosted zone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*gtmTalZOUqYbcAlkteTsXA.png" /><figcaption>Route 53 Private Hosted Zone Configuration</figcaption></figure><p><strong>Step 5:</strong> Add A records for the EC2 instances.</p><p>Get the Private IP of primary-ec2. Provide a Record name, select Record type ‘A’, put the Private IP on the Value, set TTL and select ‘Simple routing’ as the Routing policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iaFkhI7Toihp19Oc8gQGdQ.png" /></figure><p>Similarly add another A record for the secondary-ec2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlwGpctpuXnZxDGo7fP0Qw.png" /></figure><h4>Now, it’s time to check.</h4><p>Log into the primary-ec2 and do nslookup with the secondary-ec2’s private DNS name. You should get the private IP address of the secondary-ec2 as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*4jm79AOqIKxs_z9j_vzQlA.png" /></figure><p>Or you can ping the secondary-ec2 by the DNS name (secondary-ec2.demopvtzone.com) from the primary-ec2. (Make sure that you have ICMP protocol enabled in the Security Group Inbound rules of the secondary-ec2)</p><p>— — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Thank you for reading this. Have a great day.</p><p>Here are some other tutorials you may like -</p><ul><li><a href="https://medium.com/@souravkarmakar96/ec2-auto-scaling-simple-scaling-policy-with-aws-cli-2dad6db3cfa3">EC2 Auto Scaling Group Simple Scaling policy with AWS CLI</a></li><li><a href="https://medium.com/@souravkarmakar96/configure-ec2-auto-scaling-target-tracking-policy-with-aws-cli-9cf05b2a8747">EC2 Auto Scaling Target Tracking Policy with AWS CLI</a></li><li><a href="https://medium.com/@souravkarmakar96/aws-codecommit-with-cli-and-git-28250730b087">AWS CodeCommit with CLI and GIT</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75a1efb45610" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Route 53 Private Hosted Zone configuration with AWS CLI]]></title>
            <link>https://towardsaws.com/route-53-private-hosted-zone-configuration-with-aws-cli-cb36ef896a3d?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb36ef896a3d</guid>
            <category><![CDATA[private-hosted-zone]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[route-53]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-cli]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Mon, 08 Nov 2021 20:27:02 GMT</pubDate>
            <atom:updated>2021-11-11T09:39:55.709Z</atom:updated>
            <content:encoded><![CDATA[<p>This tutorial will help you to create, manage and associate Route53 Private Hosted Zones with VPC using CLI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*9sym36OrioWl1SfpR2WgkA.png" /></figure><p>Here are the list of task we will perform:<br><strong>1. Create new Private Hosted Zone<br>2. Create a simple record set in the Private Hosted Zone<br>3. Delete the Private Hosted Zone</strong></p><blockquote><strong>Prerequisites:</strong><br>* IAM permissions to perform the operations.<br>* AWS CLI.<br>* AWS VPC with DNS Hostname and DNS Support <em>settings enabled</em>.</blockquote><p>Use the below command to enable DNS Hostname and DNS Support settings of the VPC if not enabled previously.</p><pre><strong>#Enable DNS Hostnames</strong><br>aws ec2 modify-vpc-attribute --enable-dns-hostnames \<br>--vpc-id &lt;enter-vpc-id&gt;</pre><pre><strong>#Enable DNS Support<br></strong>aws ec2 modify-vpc-attribute --enable-dns-support \<br>--vpc-id &lt;enter-vpc-id&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUrLaZlr_jqoKk1UZIam4w.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — —</p><h4>1. Create new Private Hosted Zone</h4><p>Use the below command to create a new Hosted Zone.</p><pre><strong>#Create Private Hosted Zone and associate to a VPC</strong><br>aws route53 create-hosted-zone --name demopvtzone.com \<br>--caller-reference &lt;any unique string&gt;\<br>--hosted-zone-config Comment=&#39;using cli&#39;<strong>,</strong>PrivateZone=true \<br>--vpc VPCRegion=&lt;enter-vpc-region&gt;<strong>,</strong>VPCId=&lt;enter-vpc-id&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NocanoahbzWNnBpVqObzkw.png" /><figcaption>Route 53 Private Hosted Zone creation</figcaption></figure><p>Note: When you’re creating a private hosted zone , you must also specify values for <em>VPCId</em> and <em>VPCRegion</em>. Provide a unique string for <em>caller-reference. </em>This<em> </em>identifies the request and allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. For example, you can use date/time stamp.</p><p>— — — — — — — — — — — — — — — — — — — — — — — —</p><h4>2. Create a simple record set to the Private Hosted Zone</h4><p>You can perform the following actions using a ChangeResourceRecordSets request:<br>1. <strong>CREATE</strong> creates a record set with a specified value.<br>2. <strong>DELETE</strong> deletes a record set with a specified value.<br>3. <strong>UPSERT</strong> either creates a new record set with a specified value, or updates a record set with a specified value if that record set already exists.</p><p><strong>Example of record creation:</strong></p><p>Modify and save the below json file(MyRecordSet.json) that will be used to create a simple A record set.</p><pre>{<br>    &quot;Comment&quot;: &quot;Create a new A record &quot;,<br>    &quot;Changes&quot;: [{<br>        &quot;Action&quot;: &quot;CREATE&quot;,<br>        &quot;ResourceRecordSet&quot;: {<br>            &quot;Name&quot;: &quot;a.demopvtzone.com&quot;,<br>            &quot;Type&quot;: &quot;A&quot;,<br>            &quot;TTL&quot;: 300,<br>        &quot;ResourceRecords&quot;: [{ &quot;Value&quot;: &quot;192.168.0.5&quot;}]<br>        }<br> }]<br>}</pre><p><strong>Run the below command to add the new record:</strong></p><pre><strong>#Add record set to Route53 Private Hosted Zone</strong><br>aws route53 change-resource-record-sets \<br>--hosted-zone-id &lt;hosted-zone-id&gt; \<br>--change-batch file://MyRecordSet.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*LxbRsonQcgFKT6tzlGi5-w.png" /><figcaption>Add a Record Set to Private Hosted Zone</figcaption></figure><p>Check the status:</p><pre>aws route53 get-change --id /change/C02904521SYX4JAFMKGE8</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AX6Fl73qP9Ns4O30HMzCyA.png" /></figure><p>Similarly modify the “Action”: “CREATE” to “DELETE” or “UPSERT” in the json file and update the record set according to your needs.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — —</p><h4><strong>3. Delete the Private Hosted Zone</strong></h4><p>Before you delete the Private Hosted Zone, first delete all the record sets that you have created.</p><p>For example: Delete the A record that we previously created.</p><p>Save the below text in a json file called DeleteRecordSet.json.</p><pre>{<br>    &quot;Comment&quot;: &quot;CREATE/DELETE/UPSERT a record &quot;,<br>    &quot;Changes&quot;: [{<br>        &quot;Action&quot;: &quot;DELETE&quot;,<br>        &quot;ResourceRecordSet&quot;: {<br>            &quot;Name&quot;: &quot;a.demopvtzone.com&quot;,<br>            &quot;Type&quot;: &quot;A&quot;,<br>            &quot;TTL&quot;: 300,<br>        &quot;ResourceRecords&quot;: [{ &quot;Value&quot;: &quot;192.168.0.5&quot;}]<br>        }<br> }]<br>}</pre><p>Run the below command to delete the record set.</p><pre>aws route53 change-resource-record-sets \<br>--hosted-zone-id &lt;hosted-zone-id&gt; \<br>--change-batch file://DeleteRecordSet.json</pre><p><strong>Now use the below command to delete the Private Hosted Zone:</strong></p><pre>aws route53 delete-hosted-zone --id &lt;hosted-zone-id&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pPuhohhRQl28SKBtHZXqSg.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Thank you for reading this. Have a great day.</p><p>Also read my other stories -</p><ul><li><a href="https://aws.plainenglish.io/sqs-with-aws-sdk-for-python-boto3-on-ec2-85d343ba0a49">Access SQS with AWS SDK for Python (Boto3) from EC2</a></li><li><a href="https://medium.com/@souravkarmakar96/ec2-auto-scaling-simple-scaling-policy-with-aws-cli-2dad6db3cfa3">EC2 Auto Scaling Group Simple Scaling policy with AWS CLI</a></li><li><a href="https://medium.com/@souravkarmakar96/configure-ec2-auto-scaling-target-tracking-policy-with-aws-cli-9cf05b2a8747">EC2 Auto Scaling Target Tracking Policy with AWS CLI</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb36ef896a3d" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/route-53-private-hosted-zone-configuration-with-aws-cli-cb36ef896a3d">Route 53 Private Hosted Zone configuration with AWS CLI</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS CodeCommit with CLI and GIT]]></title>
            <link>https://souravkarmakar96.medium.com/aws-codecommit-with-cli-and-git-28250730b087?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/28250730b087</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[repositories]]></category>
            <category><![CDATA[aws-codecommit]]></category>
            <category><![CDATA[aws-cloud]]></category>
            <category><![CDATA[aws-cli]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Thu, 28 Oct 2021 17:09:25 GMT</pubDate>
            <atom:updated>2021-10-28T17:11:54.398Z</atom:updated>
            <content:encoded><![CDATA[<p>This tutorial will help you configure the necessary things required to work with CodeCommit from CLI. Also you will learn how to install Git and access the CodeCommit Repo from Git.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*d3extyxDpxoxfPpt3gtNfQ.png" /></figure><p>We will perform the following actions — <br>1. <strong>Configure CLI for programmatic AWS access.</strong><br>2. <strong>Create a CodeCommit repository.</strong><br>3. <strong>Upload sample file to the repository.</strong><br>4. <strong>Generate the HTTPS Git credentials for AWS CodeCommit.</strong><br>5. <strong>Install git.</strong><br>6. <strong>Clone the created repository from CodeCommit to your machine.</strong><br>7. <strong>Create a new file and push the changes to CodeCommit repository.</strong></p><p><strong>Prerequisites:<br></strong>1. Install AWS CLI . Follow this to <a href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html">Install AWS CLI</a>.<br>2. IAM permissions to create and manage CodeCommit repository.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Configure CLI for programmatic AWS access:</h4><pre>aws configure</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*el_PkAxjQF67YeNqFLP9xQ.png" /><figcaption>Configure the CLI for programmatic access to AWS</figcaption></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Create a CodeCommit Repository:</h4><p>Run the below command to create a repository.</p><pre><strong>#Modify the name and description before execution</strong><br>aws codecommit create-repository \<br>    --repository-name myCodeRepo791 \<br>    --repository-description &quot;CodeCommit Demo repository&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XhP0CJIpHLXa2JQx8uDxZw.png" /><figcaption>CodeCommit repository creation</figcaption></figure><p>Go to the <strong>AWS Console</strong>, open <strong>CodeCommit &gt; Repositories</strong>. You will be able to find the newly created repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fQ5YJub56QViyPCNIjqKFw.png" /></figure><p>Copy the HTTPS URL. This URL will be used later.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Upload a sample file to the repository:</h4><ol><li>Click on the <strong>myCodeRepo791</strong> repository to open it.</li><li>Click <strong>Add file</strong> &gt; <strong>Upload file</strong>.</li><li>Click <strong>Choose file</strong>.</li><li>Select a sample file from your machine.</li><li>Enter your name as author name and your email as the email address.</li><li>Click <strong>Commit changes</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ceMGkJIwy1OJcBsh8hJkJA.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Generate the HTTPS Git credentials for AWS CodeCommit:</h4><p>Go to the AWS Console&gt;IAM&gt;Users&gt; Click on your identity. <br>Scroll down to the section ‘HTTPS Git credentials CodeCommit’ and Click on Generate Credentials. Save the credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XZfgOsSpdiGbsifXRXlEXg.png" /><figcaption>Generate HTTPS Git credentials for CodeCommit</figcaption></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Install git.</h4><p>Use the below command to install git on Amazon Linux 2 machine.</p><pre>sudo yum install git -y</pre><p>Follow this if you are using other machines. <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">Git — Installing Git (git-scm.com)</a></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Clone the repository to your machine.</h4><p>Run the following command to clone the repository to your machine.</p><pre>git clone [Paste the Cloned URL]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pbP1fgqo_JVYYvmDXJe_bQ.png" /><figcaption>Clone git repo</figcaption></figure><p>Provide the username and password. You will get it from the downloaded csv file that was previously generated from IAM console.</p><p>See the file and folders. <strong>myCodeRepo791</strong> has been cloned to local system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5dcK5-Uq77JgbMsj8vuzPQ.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Create a new file and push the changes to CodeCommit repository:</h4><p>Run the following command to create a text file.</p><pre>vim LocalSampleFile.txt</pre><p>Press i to enter insert mode and type any text. Hit the <strong>Escape</strong> key, type :wq!, and press <strong>Enter.</strong></p><p><strong>Add the file to Git.</strong></p><pre>git add LocalSampleFile.txt</pre><p><strong>Commit the file to the local repository.</strong></p><pre>git commit -m &quot;added LocalSampleFile.txt&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsKtAeVgXL1D_tVMrUoOjA.png" /></figure><p><strong>Verify the commit, see logs.</strong></p><pre>git log</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-CzQfYxSwLyZyGTepnmfBg.png" /></figure><p><strong>Push the change to the CodeCommit repository.</strong></p><pre>git push -u origin main</pre><p>Enter the Git credential username and password. Find it from the credential file downloaded earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4C5Aph1hZOlDUxqG5eoyA.png" /><figcaption>Push to CodeCommit</figcaption></figure><p>Go to the CodeCommit repository refresh it and you will be able to see the newly added file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xlnb92tDNoaJ8uUZjQ0nFg.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Thanks for your time. Enjoy :)</p><p>Have a look at my other blogs -</p><ul><li><a href="https://aws.plainenglish.io/sqs-with-aws-sdk-for-python-boto3-on-ec2-85d343ba0a49">Access SQS with AWS SDK for Python (Boto3) from EC2</a></li><li><a href="https://medium.com/@souravkarmakar96/configure-ec2-auto-scaling-target-tracking-policy-with-aws-cli-9cf05b2a8747">EC2 Auto Scaling Target Tracking Policy with AWS CLI</a></li><li><a href="https://medium.com/@souravkarmakar96/ec2-auto-scaling-simple-scaling-policy-with-aws-cli-2dad6db3cfa3">EC2 Auto Scaling Group Simple Scaling policy with AWS CLI</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28250730b087" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EC2 Auto Scaling Group Simple Scaling policy with AWS CLI]]></title>
            <link>https://souravkarmakar96.medium.com/ec2-auto-scaling-simple-scaling-policy-with-aws-cli-2dad6db3cfa3?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2dad6db3cfa3</guid>
            <category><![CDATA[aws-cli]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[auto-scaling-groups]]></category>
            <category><![CDATA[aws-cloud]]></category>
            <category><![CDATA[aws-auto-scaling]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Thu, 28 Oct 2021 10:29:45 GMT</pubDate>
            <atom:updated>2021-10-28T10:33:32.446Z</atom:updated>
            <content:encoded><![CDATA[<p>Here I will show you how to configure Simple Scaling Policy for EC2 Auto Scaling Group with AWS CLI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4lQj_u666yzYhFwblLoX9A.png" /><figcaption>Simple Scaling Policy with CloudWatch alarms</figcaption></figure><p>Amazon EC2 Auto Scaling Group supports 3 types of dynamic scaling --<br><strong>1. Target Tracking Scaling<br>2. Simple Scaling<br>3. Step Scaling</strong></p><h4>Simple Scaling:</h4><p>Simple scaling policy allows you to define CloudWatch alarms based on which scale in/out is triggered. Instances can be added or removed from the Auto Scaling Group or can be set to achieve a desired capacity with each alarms action.</p><p>Here I will configure the scale out and scale in for high CPU usage alert and low CPU usage alert respectively.</p><h3>Let’s start -</h3><h4>Step 1: Create an EC2 Launch Template</h4><pre><strong>#Please modify the parameters before execution</strong></pre><pre>aws ec2 create-launch-template \<br>     --launch-template-name AutoScaleLaunchTemplate \<br>     --version-description Version_1 \<br>     --region us-east-1 \<br>     --launch-template-data &#39;{ &quot;NetworkInterfaces&quot;: [{ &quot;DeviceIndex&quot;: 0, &quot;Groups&quot;: [&quot;sg-05e7a69c323bdd40f&quot;] }], &quot;ImageId&quot;: &quot;ami-02e136e904f3da870&quot;, &quot;InstanceType&quot;: &quot;t2.micro&quot;, &quot;KeyName&quot;: &quot;EC2KeyPair&quot; }&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*__W9-Cu5tcZuV7h4njgexg.png" /></figure><h4>Step 2: Deploy the Auto Scaling Group</h4><pre><strong>#Please modify the parameters before execution</strong></pre><pre>aws autoscaling create-auto-scaling-group \<br>     --auto-scaling-group-name DemoAutoScalingGroup \<br>     --launch-template LaunchTemplateId=lt-0e321233cce2818d2 \<br>     --min-size 1 \<br>     --max-size 4\<br>     --vpc-zone-identifier &quot;subnet-00db35de81dff856b,subnet-0c4c6c468be60a37f,subnet-08b515f135d99437e&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZA3aPv5tFueNIuFGdFrzuQ.png" /><figcaption>EC2 Auto Scaling Group created</figcaption></figure><h4>Step 3: Configure the Simple Scaling policies</h4><p>Execute the below script to set a scale out policy. It will increase the capacity of the auto scaling group by 1.</p><pre><strong>#Scale out policy</strong> <br>aws autoscaling put-scaling-policy \<br>    --policy-name demoSimpleScaleOutPolicy \<br>    --auto-scaling-group-name DemoAutoScalingGroup \<br>    --scaling-adjustment +1 \<br>    --adjustment-type ChangeInCapacity</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZ6sgvzL2QhW-yYzpVGuMw.png" /></figure><p>Execute the below script to set a scale in policy. It will decrease the capacity of the auto scaling group by 1.</p><pre><strong>#Scale in policy<br></strong>aws autoscaling put-scaling-policy \<br>    --policy-name demoSimpleScaleInPolicy \<br>    --auto-scaling-group-name DemoAutoScalingGroup \<br>    --scaling-adjustment -1 \<br>    --adjustment-type ChangeInCapacity \<br>    --cooldown 180</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uusv0U3Q4-RA7WPWHYWROA.png" /></figure><p>Copy the both Policy ARN, will be used in the next steps.</p><h4>Step 4: Create and associate CloudWatch alarms with the policies</h4><p>Below script will create a CloudWatch alarm which will be triggered if the Average CPU utilization of the Auto Scaling Group goes above or at 70% for at least 3 consecutive evaluation periods of 3 minutes. Scale out policy will be in action whenever this alarm gets triggered.</p><pre><strong>#CloudWatch Alarm for scale out</strong><br>aws cloudwatch put-metric-alarm \<br>    --alarm-name SimpleScalingAlarmHighAddCapacity \<br>    --metric-name CPUUtilization \<br>    --namespace AWS/EC2 --statistic Average \<br>    --period 180 --evaluation-periods 3 --threshold 70 \<br>    --comparison-operator GreaterThanOrEqualToThreshold \<br>    --dimensions &quot;Name=AutoScalingGroupName, Value=DemoAutoScalingGroup&quot; \<br>    --alarm-actions &quot;arn:aws:autoscaling:us-east-1:XXXXYYYYZZZZZ:scalingPolicy:43ed4879-a778-41d5-8e51-53740bc7c7c7:autoScalingGroupName/DemoAutoScalingGroup:policyName/demoSimpleScaleOutPolicy&quot;</pre><p>Below script will create a CloudWatch alarm which will be triggered if the Average CPU utilization of the Auto Scaling Group goes below or at 50% for at least 3 consecutive evaluation periods of 3 minutes. Scale in policy will be in action whenever this alarm gets triggered.</p><pre><strong>#CloudWatch Alarm for scale in</strong><br>aws cloudwatch put-metric-alarm \<br>    --alarm-name SimpleScalingAlarmHighRemoveCapacity \<br>    --metric-name CPUUtilization \<br>    --namespace AWS/EC2 --statistic Average \<br>    --period 180 --evaluation-periods 3 --threshold 50 \<br>    --comparison-operator LessThanOrEqualToThreshold \<br>    --dimensions &quot;Name=AutoScalingGroupName, Value=DemoAutoScalingGroup&quot; \<br>    --alarm-actions &quot;arn:aws:autoscaling:us-east-1:XXXXYYYYZZZZ:scalingPolicy:3ea5a0cf-14e5-40d3-82b3-b02159464bae:autoScalingGroupName/DemoAutoScalingGroup:policyName/demoSimpleScaleInPolicy&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NMl8xmv4BwQ2otOjrVt6dA.png" /><figcaption>Simple Scaling Policies configured</figcaption></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Thank you for reading this. Enjoy and also read my other blogs of EC2 Auto Scaling setup with AWS CLI.</p><ul><li><a href="https://medium.com/@souravkarmakar96/configure-scheduled-scaling-actions-for-ec2-auto-scaling-group-with-aws-cli-c87c0dd6edbc">Configure Scheduled Scaling Actions for EC2 Auto Scaling Group with AWS CLI</a></li><li><a href="https://medium.com/@souravkarmakar96/configure-ec2-auto-scaling-target-tracking-policy-with-aws-cli-9cf05b2a8747">EC2 Auto Scaling Target Tracking Policy with AWS CLI</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dad6db3cfa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure Scheduled Scaling Actions for EC2 Auto Scaling Group with AWS CLI]]></title>
            <link>https://aws.plainenglish.io/configure-scheduled-scaling-actions-for-ec2-auto-scaling-group-with-aws-cli-c87c0dd6edbc?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c87c0dd6edbc</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws-auto-scaling]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Wed, 27 Oct 2021 16:40:06 GMT</pubDate>
            <atom:updated>2021-11-01T01:40:08.944Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Configure Scheduled Scaling Actions for EC2 Auto Scaling Group with AWS CLI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HRqqmVoU8ZOL1lWk" /><figcaption>Photo by <a href="https://unsplash.com/@lordarcadius?utm_source=medium&amp;utm_medium=referral">Vipul Jha</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this tutorial, I will guide you to deploy EC2 Auto Scaling Group and configure scheduled scaling actions with AWS CLI.</p><p><strong>Scheduled Scaling :</strong><br>Scheduled Scaling Actions helps you to scale in/out instances in your Auto Scaling Group according to your scheduled time.</p><p>Here are the steps that we are going to perform to set up scheduled scaling -<br><strong>1. Create an EC2 Launch Template<br>2. Deploy the Auto Scaling Group<br>3. Configure Scheduled Scaling actions</strong></p><h3>Let’s Begin</h3><p><strong><em>Prerequisites:</em></strong><em><br>* IAM permissions to create and manage EC2 auto-scaling groups.<br>* AWS CLI and programmatic access to AWS.<br>* A VPC with subnets, EC2 Key Pair, Security Group</em></p><h4><strong>Step 1: Create an EC2 Launch Template</strong></h4><pre>{<br>    &quot;NetworkInterfaces&quot;: [{<br>        &quot;DeviceIndex&quot;: 0,<br>        &quot;Groups&quot;: [&quot;sg-00f989ab694dce84b&quot;]<br>    }],<br>    &quot;ImageId&quot;: &quot;ami-02e136e904f3da870&quot;,<br>    &quot;InstanceType&quot;: &quot;t2.micro&quot;,<br>    &quot;KeyName&quot;: &quot;myKeyPair&quot;<br>}</pre><p>Save the above text as a JSON file. Name it LaunchTemplate.json.<br>Modify the Security Group id, Image ID, Instance Type and Key Pair name accordingly.</p><p><strong>Run the below command to create the Launch Template.</strong></p><pre>aws ec2 create-launch-template \<br>     --launch-template-name AutoScaleLaunchTemplate \<br>     --version-description Version_1 \<br>     --launch-template-data file://LaunchTemplate.json \<br>     --region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*Ygcwc7mkw0DLZYwqo_FKsw.png" /><figcaption>EC2 Launch template creation</figcaption></figure><h4>Step 2: Deploy the Auto Scaling Group</h4><p><strong>Modify the parameters and Run this command to deploy the Auto Scaling Group.</strong></p><pre>aws autoscaling create-auto-scaling-group \<br>     --auto-scaling-group-name EC2AutoScalingGroup \<br>     --launch-template LaunchTemplateId=lt-03661925d91c1cea7 \<br>     --min-size 1 \<br>     --max-size 5 \<br>     --vpc-zone-identifier &quot;subnet-0960629201cddd260&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*Bq22hMBphINtRrdKlxgfCQ.png" /><figcaption>Deploy the Auto Scaling Group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r78szZpRAjRKpjDB6Qgqig.png" /><figcaption>See the Auto Scaling Group from Console</figcaption></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Step 3: Configure Scheduled Scaling Actions</h4><p>Two types of schedules can be configured:<br>a. one-time scaling actions<br>b. recurring scaling actions</p><h4>a. Create a Scheduled Action that Occurs Only Once:</h4><pre><strong>#Use this to scale out one time only<br></strong>aws autoscaling put-scheduled-update-group-action \<br>    --scheduled-action-name oneTimeScheduledScaleOutAction \<br>    --auto-scaling-group-name EC2AutoScalingGroup \<br>    --start-time &quot;2021-10-28T10:00:00Z&quot; \<br>    --desired-capacity 4</pre><p>If the group has fewer than 4 instances at the date and time specified for --start-time (10:00 AM UTC on Oct 28, 2021) then it scales out to 4 instances.</p><pre><strong>#Use this to scale in one time only<br></strong>aws autoscaling put-scheduled-update-group-action \<br>    --scheduled-action-name oneTimeScheduledScaleInAction \<br>    --auto-scaling-group-name EC2AutoScalingGroup \<br>    --start-time &quot;2021-10-28T18:00:00Z&quot; \<br>    --desired-capacity 1</pre><p>If the group has more than 1 instance at the date and time specified for --start-time (6:00 PM UTC on Oct 28, 2021) then it scales in to 1 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*outD6OKxim8m0lVO87IcyA.png" /><figcaption>Configure one time scheduled actions</figcaption></figure><h4>b. Create a Scheduled Action that Runs on a Recurring Schedule</h4><pre>aws autoscaling put-scheduled-update-group-action \<br>    --scheduled-action-name RecurringScheduledAction \<br>    --auto-scaling-group-name EC2AutoScalingGroup \<br>    --recurrence &quot;0 10 * * 1-5&quot; \<br>    --time-zone &quot;Asia/Calcutta&quot; \<br>    --desired-capacity 3</pre><p>The above script can be used for recurring scaling. It initiates auto-scaling every Monday through Friday at 10 AM Asia/Calcutta time. If the capacity is below 3 then it will increase the desired capacity to 3. If the capacity is higher than 3 then it will decrease the desired capacity to 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*OXHpFqqFajDIoqjpLfYROA.png" /><figcaption>Recurring Schedule Action configuration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UxCvSNvnUMrBN07JSw67fw.png" /><figcaption>Recurring Schedule Action from AWS Console</figcaption></figure><p>Thank you for following this tutorial. Don’t forget to follow me and clap if you find this useful.</p><p><em>More content at </em><a href="http://plainenglish.io/"><em>plainenglish.io</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c87c0dd6edbc" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/configure-scheduled-scaling-actions-for-ec2-auto-scaling-group-with-aws-cli-c87c0dd6edbc">Configure Scheduled Scaling Actions for EC2 Auto Scaling Group with AWS CLI</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EC2 Auto Scaling Target Tracking Policy with AWS CLI]]></title>
            <link>https://souravkarmakar96.medium.com/configure-ec2-auto-scaling-target-tracking-policy-with-aws-cli-9cf05b2a8747?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cf05b2a8747</guid>
            <category><![CDATA[auto-scaling-groups]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws-cli]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Sun, 24 Oct 2021 19:44:48 GMT</pubDate>
            <atom:updated>2021-10-24T20:02:37.048Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s setup the Target Tracking auto scale policy with AWS CLI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*CJqPA8wup7OA09R6bCWDAQ.png" /></figure><h4>EC2 Auto Scaling Groups support the below types of scaling -</h4><p>1. <strong>Dynamic Scaling</strong>- scale instances dynamically based on certain criteria.<br>This three types of policy can be configured for dynamic scaling —</p><p><strong>a. Target tracking scaling <br></strong>This policy helps you to select a scaling metric and set a specific threshold. Amazon EC2 auto scaling group will scale in/out in such a way that it can keep the metric at or close to the target threshold value.</p><p><strong>b. </strong><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html"><strong>Simple scaling</strong> </a><br><strong>c. </strong><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html"><strong>Step scaling</strong></a></p><p>2. <strong>Predictive Scaling</strong>- scale instances based on daily or weekly traffic flow patterns.</p><p>3. <strong>Scheduled Scaling</strong>- scale instances at a scheduled time.</p><h3>Here I will show how to configure Target Tracking Scaling policy for EC2 Auto Scaling Group-</h3><blockquote><strong>Prerequisites:</strong><br>* Enough IAM permissions to create and manage EC2 auto scaling groups.<br>* AWS CLI and programmatic access to AWS.<br>* A VPC with subnets, EC2 Key Pair, Security Group</blockquote><h3>Let’s begin —</h3><p><strong>Modify the below parameters and save it in a json file named <em>LaunchTemplateData.json .</em></strong></p><pre>{<br> &quot;NetworkInterfaces&quot;: [{<br>     &quot;DeviceIndex&quot;: 0,<br>     &quot;AssociatePublicIpAddress&quot;: true,<br>     &quot;Groups&quot;: [&quot;sg-035766790e94c0bfb&quot;],<br>     &quot;DeleteOnTermination&quot;: true<br> }],<br> &quot;ImageId&quot;: &quot;ami-02e136e904f3da870&quot;,<br> &quot;InstanceType&quot;: &quot;t2.micro&quot;,<br> &quot;KeyName&quot;: &quot;EC2AutoScaleKeyPair&quot;,<br> &quot;TagSpecifications&quot;: [{<br>     &quot;ResourceType&quot;: &quot;instance&quot;,<br>     &quot;Tags&quot;: [{<br>         &quot;Key&quot;: &quot;environment&quot;,<br>         &quot;Value&quot;: &quot;aws-demo&quot;<br>     }]<br>  }]<br>}</pre><p>This file will be used to create an EC2 Launch template. This is where we provide the basic information required to launch an EC2 instance. Such as AMI ID, Network Interface configuration, Public IP association, Security Groups, EC2 Key Pair details, tags etc. The Image ID we have used is of Amazon Linux 2.</p><h3><strong>Step 1: Create a Launch Template.</strong></h3><pre>aws ec2 create-launch-template \<br>     --launch-template-name myDemoLaunchTmplate \<br>     --version-description Version_1 \<br>     --launch-template-data file://LaunchTemplateData.json \<br>     --region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*ioUeuPGzFCUl8h1LHHxGIw.png" /><figcaption>EC2 Launch template creation</figcaption></figure><h3>Step 2: Create the Auto Scaling Group.</h3><pre>aws autoscaling create-auto-scaling-group \<br>     --auto-scaling-group-name myDemoAutoScalingGroup \<br>     --launch-template LaunchTemplateId=lt-0e206dda80647818a \<br>     --min-size 1 \<br>     --max-size 3 \<br>     --vpc-zone-identifier &quot;subnet-0e89d7ef8d877451b,subnet-04ea61ef9f93dda63&quot;</pre><p>Modify the parameters and run the above command. This command does not have any output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0nIiQarC4oEcfc8NvadNg.png" /><figcaption>Create auto scaling group</figcaption></figure><p>Verify the auto scaling group from the AWS Console -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CMpy0M9E32fdpLo6AYMIYQ.png" /><figcaption>Auto Scaling Group</figcaption></figure><p>Our Auto Scaling group has min capacity 1 and max 3. So, one instance has been launched when we created the Auto Scaling group.</p><h3>Step 3: Configure Target Tracking Scaling policy</h3><p>The following predefined metrics are available for target tracking policy:<br>1. <strong>ASGAverageCPUUtilization</strong><br>2. <strong>ASGAverageNetworkIn </strong><br>3. <strong>ASGAverageNetworkOut</strong> <br>4. <strong>ALBRequestCountPerTarget</strong></p><p>We are going to configure the policy based on Average CPU utilization of the Auto Scaling Group. If the average CPU percentage goes beyond 70% for a specific time period(here it is 5 minute), Cloud Watch alarm will be triggered which will initiate scale out process.</p><p><strong>Save the below text in a json file named <em>TargetTrackingConfig.json</em>.</strong></p><pre>{<br>&quot;TargetValue&quot;: 70.0,<br>&quot;PredefinedMetricSpecification&quot;: {<br>    &quot;PredefinedMetricType&quot;: &quot;ASGAverageCPUUtilization&quot;<br> }<br>}</pre><p>If you want to configure the policy with some custom matric then use the below format -</p><pre>{<br>   &quot;TargetValue&quot;:70.0,<br>   &quot;CustomizedMetricSpecification&quot;:{<br>      &quot;MetricName&quot;:&quot;CustomUtilizationMetric&quot;,<br>      &quot;Namespace&quot;:&quot;NamespaceOfTheCustomMetric&quot;,<br>      &quot;Dimensions&quot;:[<br>         {<br>            &quot;Name&quot;:&quot;CustomMetricDimensionName&quot;,<br>            &quot;Value&quot;:&quot;CustomMetricDimensionValue&quot;<br>         }<br>      ],<br>      &quot;Statistic&quot;:&quot;Average&quot;,<br>      &quot;Unit&quot;:&quot;Percent&quot;<br>   }<br>}</pre><p><em>Note: Not all metrics work for target tracking policy. For more info see </em><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html"><em>here</em></a><em>.</em></p><p><strong>Run the below command to set the policy with the Auto Scaling Group.</strong></p><pre>aws autoscaling put-scaling-policy \<br>    --policy-name TargetTrackingAutoScalePolicy \<br>    --auto-scaling-group-name myDemoAutoScalingGroup \<br>    --policy-type TargetTrackingScaling \<br>    --target-tracking-configuration file://TargetTrackingConfig.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLr3NElJQ-NS5vO9KxdZSg.png" /><figcaption>Apply auto scaling policy</figcaption></figure><p>The policy has been set. You can see two Cloud Watch alarms are created to track CPU percentage(high, low) metrices. Those alerts will trigger the scale out and scale in process respectively.</p><h4>We are all set. Now let’s see the auto scaling in action.</h4><p>Remember the instance that was launched during the creation of the auto scaling group. Find that from the EC2 console, log into it, install the stress tool and stress the CPU.</p><p>Use below commands to install Stress tool in Amazon Linux 2 instance -</p><pre>sudo amazon-linux-extras install epel -y<br>sudo yum install stress -y</pre><p>Now stress the CPU for 5 mint -</p><pre>sudo stress --cpu  8 --timeout 300</pre><p>After five minutes you will find a new activity in the Auto Scaling Group saying ‘Launching a new EC2 instance’-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YPLxcdbJHUc-Mll09Rs3w.png" /><figcaption>PreInService: Scale out in progress</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*myMa9uAZRzkDCneoyDgrPg.png" /><figcaption>WaitingForInstanceWarmup: Scale out in progress, Instance Count =2, Desired Capacity =2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZVb9qMhWoIm9Kx73LgtVQ.png" /><figcaption>Scaled out successful</figcaption></figure><p>Similarly, wait for few minutes to see scale in process in action. If the average CPU percentage of the Auto Scaling group stays below 70% for a period of time then scale in will be triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*akXE8pkBjww641AJFoYCQQ.png" /><figcaption>Scale in InProgress</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kH7Ohnf8uEzo73iFTW5UDw.png" /><figcaption>Scale in Successful, Instance count, desired capacity will become 1</figcaption></figure><p>Thank you so much for following this. Enjoy :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cf05b2a8747" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn AWS & Earn Rewards — re:Skill, the platform that “pays to learn!”]]></title>
            <link>https://souravkarmakar96.medium.com/learn-aws-earn-rewards-re-skill-the-platform-that-pays-to-learn-18eda67cd5fc?source=rss-434f7749e44b------2</link>
            <guid isPermaLink="false">https://medium.com/p/18eda67cd5fc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[earn]]></category>
            <category><![CDATA[learn-aws]]></category>
            <category><![CDATA[free-reward]]></category>
            <category><![CDATA[aws-reskill]]></category>
            <dc:creator><![CDATA[Sourav Karmakar]]></dc:creator>
            <pubDate>Fri, 15 Oct 2021 10:46:16 GMT</pubDate>
            <atom:updated>2021-11-03T07:35:17.411Z</atom:updated>
            <content:encoded><![CDATA[<h3>Learn AWS &amp; Earn Rewards — re:Skill, the platform that “pays to learn!”</h3><h4>Get free Amazon Gift Vouchers, T-Shirts and more exciting rewards</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tyau_zPp_ihYgQaN3uV0hg.png" /></figure><p>Yeah, it’s true. re:Skill is the platform for AWS seekers where you can learn AWS, win rewards by participating in quiz, connect to AWS experts and many more things. <em>(Participation is limited to Indian citizens currently residing in India)</em></p><h3>What are you waiting for ? Sign up now.</h3><blockquote>Click below to <strong>join re:Skill.</strong></blockquote><p><a href="https://awsreskill.com/signup?source=bfdf9e20&amp;medium=direct">Signup - re:Skill</a></p><h3><strong>Challenges:</strong></h3><p>Take challenges, crack it and earn points. They host weekly, monthly and quarterly quizzes. You will get points on passing each challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*113pfAD29HDmfeToDQw5EQ.png" /></figure><p>Points that you earn can be used to redeem amazon gift vouchers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qkttRBeu89jZSol0langkw.png" /></figure><p>Top 200 monthly winners are also rewarded with the below prizes -<br> &gt; Ranks 1 to 3 — Alexa Echo Dot<br> &gt; Ranks 4 to 53 — re:Skill T-shirt<br> &gt; Ranks 1 to 200 — Certificate of Participation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*CptzOqaEuY_uke9roM7QIg.png" /></figure><h3>Learn:</h3><p>Each challenge comes with one or more educational videos. You can go through them and learn new things every week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJWYDJU88M-mhQ0pfxpb2w.png" /></figure><h3><strong>Study Groups:</strong></h3><p>Are you preparing for AWS certification?<br>If yes, then you should join the relevant study group which will help you prepare for the certifications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBhDBFFDdnvz_slmPr4hZg.png" /></figure><p>You also can connect with AWS experts for any technical or the community related queries.</p><p>Hurry up, don’t waste time. <strong>Join </strong><a href="https://awsreskill.com/signup?source=bfdf9e20&amp;medium=direct"><strong>re:Skill</strong></a>. Learn &amp; Earn hand in hand.</p><p>Enjoy and don’t forget to follow me. 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18eda67cd5fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>