<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ 100DaysOfCloud - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ 100DaysOfCloud - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Fri, 15 May 2026 17:24:21 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/100daysofcloud/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How I Deployed My #100DaysOfCloud Twitter Bot on AWS Fargate ]]>
                </title>
                <description>
                    <![CDATA[ By Johan Rin After passing my last certification, I asked myself how much time I spent studying cloud computing. https://twitter.com/johanrin/status/1276049320748425216 More than 100 days! It also made me realize two things: There was no #100DaysOfC... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-i-deployed-my-100daysofcloud-twitter-bot-on-aws-fargate/</link>
                <guid isPermaLink="false">66d45f62230dff0166905813</guid>
                
                    <category>
                        <![CDATA[ 100DaysOfCloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Docker ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 13 Jul 2020 02:31:55 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c99c3740569d1a4ca2191.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Johan Rin</p>
<p>After passing my last certification, I asked myself how much time I spent studying cloud computing.</p>
<div class="embed-wrapper">
        <blockquote class="twitter-tweet">
          <a href="https://twitter.com/johanrin/status/1276049320748425216"></a>
        </blockquote>
        <script defer="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></div>
<p>More than 100 days!</p>
<p>It also made me realize two things:</p>
<ol>
<li>There was no #100DaysOfCloud challenge</li>
<li>We have now enough content to create this challenge</li>
</ol>
<p>So I immediately contacted Alex Kallaway, the creator of #100DaysOfCode, to ask him if it was possible to create #100DaysOfCloud based on his challenge.</p>
<p>And a few days later, the #100DaysOfCloud challenge was official:</p>
<div class="embed-wrapper">
        <blockquote class="twitter-tweet">
          <a href="https://twitter.com/johanrin/status/1276409322596155616"></a>
        </blockquote>
        <script defer="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></div>
<p>But something was missing.</p>
<p>If you already used the #100DaysOfCode hashtag, you know that your tweets are going to be retweeted at least three times by Twitter bots.</p>
<p>Because there were no bots for the new #100DaysOfCloud challenge, I decided to fix that problem.</p>
<p>In this post, we're gonna see how I deployed my Twitter bot and why I choose to deploy it on AWS Fargate.</p>
<p>Let's start!</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>If you want to follow along and run the commands below, be sure to:</p>
<ul>
<li>Have an <a target="_blank" href="https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys">AWS account with access key and secret key</a></li>
<li>Have <a target="_blank" href="https://developer.twitter.com/">Twitter API Authentication Credentials</a></li>
<li>Install <a target="_blank" href="https://docs.docker.com/get-docker/">Docker</a> on your machine</li>
<li>Clone the repository from <a target="_blank" href="https://github.com/johanrin/100-days-of-cloud-bot">https://github.com/johanrin/100-days-of-cloud-bot</a></li>
</ul>
<h2 id="heading-why-aws-fargate">Why AWS Fargate?</h2>
<p>If you check my code, you’ll see that:</p>
<ul>
<li>The code is written in Python and use tweepy package</li>
<li>The bot is always running (using a <code>while</code> loop)</li>
<li>There is a <code>Dockerfile</code> to build my image</li>
</ul>
<p>I will not explain all the code because that's beyond the scope of this post. But I did mention all the sources I used in the GitHub repository.</p>
<p>My idea was to deploy the Docker image in a container in the cloud with the following constraints:</p>
<ol>
<li>I don't want to spend much money</li>
<li>I don't want to manage and operate servers</li>
</ol>
<p>Because I have credits on AWS, the first constraint was easy — go with AWS.</p>
<p>As for constraint number 2, I knew from the <a target="_blank" href="https://youtu.be/RrKRN9zRBWs">AWS Certified Developer - Associate course</a>, that we could deploy serverless containers with AWS Fargate.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/07/Screenshot_2020-07-08-AWS-Certified-Developer---Associate-2020--PASS-THE-EXAM---Ad-Free-Course.png" alt="Image" width="600" height="400" loading="lazy">
<em>From the AWS Certified Developer - Associate 2020 course</em></p>
<p>Depending on your region, the pricing for AWS services can vary. It's often just a matter of a few cents, but I planned to run my bot for at least one year. So, every cent mattered.</p>
<p>To see AWS Fargate pricing and minimize your cost, you can <a target="_blank" href="https://aws.amazon.com/fargate/pricing/">check the AWS documentation</a>. I found that the cheapest region close to me was Ireland, so I decided to deploy my bot to AWS Fargate there.</p>
<h2 id="heading-how-did-i-deploy-my-bot">How did I deploy my bot?</h2>
<p>Now that I've explained why I used AWS Fargate, let's see how I deployed my bot.</p>
<p>There are two big steps to deploy a Docker image on AWS Fargate:</p>
<ol>
<li>Push the Docker image to Amazon Elastic Container Registry (ECR)</li>
<li>Deploy the Docker image on Fargate</li>
</ol>
<p>Let's explain each step in detail.</p>
<h3 id="heading-push-the-docker-image-to-amazon-elastic-container-registry-ecr">Push the Docker image to Amazon Elastic Container Registry (ECR)</h3>
<ul>
<li>In the root directory, build your image from the <code>Dockerfile</code>.</li>
</ul>
<pre><code class="lang-bash">docker build . -t 100-days-of-cloud-bot
</code></pre>
<ul>
<li>Authenticate your Docker to Amazon ECR.</li>
</ul>
<pre><code class="lang-bash">aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
</code></pre>
<ul>
<li>Tag your image with the Amazon ECR repository.</li>
</ul>
<pre><code class="lang-bash">docker tag 100-days-of-cloud-bot aws_account_id.dkr.ecr.region.amazonaws.com/100-days-of-cloud-bot
</code></pre>
<ul>
<li>Push your image to Amazon ECR.</li>
</ul>
<pre><code class="lang-bash">docker push aws_account_id.dkr.ecr.region.amazonaws.com/100-days-of-cloud-bot
</code></pre>
<h3 id="heading-deploy-the-docker-image-on-amazon-fargate">Deploy the Docker image on Amazon Fargate</h3>
<ul>
<li>Open the <a target="_blank" href="https://console.aws.amazon.com/ecs/home#/firstRun">Amazon ECS console first run wizard</a>.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/07/01-Screenshot_2020-06-30-Amazon-ECS.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>Click <strong>Configure</strong> in the custom container, complete with the following settings, and then select <strong>Update</strong>.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/07/Image1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Property</td><td>Value</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Container name</strong></td><td>container-100-days-of-cloud-bot</td></tr>
<tr>
<td><strong>Image</strong></td><td>aws_account_id.dkr.ecr.region.amazonaws.com/100-days-of-cloud-bot</td></tr>
<tr>
<td><strong>Memory Limits (MiB)</strong></td><td>Soft Soft limit \</td><td>512</td></tr>
<tr>
<td><strong>Port mappings</strong></td><td><em>Container port</em>: 80<br><em>Protocol</em>: tcp</td></tr>
<tr>
<td><strong>CPU units</strong></td><td>256</td></tr>
<tr>
<td><strong>Environment variables</strong><br>(Twitter API Authentication Credentials)</td><td>CONSUMER_KEY \</td><td>Value \</td><td>consumer_key<br>CONSUMER_SECRET \</td><td>Value \</td><td>consumer_secret<br>ACCESS_TOKEN \</td><td>Value \</td><td>access_token<br>ACCESS_TOKEN_SECRET \</td><td>Value \</td><td>access_token_secret</td></tr>
</tbody>
</table>
</div><ul>
<li>Click <strong>Edit</strong> in the <strong>Task definition</strong> section, complete with the following settings, and then select <strong>Save</strong>.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/07/Image1-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Property</td><td>Value</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Task definition name</strong></td><td>task-definition-100-days-of-cloud-bot</td></tr>
<tr>
<td><strong>Task memory</strong></td><td>0.5GB (512)</td></tr>
<tr>
<td><strong>Task CPU</strong></td><td>0.25 vCPU (256)</td></tr>
</tbody>
</table>
</div><ul>
<li>Click <strong>Next</strong>.</li>
<li>Click <strong>Edit</strong> in the <strong>Define your service</strong> section, complete with the following settings, and then select <strong>Save</strong>.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/07/Image2.png" alt="Image" width="600" height="400" loading="lazy"></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Property</td><td>Value</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Service name</strong></td><td>service-100-days-of-cloud-bot</td></tr>
<tr>
<td><strong>Number of desired tasks</strong></td><td>1</td></tr>
<tr>
<td><strong>Load balancer type</strong></td><td>None</td></tr>
</tbody>
</table>
</div><p>We don't need a load balancer here because of the Twitter API rate limit. Even if we scale-out our containers, Twitter's API will send us a 420 error message because the bot is being rate limited for making too many requests.</p>
<ul>
<li>Click <strong>Next</strong>.</li>
<li>Edit your <strong>Cluster name</strong> with cluster-100-days-of-cloud-bot.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/07/12-Screenshot_2020-06-30-Amazon-ECS.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>Click <strong>Next</strong>.</li>
<li>Review your configuration and click <strong>Create</strong>.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/07/16-Screenshot_2020-06-30-Amazon-ECS.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>That's it, the container is deployed on AWS Fargate!</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>You deployed your Twitter bot on AWS Fargate with only four steps.  </p>
<p>AWS Fargate is easy to use, allowing us to deploy containers without managing and operating servers.</p>
<p>This use case was simple, but we can do much more like adding a load balancer or defining more tasks. I recommend you to <a target="_blank" href="https://docs.aws.amazon.com/AmazonECS/latest/userguide/what-is-fargate.html">check the documentation</a> for more details.</p>
<p>Because this post was about the #100DaysOfCloud challenge, I should mention that we have <a target="_blank" href="https://discord.com/invite/c6Db8nY">Discord server</a>, so feel free to join the community and the challenge! We have amazing people from all around the world ready to help you to get started with the Cloud.</p>
<p>That's it for me, hope you learned something! If you have any questions, <a target="_blank" href="https://twitter.com/johanrin">find me on Twitter</a> and feel free to ask me anything. </p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
