<?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 Alexander Sirenko on Medium]]></title>
        <description><![CDATA[Stories by Alexander Sirenko on Medium]]></description>
        <link>https://medium.com/@alexander.sirenko?source=rss-e3c4acda724d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*KjkBKXqZ00U-YbW5.</url>
            <title>Stories by Alexander Sirenko on Medium</title>
            <link>https://medium.com/@alexander.sirenko?source=rss-e3c4acda724d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:05:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alexander.sirenko/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[How to setup AutoScale for ECS service using CDK]]></title>
            <link>https://medium.com/@alexander.sirenko/setup-autoscale-for-ecs-service-using-cdk-39f03cc3f046?source=rss-e3c4acda724d------2</link>
            <guid isPermaLink="false">https://medium.com/p/39f03cc3f046</guid>
            <category><![CDATA[aws-cdk]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <dc:creator><![CDATA[Alexander Sirenko]]></dc:creator>
            <pubDate>Sat, 11 Sep 2021 19:48:37 GMT</pubDate>
            <atom:updated>2021-09-11T22:57:20.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JWVarcJLUwhLGqIm" /><figcaption>Photo by <a href="https://unsplash.com/@ianjbattaglia?utm_source=medium&amp;utm_medium=referral">Ian Battaglia</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you use ECS to run your services, capacity provider and autoscaling rules are working together to ensure your resources are tailored to the demand. If you configure capacity provider to spin up enough instances for existing tasks, then autoscale could expect these tasks to be running on scale out. And capacity provider will shut down instances without tasks running on them when we scale in.</p><pre><strong>public class </strong>Cluster <strong>extends </strong>Construct {</pre><pre>  ...</pre><pre><strong>  private </strong>CfnCapacityProvider createCapacityProvider(<br>        String autoScalingGroupRef, <br>        String capacityProviderName) {<br>    CfnCapacityProvider.ManagedScalingProperty managedScalingProperty = <br>            CfnCapacityProvider.ManagedScalingProperty.<em>builder</em>()<br>                .status(<strong>&quot;ENABLED&quot;</strong>)<br>                .targetCapacity(100)<br>                .maximumScalingStepSize(1)<br>                .build();<br>    CfnCapacityProvider.AutoScalingGroupProviderProperty asgProviderProperty = <br>            CfnCapacityProvider.AutoScalingGroupProviderProperty.<em>builder</em>()<br>                .autoScalingGroupArn(autoScalingGroupRef)<br>                .managedScaling(managedScalingProperty)<br>                .build();<br>    <strong>return </strong>CfnCapacityProvider.Builder.<em>create</em>(<strong>this</strong>, capacityProviderName)<br>            .autoScalingGroupProvider(asgProviderProperty)<br>            .name(capacityProviderName)<br>            .build();<br>  }</pre><pre>}</pre><p><a href="https://aws.amazon.com/cdk/">CDK</a> is the way to way many of us buid infrastructure as a code. While there are examples of how to specify autoscaling rules for your service, most of them are about using Fargate (see python <a href="https://github.com/aws-samples/aws-cdk-examples/blob/master/python/ecs/fargate-service-with-autoscaling/app.py">example</a>).</p><p>Bellow is an example how autoscaling could be configured for a service inside service Construct constructor:</p><pre><strong>private void </strong>configureAutoScaling(<br>        String serviceName,<br>        String clusterName,<br>        <strong>int </strong>desiredCount,<br>        <strong>int </strong>maxCount) {<br>    String roleArn = <strong>&quot;arn:aws:iam::{accountId}:role/...&quot;</strong>;<br>    IRole role = Role.<em>fromRoleArn</em>(<strong>this</strong>, <strong>&quot;ecsServiceRole&quot;</strong>, roleArn);<br>    ScalableTaskCount taskCount = ScalableTaskCount.Builder<br>            .<em>create</em>(<strong>this</strong>, serviceName + <strong>&quot;ScalableTaskCount&quot;</strong>)<br>            .dimension(<strong>&quot;ecs:service:DesiredCount&quot;</strong>)<br>            .resourceId(String.<em>format</em>(<strong>&quot;service/%s/%s&quot;</strong>, clusterName, serviceName))<br>            .role(role)<br>            .serviceNamespace(ServiceNamespace.<strong><em>ECS</em></strong>)<br>            .minCapacity(desiredCount)<br>            .maxCapacity(maxCount)<br>            .build();<br><br>    taskCount.scaleOnCpuUtilization(<br>            serviceName + <strong>&quot;AutoScalingOnCpuUtilization&quot;</strong>,<br>            CpuUtilizationScalingProps.<em>builder</em>()<br>                    .targetUtilizationPercent(80)<br>                    .scaleInCooldown(Duration.<em>seconds</em>(300))<br>                    .scaleOutCooldown(Duration.<em>seconds</em>(60))<br>                    .build());<br><br>    taskCount.scaleOnMemoryUtilization(<br>            serviceName + <strong>&quot;AutoScalingOnMemoryUtilization&quot;</strong>,<br>            MemoryUtilizationScalingProps.<em>builder</em>()<br>                    .targetUtilizationPercent(80)<br>                    .scaleInCooldown(Duration.<em>seconds</em>(300))<br>                    .scaleOutCooldown(Duration.<em>seconds</em>(60))<br>                    .build());<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39f03cc3f046" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Github access token with submodules]]></title>
            <link>https://medium.com/@alexander.sirenko/using-github-access-token-with-submodules-5038b6d639e8?source=rss-e3c4acda724d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5038b6d639e8</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Alexander Sirenko]]></dc:creator>
            <pubDate>Sun, 29 Aug 2021 08:33:57 GMT</pubDate>
            <atom:updated>2021-08-29T09:13:50.490Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RpdCB8ssHVk6dpHL31rKbA.jpeg" /></figure><p>Since August 31, 2021 Github does <a href="https://github.blog/2021-08-16-securing-your-github-account-two-factor-authentication/">no longer accept passwords</a> to authenticate users. Instead, we need to create <a href="https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token">personal access token</a>.</p><p>Once you have generated token, it could be used to checkout repository as</p><pre>git clone https://<strong>{github-access-token}</strong>@github.com/account-name/repository-name</pre><p>However, if your repository contains submodules, cloning them:</p><pre>git submodule update --init</pre><p>fails as git wasn’t instructed to use the token:</p><pre>remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.<br>remote: Please see <a href="https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/">https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/</a> for more information.<br>fatal: Authentication failed for &#39;<a href="https://github.com/neurio/blitz/&#39;">https://github.com/account-name/submodule-name/&#39;</a><br>fatal: clone of &#39;<a href="https://github.com/neurio/blitz&#39;">https://github.com/account-name/submodule&#39;</a> into submodule path</pre><p>To make submodules work, use <a href="https://github.com/cli/cli">Github CLI</a> to authenticate git requests:</p><pre>% gh auth login<br>? <strong>What account do you want to log into?</strong> GitHub.com<br>? <strong>What is your preferred protocol for Git operations?</strong> HTTPS<br>? <strong>Authenticate Git with your GitHub credentials?</strong> Yes<br>? <strong>How would you like to authenticate GitHub CLI?</strong> Paste an authentication token                                                                                                                      Tip: you can generate a Personal Access Token here <a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a>                                                                                                               The minimum required scopes are &#39;repo&#39;, &#39;read:org&#39;, &#39;workflow&#39;.                                                                                                                                     ? Paste your authentication token: ****************************************                                                                                                                         - gh config set -h github.com git_protocol https<br>✓ Configured git protocol<br>✓ Logged in as a-sirenko</pre><p>Now you can clone the repository using <strong>gh</strong> and initialize submodules:</p><pre>gh repo clone account-name/repository-name<br>git submodule update --init</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5038b6d639e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>