<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Enri Peters</title>
    <description>The latest articles on DEV Community by Enri Peters (@skabba).</description>
    <link>https://dev.to/skabba</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F760020%2F327f6809-13b1-474c-b65a-bf38d4db0f6f.jpg</url>
      <title>DEV Community: Enri Peters</title>
      <link>https://dev.to/skabba</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/skabba"/>
    <language>en</language>
    <item>
      <title>Building a Cost-Effective, Serverless Virus Scanner on AWS: A Step-by-Step Guide</title>
      <dc:creator>Enri Peters</dc:creator>
      <pubDate>Fri, 17 Jan 2025 08:48:53 +0000</pubDate>
      <link>https://dev.to/skabba/building-a-cost-effective-serverless-virus-scanner-on-aws-a-step-by-step-guide-2hjo</link>
      <guid>https://dev.to/skabba/building-a-cost-effective-serverless-virus-scanner-on-aws-a-step-by-step-guide-2hjo</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;In this blog post, you will learn how to create a Serverless virus scanner on AWS in a step-by-step guide.&lt;/p&gt;

&lt;p&gt;Virus scanners are important for detecting and removing malicious software (viruses, malware, etc.). They work by scanning for patterns of code that match known malware signatures or suspicious behaviours. They can be used in safeguarding our digital environments from potential security threats.&lt;/p&gt;

&lt;p&gt;Without a reliable virus scanner in place, our our digital environments are left vulnerable to attacks, which could result in serious consequences. Therefore, it's essential to have a trusted virus scanner to protect our systems and networks.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why a serverless virus scanner?
&lt;/h1&gt;

&lt;p&gt;A serverless virus scanner offers several benefits over traditional server-based solutions. Firstly, it requires less maintenance, which reduces costs significantly 🤑. Secondly, a serverless virus scanner is highly scalable, this makes it easy to increase or decrease the number of scans you run as needed. This makes it a cost-effective solution for protecting your digital environment from potential security threats.&lt;/p&gt;

&lt;h1&gt;
  
  
  Choosing the Right Services
&lt;/h1&gt;

&lt;p&gt;Choosing the right services and tools is important and proper selection of services can impact cost, performance, and scalability in a positive way. We will be using the following AWS services to build our serverless virus scanner.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;S3: a reliable, scalable, and cheap object storage service that can store large amounts of data.&lt;/li&gt;
&lt;li&gt;EventBridge Scheduler: a service that enables us to schedule events based on time intervals or cron expressions, which we will be using to automate the virus definitions updating process.&lt;/li&gt;
&lt;li&gt;Lambda: the perfect solution for executing our ClamAV virus scanner.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By using Lambda, we don't have to worry about provisioning or managing servers, and it automatically scales. Our Lambda function will be called Clambda, and it will execute the ClamAV virus scanner. We will be writing the code for Clambda in Python, making use of the libraries available for Python.&lt;/p&gt;

&lt;h1&gt;
  
  
  Designing the Virus Scanner Architecture
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4iaaex1f7vcr4xc6r79b.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4iaaex1f7vcr4xc6r79b.jpg" alt="Architecture" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To run a serverless virus scanner we need some serverless services from AWS. As mentioned in the previous paragraph we will be using S3, EventBridge Scheduler and Lambda. In the above diagram you can see how these different component work together.&lt;/p&gt;

&lt;h1&gt;
  
  
  Setting up part 1 - Update virus definitions
&lt;/h1&gt;

&lt;p&gt;It's essential to keep your virus scanner up to date by updating its definitions daily. ClamAV offers two ways to update its virus definitions: freshclam and cdvupdate. Freshclam can be run as a daemon or through a cronjob using the freshclam.conf config file. However, it may cause blacklisting issues with the CDN, making it difficult to develop. A better solution is cdvupdate, a tool that allows you to download and update ClamAV databases and database patch files to host your own database mirror.&lt;/p&gt;

&lt;h2&gt;
  
  
  Developing the cvdupdate Lambda
&lt;/h2&gt;

&lt;p&gt;We opted to update virus definitions daily, but you can adjust the frequency as needed. To run the cvdupdate Lambda, we’ve set up a daily Eventbridge schedule, which executes the cvdupdate Lambda and downloads/uploads the latest virus definitions to the ClamAV virus definitions bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;handlers/cvdupdate/requirements.txt&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cvdupdate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;handlers/cvdupdate/virus_definitions_updater.py&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;cvdupdate Lambda&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;span class="c1"&gt;# Standard imports
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;

&lt;span class="c1"&gt;# Non standard imports
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;

&lt;span class="n"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;s3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getLogger&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setLevel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;INFO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;download_all_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;definitions_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Download latest virus defitions from S3.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Download virus definitions from S3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mkdir -p &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list_objects&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;definitions_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Prefix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Contents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;update_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Contents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
            &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;download_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;definitions_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;definitions_folder&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;endswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                &lt;span class="nf"&gt;download_all_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Update local copy of DBs.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Configure cvd and run cvd update&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;python3 /var/task/dependencies/bin/cvd config set --dbdir &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;python3 /var/task/dependencies/bin/cvd update&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;upload_all_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;folder_name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Upload virus definitions to S3.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Upload latest virus definitions to S3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# Traverse the directory tree and upload each file to the bucket
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder_name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="c1"&gt;# Construct the full file path
&lt;/span&gt;            &lt;span class="n"&gt;local_file_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;s3_file_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;
            &lt;span class="c1"&gt;# Use the S3 client to upload the file to the bucket
&lt;/span&gt;            &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upload_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;local_file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;definitions_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s3_file_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;lambda_handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;  &lt;span class="c1"&gt;# pylint: disable=unused-argument
&lt;/span&gt;    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Lambda Handler which runs scheduled.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;definitions_bucket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DEFINITIONS_BUCKET&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;definitions_folder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/tmp/virus-definitions/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="c1"&gt;# Download all files to /tmp/virus-definitions
&lt;/span&gt;    &lt;span class="nf"&gt;download_all_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;definitions_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Update update update
&lt;/span&gt;    &lt;span class="nf"&gt;update_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Upload virus definitions back to S3
&lt;/span&gt;    &lt;span class="nf"&gt;upload_all_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;AWS Login&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws sso login &lt;span class="nt"&gt;--profile&lt;/span&gt; playground-admin
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_PROFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;playground-admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;AWS CLI&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws s3api create-bucket &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--bucket&lt;/span&gt; clamav-virus-definitions-&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-hex&lt;/span&gt; 4&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; eu-west-1 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--create-bucket-configuration&lt;/span&gt; &lt;span class="nv"&gt;LocationConstraint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;eu-west-1

aws iam create-role &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--role-name&lt;/span&gt; cvdupdate-lambda-role &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--assume-role-policy-document&lt;/span&gt; &lt;span class="s1"&gt;'{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Principal": {"Service": "lambda.amazonaws.com"},"Action": "sts:AssumeRole"}]}'&lt;/span&gt;

aws iam put-role-policy &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--role-name&lt;/span&gt; cvdupdate-lambda-role &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--policy-name&lt;/span&gt; s3-access-policy &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--policy-document&lt;/span&gt; &lt;span class="s1"&gt;'{"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Action": ["s3:GetObject", "s3:PutObject", "s3:ListBucket"], "Resource": ["arn:aws:s3:::clamav-virus-definitions/*", "arn:aws:s3:::clamav-virus-definitions"]}]}'&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Makefile&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="c"&gt;# SHELL:=/bin/bash
&lt;/span&gt;&lt;span class="nv"&gt;WORKLOAD_NAME&lt;/span&gt; &lt;span class="o"&gt;?=&lt;/span&gt; my-project

&lt;span class="nl"&gt;clean&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; artifacts
    &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; artifacts

&lt;span class="nl"&gt;clean_cvdupdate_dependencies&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; artifacts/cvdupdate.zip
    &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; handlers/cvdupdate/dependencies

&lt;span class="nl"&gt;package_cvdupdate&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="nf"&gt;clean_cvdupdate_dependencies&lt;/span&gt;
    pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--target&lt;/span&gt; handlers/cvdupdate/dependencies &lt;span class="nt"&gt;-r&lt;/span&gt; handlers/cvdupdate/requirements.txt &lt;span class="nt"&gt;--upgrade&lt;/span&gt;
    &lt;span class="nb"&gt;cd &lt;/span&gt;handlers/cvdupdate &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; zip &lt;span class="nt"&gt;-r9&lt;/span&gt; ../../artifacts/cvdupdate.zip &lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="nl"&gt;deploy_cvdupdate&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;clean_cvdupdate_dependencies package_cvdupdate&lt;/span&gt;
    aws s3 &lt;span class="nb"&gt;cp &lt;/span&gt;artifacts/cvdupdate.zip s3://&lt;span class="p"&gt;${&lt;/span&gt;WORKLOAD_NAME&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;-deploy&lt;/span&gt;/functions/cvdupdate.zip
    aws lambda update-function-code &lt;span class="nt"&gt;--function-name&lt;/span&gt; &lt;span class="p"&gt;${&lt;/span&gt;WORKLOAD_NAME&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;-cvdupdate&lt;/span&gt; &lt;span class="nt"&gt;--s3-bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;WORKLOAD_NAME&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;-deploy&lt;/span&gt; &lt;span class="nt"&gt;--s3-key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;functions/cvdupdate.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Setting up part 2 - The virus scanner
&lt;/h1&gt;

&lt;p&gt;We chose ClamAV to be our virus scanner, the reasons for this are that it is open source, lightweight, has a high detection rate, is very customisable and well supported.&lt;/p&gt;

&lt;h2&gt;
  
  
  Developing Clambda (ClamAV+Lambda combined 😎)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;handlers/clambda/requirements.txt&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;filetype
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;handlers/clambda/clambda.py&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;ClamAV Lambda&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;span class="c1"&gt;# pylint: disable=logging-fstring-interpolation
# pylint: disable=line-too-long
&lt;/span&gt;
&lt;span class="c1"&gt;# Standard imports
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;

&lt;span class="c1"&gt;# Non standard imports
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;filetype&lt;/span&gt;  &lt;span class="c1"&gt;# pylint: disable=import-error
&lt;/span&gt;
&lt;span class="c1"&gt;# Constants
&lt;/span&gt;&lt;span class="n"&gt;DEFINITIONS_BUCKET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DEFINITIONS_BUCKET&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;DEFINITIONS_FOLDER&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DEFINITIONS_FOLDER&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;TMP_FOLDER&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;TMP_FOLDER&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;DEFAULT_STATUS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;FAILURE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Clients
&lt;/span&gt;&lt;span class="n"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;s3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;transfer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;transfer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Logger
&lt;/span&gt;&lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getLogger&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setLevel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;INFO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;VirusFoundException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;VirusFoundException for when a virus is found.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;download_all_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bucket_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Download latest ClamAV virus definitions.
    Provide a bucket name on which the ClamAV virus definitions can be found.
    Provide a target folder to download them to.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# Code to download the virus definitions from the S3 bucket
&lt;/span&gt;    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Downloading latest virus definitions from S3!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;makedirs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exist_ok&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list_objects&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;bucket_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Contents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]):&lt;/span&gt;
        &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;download_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;bucket_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;download_file_from_s3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;object_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;local_file_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Download object from S3 based on bucket name and object key.
    File is written to a given local file path.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Downloading object: arn:aws:s3:::&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;bucket&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;object_key&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;makedirs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;local_file_path&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;exist_ok&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;download_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;object_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;local_file_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;local_file_path&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;guess_file_type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Guess the filetype by using the filetype library.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;file_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;filetype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;file_type&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Cannot guess file type!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;File MIME type is: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;file_type&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mime&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;start_clamscan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;local_file_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Run the clamscan binary.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Start scanning!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Start scan and capture output
&lt;/span&gt;        &lt;span class="n"&gt;scan_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;check_output&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/var/task/dependencies/bin/clamscan --database &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;definitions_folder&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;local_file_path&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c1"&gt;# Log scan output
&lt;/span&gt;        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scan_output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Scanning done, no viruses found!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SUCCESS&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# Overwrite default status
&lt;/span&gt;    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CalledProcessError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;returncode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;VirusFoundException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  &lt;span class="c1"&gt;# pylint: disable=raise-missing-from
&lt;/span&gt;                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Virus Found!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Exception: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;error_exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Exit Function. Always callback the calling AWS Transferservice.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="nf"&gt;workflow_step_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;workflow_step_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;execution_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Reports the step state back to calling AWS Transfer Workflow
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;transfer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send_workflow_step_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;WorkflowId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ExecutionId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;execution_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;token_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;lambda_handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;  &lt;span class="c1"&gt;# pylint: disable=unused-argument
&lt;/span&gt;    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Lambda Handler which gets an event from AWS Transfer Service.
    Example event:
    {
        &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;secret_token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
        &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;serviceMetadata&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:{
            &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;executionDetails&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:{
                &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;workflowId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;w-abcdefghikjl123&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
                &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;executionId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;423c2412-15d5-4786-a731-05d4b5f79ba6&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;
            },
            &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;transferDetails&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:{
                &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sessionId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;abcdefghikjl123&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
                &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;userName&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;epeters&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
                &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;serverId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;s-abcdefghikjl123&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;
            }
        },
        &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fileLocation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:{
            &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;domain&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;S3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
            &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bucket&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sftp-poc-1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
            &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;epeters/test-file.txt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
            &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;eTag&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;089c2c18cf2fe8979143223faeb5298e&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
            &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;versionId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;None&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;
        }
    }
    This Lambda makes use of: fileLocation.bucket and fileLocation.key.
    We use these values to download the file that needs to be scanned by ClamAV.
    Before the scan starts, the latest virus definitions are downloaded from S3.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Extract values from the event
&lt;/span&gt;    &lt;span class="n"&gt;sftp_bucket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fileLocation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bucket&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;object_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fileLocation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;workflow_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;serviceMetadata&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;executionDetails&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;workflowId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;execution_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;serviceMetadata&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;executionDetails&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;executionId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;token_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="c1"&gt;# Prepare metadata dictionary
&lt;/span&gt;    &lt;span class="n"&gt;metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;workflow_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;workflow_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;execution_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;execution_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;token_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DEFAULT_STATUS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;# Download file that needs to be scanned from S3
&lt;/span&gt;    &lt;span class="n"&gt;s3_object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;download_file_from_s3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;sftp_bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;object_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TMP_FOLDER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;object_key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Guess the file MIME type
&lt;/span&gt;    &lt;span class="c1"&gt;# TODO: Do something with this when for example the file type is unsupported
&lt;/span&gt;    &lt;span class="nf"&gt;guess_file_type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s3_object&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Download all virus definitions to /tmp/virus-definitions
&lt;/span&gt;    &lt;span class="nf"&gt;download_all_virus_definitions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DEFINITIONS_FOLDER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DEFINITIONS_BUCKET&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Run the scan
&lt;/span&gt;    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;scan_result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;start_clamscan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DEFINITIONS_FOLDER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s3_object&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scan_result&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="c1"&gt;# pylint: disable=broad-except
&lt;/span&gt;        &lt;span class="nf"&gt;error_exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Failure during scanning file, sending error back to Transfer Service&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Return the state to the transferservice workflow
&lt;/span&gt;    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;workflow_step_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;NOTE:&lt;/em&gt;&lt;/strong&gt; When I have the time I will improve this by using &lt;a href="https://docs.clamav.net/manual/Development/libclamav.html" rel="noopener noreferrer"&gt;libclamav&lt;/a&gt; directly instead of the Python subprocess module, because it is not ideal to use Python to spawn other programs. However, since &lt;code&gt;libclamav&lt;/code&gt; is written in C, integrating it with Python on AWS Lambda requires the use of &lt;a href="https://docs.python.org/3/library/ctypes.html" rel="noopener noreferrer"&gt;ctypes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;ctypes&lt;/strong&gt; is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap &lt;code&gt;libclamav&lt;/code&gt; in pure Python.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An example of how this can be done can be found on this &lt;a href="https://github.com/dmitriym09/py-clamav" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Makefile&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="c"&gt;# SHELL:=/bin/bash
&lt;/span&gt;&lt;span class="nv"&gt;WORKLOAD_NAME&lt;/span&gt; &lt;span class="o"&gt;?=&lt;/span&gt; my-project

&lt;span class="nl"&gt;clean&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; artifacts
    &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; artifacts

&lt;span class="nl"&gt;clean_clambda_dependencies&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; &lt;span class="p"&gt;${&lt;/span&gt;PWD&lt;span class="p"&gt;}&lt;/span&gt;/usr
    &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; artifacts/clambda.zip
    &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; handlers/clambda/dependencies

&lt;span class="nl"&gt;package_clambda&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;clean_clambda_dependencies&lt;/span&gt;
    &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; handlers/clambda/dependencies/&lt;span class="o"&gt;{&lt;/span&gt;bin,lib&lt;span class="o"&gt;}&lt;/span&gt;
    pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--target&lt;/span&gt; handlers/clambda/dependencies &lt;span class="nt"&gt;-r&lt;/span&gt; handlers/clambda/requirements.txt &lt;span class="nt"&gt;--upgrade&lt;/span&gt;
    curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://github.com/Cisco-Talos/clamav/releases/download/clamav-&lt;span class="p"&gt;${&lt;/span&gt;CLAMAV_VERSION&lt;span class="p"&gt;}&lt;/span&gt;/clamav-&lt;span class="p"&gt;${&lt;/span&gt;CLAMAV_VERSION&lt;span class="p"&gt;}&lt;/span&gt;.linux.x86_64.rpm &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--output&lt;/span&gt; artifacts/clamav-&lt;span class="p"&gt;${&lt;/span&gt;CLAMAV_VERSION&lt;span class="p"&gt;}&lt;/span&gt;.linux.x86_64.rpm
    &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="p"&gt;${&lt;/span&gt;UNAME&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'Darwin'&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Run macOS commands for package_clambda"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nb"&gt;tar &lt;/span&gt;xvf artifacts/clamav-&lt;span class="p"&gt;${&lt;/span&gt;CLAMAV_VERSION&lt;span class="p"&gt;}&lt;/span&gt;.linux.x86_64.rpm &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;-C&lt;/span&gt; handlers/clambda/dependencies/bin/ &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--strip-components&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4 &lt;span class="se"&gt;\&lt;/span&gt;
        usr/local/bin/clamscan&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nb"&gt;tar &lt;/span&gt;xvf artifacts/clamav-&lt;span class="p"&gt;${&lt;/span&gt;CLAMAV_VERSION&lt;span class="p"&gt;}&lt;/span&gt;.linux.x86_64.rpm &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;-C&lt;/span&gt; handlers/clambda/dependencies/lib/ &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--strip-components&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4 &lt;span class="se"&gt;\&lt;/span&gt;
        usr/local/lib64/&lt;span class="k"&gt;*&lt;/span&gt;.so.&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Run Linux commands for package_clambda"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        rpm2cpio artifacts/clamav-1.0.0.linux.x86_64.rpm | cpio &lt;span class="nt"&gt;-idmv&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nb"&gt;mv&lt;/span&gt; &lt;span class="p"&gt;${&lt;/span&gt;PWD&lt;span class="p"&gt;}&lt;/span&gt;/usr/local/bin/clamscan handlers/clambda/dependencies/bin/&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nb"&gt;mv&lt;/span&gt; &lt;span class="p"&gt;${&lt;/span&gt;PWD&lt;span class="p"&gt;}&lt;/span&gt;/usr/local/lib64/&lt;span class="k"&gt;*&lt;/span&gt;.so.&lt;span class="k"&gt;*&lt;/span&gt; handlers/clambda/dependencies/lib/&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="k"&gt;fi&lt;/span&gt;
    &lt;span class="nb"&gt;cd &lt;/span&gt;handlers/clambda &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; zip &lt;span class="nt"&gt;-r9&lt;/span&gt; ../../artifacts/clambda.zip &lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="nl"&gt;deploy_clambda&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;clean_clambda_dependencies package_clambda&lt;/span&gt;
    aws s3 &lt;span class="nb"&gt;cp &lt;/span&gt;artifacts/clambda.zip s3://&lt;span class="p"&gt;${&lt;/span&gt;WORKLOAD_NAME&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;-deploy&lt;/span&gt;/functions/clambda.zip
    aws lambda update-function-code &lt;span class="nt"&gt;--function-name&lt;/span&gt; &lt;span class="p"&gt;${&lt;/span&gt;WORKLOAD_NAME&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;-clambda&lt;/span&gt; &lt;span class="nt"&gt;--s3-bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;WORKLOAD_NAME&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;-deploy&lt;/span&gt; &lt;span class="nt"&gt;--s3-key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;functions/clambda.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Part 2?
&lt;/h1&gt;

&lt;p&gt;You might have noticed references to AWS Transfer Family. This is because Clambda has been integrated into an SFTP solution, making it part of a secure file transfer workflow. If you’re interested in a step-by-step guide on this integration, let me know in the comments. I might write a part 2 for this.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In this guide, we explored how to build a serverless virus scanner on AWS using S3 for storage, EventBridge Scheduler for automation, and Lambda for scanning with ClamAV. This solution is cost-effective, scalable, and requires minimal maintenance, perfect for keeping your systems secure.&lt;/p&gt;

&lt;p&gt;Try following the steps to build your own serverless virus scanner, and feel free to share your feedback or ideas for improvements in the comments.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>performance</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Exploring the Differences Between Amazon EC2 Instance Store and Amazon EBS</title>
      <dc:creator>Enri Peters</dc:creator>
      <pubDate>Thu, 29 Dec 2022 13:30:46 +0000</pubDate>
      <link>https://dev.to/skabba/exploring-the-differences-between-amazon-ec2-instance-store-and-amazon-ebs-3ch3</link>
      <guid>https://dev.to/skabba/exploring-the-differences-between-amazon-ec2-instance-store-and-amazon-ebs-3ch3</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;In the world of cloud computing, it's important to understand the various storage options available to you. Amazon Web Services (AWS) offers two main types of storage for its Elastic Compute Cloud (EC2) instances: instance store and Amazon Elastic Block Store (EBS). In this blog post, we'll discuss the key differences between the two and help you determine which one is the best fit for your needs.&lt;/p&gt;

&lt;h1&gt;
  
  
  Definition of EC2 instance store
&lt;/h1&gt;

&lt;p&gt;Instance store is a type of temporary storage that is physically attached to the host computer of an EC2 instance. It is also known as ephemeral storage because it is not persisted when the instance is stopped or terminated.&lt;/p&gt;

&lt;h1&gt;
  
  
  Definition of Amazon EBS
&lt;/h1&gt;

&lt;p&gt;Amazon EBS is a persistent storage service that allows you to create and attach one or more storage volumes to an EC2 instance. These volumes are independent from the host computer and can be detached and attached to other instances as needed.&lt;/p&gt;

&lt;h1&gt;
  
  
  Performance
&lt;/h1&gt;

&lt;p&gt;In terms of performance, instance store tends to be faster than EBS because it is physically attached to the host computer. However, the performance of EBS has improved significantly over the years and it is now able to deliver high levels of input/output operations per second (IOPS) for workloads that require it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Durability
&lt;/h1&gt;

&lt;p&gt;One major advantage of Amazon EBS over instance store is durability. Because EBS volumes are stored on separate physical servers, they are less vulnerable to data loss due to hardware failure. On the other hand, instance store data is at risk of being lost if the host computer fails.&lt;/p&gt;

&lt;p&gt;Instance store data is temporary and only persists for the duration of the associated instance. If the instance reboots, the data in the instance store will still be present. However, the data will be lost under the following circumstances:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The underlying disk drive fails&lt;/li&gt;
&lt;li&gt;The instance stops&lt;/li&gt;
&lt;li&gt;The instance hibernates&lt;/li&gt;
&lt;li&gt;The instance terminates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is important to note that instance store should not be relied upon for storing valuable, long-term data. Instead, consider using more durable storage options such as Amazon S3, Amazon EBS, or Amazon EFS for this purpose.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cost
&lt;/h1&gt;

&lt;p&gt;In terms of cost, instance store is generally cheaper than EBS because you don't have to pay for the storage separately. However, EBS allows you to pay for only the storage you need and scale up or down as needed, which can be more cost-effective for certain workloads.&lt;/p&gt;

&lt;h1&gt;
  
  
  Support
&lt;/h1&gt;

&lt;p&gt;It is important to note that not all EC2 instances support instance storage, and even among those that do, the amount of storage available can vary. To get a list of all instance types that support instance storage, you can use the following AWS CLI command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ec2 describe-instance-types \
    --filters "Name=instance-type,Values=*" "Name=instance-storage-supported,Values=true" \
    --query "InstanceTypes[].[InstanceType, InstanceStorageInfo.TotalSizeInGB]" \
    --output table | sort
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, T2 and T3 instances do not support instance storage. You can find more information on EC2 instance storage in the &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes" rel="noopener noreferrer"&gt;AWS EC2 instance storage user guide&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In summary, both EC2 instance store and Amazon EBS offer unique benefits and trade-offs. Instance store is a fast and cost-effective option for temporary storage, but it is not durable. Amazon EBS is a more durable option that allows you to scale your storage needs, but it comes at a higher cost. Ultimately, the right choice for your needs will depend on the specific requirements of your workload.&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Mastering Local AWS Lambda Development</title>
      <dc:creator>Enri Peters</dc:creator>
      <pubDate>Tue, 13 Dec 2022 22:20:32 +0000</pubDate>
      <link>https://dev.to/skabba/mastering-local-aws-lambda-development-18mg</link>
      <guid>https://dev.to/skabba/mastering-local-aws-lambda-development-18mg</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Are you tired of deploying your AWS Lambda functions to AWS just to test them? Do you feel like you're constantly uploading your code just to see if it works?&lt;/p&gt;

&lt;p&gt;Well, fear not my fellow Lambda enthusiasts! In this post, I will share with you two simple ways to do local AWS Lambda development. That's right, no more deployments or tedious back-and-forth just to test your code. You'll be able to run your Lambda functions right on your own computer, just like a boss.&lt;/p&gt;

&lt;p&gt;So, grab a cup of coffee and get ready to unleash the full potential of your local Lambda development skills. Let's do this!&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To develop Lambda functions locally, you will need to have the following prerequisites installed on your system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker to emulate the Lambda runtime on your machine&lt;/li&gt;
&lt;li&gt;Python with a version equal or greater than 3.6&lt;/li&gt;
&lt;li&gt;pipenv to not make a mess of your local Python installation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can install pipenv by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install pipenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have these prerequisites installed, you will be ready to start developing your lambda functions locally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 1 - AWS Serverless Application Model
&lt;/h2&gt;

&lt;p&gt;The first method we will discuss is using AWS SAM (Serverless Application Model). AWS SAM is an open-source framework that allows developers to quickly and easily create, build, and deploy applications that run on the AWS platform.&lt;/p&gt;

&lt;p&gt;With AWS SAM developers can test their AWS Lambda functions locally, without having to deploy them to AWS. It does this by using a local version of the AWS Lambda runtime, which simulates the environment in which Lambda functions execute in AWS.&lt;/p&gt;

&lt;p&gt;This is useful because it allows developers to test their Lambda functions quickly and easily, without having to incur the costs or wait for the deployment process associated with deploying to AWS. It also makes it easier to debug and troubleshoot problems with Lambda functions, since developers can see the output and errors directly on their own computers.&lt;/p&gt;




&lt;p&gt;To install and set up the AWS SAM CLI on your local machine, follow these steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir sam-demo
cd sam-demo
pipenv shell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;NOTE: pipenv will launch a subshell in a virtual environment, to exit this subshell type 'exit'. Don't forget to do this once your done.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now within your virtualenv created by pipenv you can install the SAM CLI by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pipenv install aws-sam-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the SAM CLI is installed, you can use the &lt;code&gt;sam init&lt;/code&gt; command to initialise your SAM project. Use the &lt;code&gt;sam init&lt;/code&gt; command as shown below to create a SAM project based on the "Hello World" template. This template includes a Lambda Function and a REST API. We will not be using the API part, but feel free to play with it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sam init \
  --name my-sam-app \
  --app-template hello-world \
  --runtime python3.9 \
  --dependency-manager pip \
  --package-type Zip \
  --no-tracing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure you change directories into the 'my-sam-app' folder created by SAM.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd my-sam-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use and edit the files in this 'hello-world' example to meet you needs. For example you can change the &lt;code&gt;template.yaml&lt;/code&gt; file to add extra serverless resource blocks. Additionally you can change the code inside the Lambda function python file: &lt;code&gt;hello_world/app.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now that you know this, it's time to build and run your Lambda Function code by using the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sam build --use-container
sam local invoke
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! You have successfully learned the basics of using the SAM CLI tool to develop and test Lambda functions on your local machine.&lt;/p&gt;




&lt;p&gt;This approach involves using the AWS SAM CLI and has the advantage of creating a streamlined development flow. The SAM CLI makes it easy to develop and test serverless applications locally, without the need to deploy them to AWS. This allows developers to iterate quickly and test their changes without incurring the cost and overhead of deploying to AWS.&lt;/p&gt;

&lt;p&gt;However, it also has the disadvantage of that it may not be the best choice for complex or large-scale applications. While the SAM CLI is a great tool for developing and deploying simple or medium-sized serverless applications, it may not be the best choice for more complex or large-scale applications that require a more advanced deployment or management solution. In these cases, you may want to consider using other tools or frameworks that provide additional features and capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 2 - Docker run
&lt;/h2&gt;

&lt;p&gt;There might be a moment while happily using method 1 that you think "I do not want to keep running &lt;code&gt;sam build&lt;/code&gt; every time I make a change to my Lambda Function code".&lt;/p&gt;

&lt;p&gt;Well, there is another way to locally test your Lambda Function, but in a slightly different way.&lt;/p&gt;

&lt;p&gt;Before, when you ran &lt;code&gt;sam build&lt;/code&gt;, the tool was building a Docker container image behind the scenes which is based on the &lt;code&gt;public.ecr.aws/sam/build-python3.9&lt;/code&gt; docker image.&lt;/p&gt;

&lt;p&gt;We can use this base image and take full control of it, moo-hahaha!&lt;/p&gt;




&lt;p&gt;Let's give this a try by pulling this container to our machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pull public.ecr.aws/sam/build-python3.9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the image has been downloaded, you can use the &lt;code&gt;docker run&lt;/code&gt; command to start a new container based on the image. When starting the container, you will need to specify the following arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The -it flag to be able to interact with the container&lt;/li&gt;
&lt;li&gt;The --read-only flag which will create a read-only file system, this mimics the AWS Lambda behaviour.&lt;/li&gt;
&lt;li&gt;The --tmpfs flag with /tmp argument which will create a temporary file-system on /tmp inside the container to which you can write. You also get this while running your Lambda Function inside AWS.&lt;/li&gt;
&lt;li&gt;The -v flag which mounts a local directory containing your Lambda function code inside the container.&lt;/li&gt;
&lt;li&gt;The -e flag for setting environment variables that the Lambda runtime can use while executing your function.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;NOTE: You can only write into &lt;code&gt;/tmp&lt;/code&gt; with a Lambda Function. In some cases (not entirely known to me) temporary storage is not deleted between warm Lambda invocations, this can help in having a faster execution of your Lambda Function.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's look at an example.&lt;/p&gt;

&lt;p&gt;This example assumes you have a &lt;code&gt;my_lambda_function.py&lt;/code&gt; file in your current directory, with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# my_lambda_function.py

def lambda_handler(event, context):
    print("Hello from Lambda!")

if __name__ == '__main__':
    lambda_handler(None, None)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have created this &lt;code&gt;my_lambda_function.py&lt;/code&gt; file you can continu by running the below command to start an interactive session with your emulated Lambda Function container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -it \
--read-only \
--tmpfs /tmp \
-v $(pwd):/var/task \
-e MY_ENV_VAR_1=hello \
-e MY_ENV_VAR_2=world \
public.ecr.aws/sam/build-python3.9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you hit enter you will be entering the container immediately, you can verify this by looking at your PS1 prompt which should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bash-4.2# 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prompt indicates that the container is ready to accept commands. Let's try some things to verify what we just did. Let's start by trying to write something on the root of the containers filesystem.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bash-4.2# touch /this
touch: cannot touch ‘this’: Read-only file system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look at that! Our &lt;code&gt;--read-only&lt;/code&gt; does indeed help in simulating a Lambda Function. You can't touch this!&lt;/p&gt;

&lt;p&gt;Now let me explain the -v flag we passed to the &lt;code&gt;docker run&lt;/code&gt; command. The -v flag is used with the docker run command to create a volume, which is a persistent storage location that can be accessed from the container. This flag allows you to specify a host directory to be mounted as a volume in the container. The -v flag can be used multiple times to mount multiple volumes (you could do this when you want to simulate Lambda layers). If you want to know more about this, please leave a comment.&lt;/p&gt;

&lt;p&gt;For example, the above command uses the -v flag to mount the hosts current directory as the volume /var/task in the container.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;NOTE: The $(pwd) command returns the current working directory.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This again simulates our Lambda Function perfectly. Now let's check how to run our Lambda Function. But first let's verify our Python version by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bash-4.2# python -V
Python 3.9.15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nice! We are running Python 3.9.x on our local Lambda Function, let's try to run our functions code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bash-4.2# python /var/task/my_lambda_function.py
Hello from Lambda!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations on successfully running your Lambda function code from within a Docker container! This is a great achievement, as it allows you to run your code in a consistent and predictable environment, which can be especially useful for testing and debugging.&lt;/p&gt;




&lt;p&gt;This approach involves using Docker and has the advantage that you can now use your favourite text editor or IDE to make changes to your &lt;code&gt;my_lambda_function.py&lt;/code&gt; file. Because the volume is mounted, any changes you make to the file on your host machine will be immediately available within the Docker container, allowing you to quickly test and iterate on your code.&lt;/p&gt;

&lt;p&gt;However, it also has the disadvantage of that it may not provide an exact replica of the AWS Lambda runtime environment behaves. As a result, there could be differences in how the function behaves when tested locally using Docker compared to when it is actually executed in the AWS Lambda environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By using these approaches, you can test your Lambda functions locally without having to deploy them to the AWS cloud. This can be useful for development and testing purposes, as it allows you to iterate quickly and make changes to your code without incurring the overhead of deploying to AWS.&lt;/p&gt;

&lt;p&gt;What do you think? Share your thoughts in the comments below!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>lambda</category>
      <category>serverless</category>
      <category>sam</category>
    </item>
    <item>
      <title>Playlist: Now Go Build with Werner Vogels - Season 1, 2 &amp; 3</title>
      <dc:creator>Enri Peters</dc:creator>
      <pubDate>Thu, 06 Oct 2022 19:37:41 +0000</pubDate>
      <link>https://dev.to/skabba/playlist-now-go-build-with-werner-vogels-season-1-2-3-54ob</link>
      <guid>https://dev.to/skabba/playlist-now-go-build-with-werner-vogels-season-1-2-3-54ob</guid>
      <description>&lt;h1&gt;
  
  
  Season 1️⃣
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Episode 1 - Jakarta 🇮🇩
&lt;/h2&gt;

&lt;p&gt;Follow Dr. Werner Vogels, Amazon CTO, through Indonesia as he meets with HARA Token, a Jakarta based startup, to explore the technology that links small holder rice farmers with financial services with their innovative eco-system.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/a42kxHSX4Xw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 2 - Singapore 🇸🇬
&lt;/h2&gt;

&lt;p&gt;Dr. Werner Vogels, Amazon CTO, travels to the hot start up scene in Singapore, meeting with Zimplistic, founded by Pranoti Nagarkar and Rishi Israni - the makers of Rotimatic, in order to find out why complex IOT and Machine Learning technology was needed to replicate a bread making process that’s been handed down from parents to their children over generations.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LUqRatX2mFU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 3 - Bergen 🇳🇴
&lt;/h2&gt;

&lt;p&gt;Dr. Werner Vogels, Amazon CTO, travels to the scenic fjords in Bergen, Norway to meet with the founder of Aquabyte to learn how AI is playing a new role in salmon farming.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/YZ_qJ5JFD3I"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 4 - Berlin 🇩🇪
&lt;/h2&gt;

&lt;p&gt;Dr. Werner Vogels, Amazon CTO, travels to Berlin, Germany to meet with the founders of the ReDI School and Babbel to explore how technology plays a critical role in integrating refugees into the German workforce and their culture.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/weOCV6yRTOY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 5 - Cape Town 🇿🇦
&lt;/h2&gt;

&lt;p&gt;Dr. Werner Vogels, Amazon CTO, travels to South Africa to meet with the founder of the Africam to explore how technology plays a critical role in wildlife conservation efforts. Africam uses live streaming cameras in the African safari to create direct connections for NGO's working to curb poaching and those who want to help.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/exSXKANBX5M"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 6 - Rio de Janeiro 🇧🇷
&lt;/h2&gt;

&lt;p&gt;Follow Dr. Werner Vogels, Amazon CTO, through Rio de Janeiro as he meets with the founders of Dr.Consulta and Epitrack to explore how cloud technology is being applied to re-invent private health care solutions in one of the most beautiful and densely populated cities in Brazil.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/NNNju68n2do"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 7 - Porto 🇵🇹
&lt;/h2&gt;

&lt;p&gt;Follow Dr. Werner Vogels, Amazon CTO, to the city of Porto, Portugal as he meets with the founders of Veniam and CEiiA and to explore how an ancient city is transforming itself into a smart city to meet the needs of a growing population within the confines of a city that dates back to 300 BC.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/k8O9KJKSswM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 8 - Amsterdam ❌❌❌ 🇳🇱
&lt;/h2&gt;

&lt;p&gt;Follow Dr. Werner Vogels, Amazon CTO, to Amsterdam for the Amsterdam Dance Event, the worlds largest EDM festival, to explore how cloud technology enhances the artistic process and the ability to get their music out.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/gjJjtp4rCtM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Season 2️⃣
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Episode 1 - Bengaluru 🙏 🕉 🇮🇳
&lt;/h2&gt;

&lt;p&gt;Follow Dr. Werner Vogels, Amazon.com CTO, to the vibrant streets of Bengaluru, and meet Sujay Suresh and Innu Nevatia, founders of the company Zwende, who wanted to pair the creativity, customization, and accessibility of modern shoppers with the craft of skilled designers and makers.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/2n7bm0mteG0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 2 - Tokyo 🇯🇵
&lt;/h2&gt;

&lt;p&gt;Follow Dr. Werner Vogels, Amazon.com CTO, to Tokyo where taking care of older generations has long been a part of Japanese culture. As life expectancy rises and the number of elderly people far exceeds that of younger people who might take care of them, some creative minds are moving Japan towards new traditions of elderly care.&lt;/p&gt;

&lt;p&gt;Werner meets Tatsuya Takahashi, co-CEO of Z-Works, Inc., Yoichi Ochiai, CEO of Pixie Dust Technologies, and Seigo Hara, CEO of MICIN, Inc.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/gXNbOtH97zc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 3 - Poland 🇵🇱
&lt;/h2&gt;

&lt;p&gt;Follow Dr. Werner Vogels, Amazon CTO, to Poland—where COVID-19 is keeping students out of the classroom and dialed in to online learning. Inspired by the idea of bringing a student study group online, see how Brainly is helping students bridge the gap between remote online classes and the 1-on-1 attention and guidance that's more accustomed to the classroom.&lt;/p&gt;

&lt;p&gt;Werner meets Michał Borkowski, CEO &amp;amp; Co-Founder, and Bill Salak, CTO of Brainly.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/DR956EG56Qg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Season 3️⃣
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Episode 1 - Iceland 🇮🇸
&lt;/h2&gt;

&lt;p&gt;From discovering life-saving medical treatments in the skins of Atlantic cod to reinventing batteries with advancements in nanotechnology, Iceland has proved itself to be one of the most technologically ingenuitive countries on earth. Discover Iceland’s surprisingly successful “waste nothing” approach to innovation with Amazon CTO Dr. Werner Vogels as he visits startups @Kerecis, Nanom, and ON Power.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mvnT2ggjIYI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 2 - Hawai‘i 🌋
&lt;/h2&gt;

&lt;p&gt;Travel to the Island of Hawai‘i with Amazon CTO Dr. Werner Vogels as he visits @Terraformation, a global native forest restoration startup working to combat climate change with the planting of one trillion trees– a task made possible with the help of solar-powered desalination, seed banking, and cloud-based technologies.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/W_ningGJBGw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 3 - Vermont 🇺🇸
&lt;/h2&gt;

&lt;p&gt;Amazon CTO Dr. Werner Vogels travels to Burlington, Vermont, where the startup BETA Technologies is redefining the future of commercial, medical, and cargo aviation with its electric vertical aircrafts.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/KaJKUhRwjPs"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 4 - Copenhagen 🇩🇰
&lt;/h2&gt;

&lt;p&gt;Travel to Copenhagen with Amazon CTO Dr. Werner Vogels as he visits Veo, a company working to make sports technology accessible to all; made possible with machine learning, a love of soccer, and a mission to democratize sports for everyone.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/P3p1V03u9ck"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 5 - Hollywood, Los Angeles 🎥
&lt;/h2&gt;

&lt;p&gt;How do you make a digital human? Hint: it starts with the cloud and digital DNA.­ ­Travel with Amazon CTO Dr. Werner Vogels as he visits Soul Machines, an AI company who uses the cloud to deliver meaningful connections between human and machine. ­­This episode features digital capture technology, Lightstage from OTOY.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/B05uZ_yxtl0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode 6 - Arizona ⛰️
&lt;/h2&gt;

&lt;p&gt;Can autonomous trucking help with supply chain issues and give drivers an opportunity to work closer to home? Travel with Amazon CTO Dr. Werner Vogels as he visits TuSimple, a technology company who uses the cloud to help autonomous trucking work toward safer, smarter roads.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/itY07uKxiYQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>aws</category>
      <category>build</category>
      <category>awscommunity</category>
      <category>world</category>
    </item>
    <item>
      <title>How I failed to become an AWS Community Builder</title>
      <dc:creator>Enri Peters</dc:creator>
      <pubDate>Fri, 19 Aug 2022 20:36:00 +0000</pubDate>
      <link>https://dev.to/skabba/how-not-to-become-an-aws-community-builder-15a2</link>
      <guid>https://dev.to/skabba/how-not-to-become-an-aws-community-builder-15a2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;But how I succeeded next time and how you could as well&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Are you curious about the journey of someone who failed to become an AWS Community Builder? While it may seem counterintuitive, reading about someone's failure can often provide valuable insights and lessons for achieving success.&lt;/p&gt;

&lt;p&gt;On August 17, I received an email from AWS that informed me that I had not been selected for the Community Builder program. While initially disappointing, this experience allowed me to learn and grow in ways that I never would have anticipated.&lt;/p&gt;

&lt;p&gt;Through this blog post, I hope to share my story and the valuable lessons I learned along the way. Whether you're applying to become a Community Builder or pursuing any other goal, I believe my experience can provide valuable insight and inspiration for achieving success.&lt;/p&gt;

&lt;h2&gt;
  
  
  The AWS Community Builders program 🛠
&lt;/h2&gt;

&lt;p&gt;The AWS Community Builders program is an exclusive program offered by AWS that provides technical resources, mentorship, and networking opportunities to individuals who are passionate about sharing their knowledge and connecting with the AWS community. The program is designed for AWS enthusiasts and emerging thought leaders who are eager to learn more about AWS and share their knowledge with the community.&lt;/p&gt;

&lt;p&gt;The program is open to applicants worldwide and offers a diverse group of passionate and knowledgeable individuals the opportunity to connect with other AWS enthusiasts and thought leaders, as well as gain access to exclusive technical resources and mentorship from AWS experts.&lt;/p&gt;

&lt;p&gt;For more information about the program, including eligibility requirements and application process, please visit the &lt;a href="https://aws.amazon.com/developer/community/community-builders/" rel="noopener noreferrer"&gt;AWS Community Builders page&lt;/a&gt;. Additionally, it would be beneficial to read the frequently asked questions on the website, as they provide valuable insights into the program and the expectations of the community builders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key people 🔑
&lt;/h2&gt;

&lt;p&gt;AWS, being the leading public cloud provider, offers a wealth of opportunities for community engagement through its Community Builders program. This program, which has been in existence since 2020, aims to provide technical resources, mentorship and networking opportunities to passionate AWS enthusiasts and emerging thought leaders who are dedicated to sharing their knowledge and connecting with the AWS community.&lt;/p&gt;

&lt;p&gt;To fully utilize the program's knowledge and resources, it is essential to stay informed about the program by following key individuals who are involved. These individuals include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ross Barich, Head of AWS Community&lt;/li&gt;
&lt;li&gt;Jason Dunn, AWS Community Builders Program Manager&lt;/li&gt;
&lt;li&gt;María Encinar, AWS EMEA Senior Community Programs Manager&lt;/li&gt;
&lt;li&gt;Shafraz Rahim, AWS Developer Community Program Manager for Asia Pacific, Japan&lt;/li&gt;
&lt;li&gt;Farrah Campbell, AWS Sr. Product Marketing Manager for Containers &amp;amp; Serverless&lt;/li&gt;
&lt;li&gt;Taylor Katherine Lacy, AWS Developer Community Manager&lt;/li&gt;
&lt;li&gt;Caroline Kerns, AWS Community Manager&lt;/li&gt;
&lt;li&gt;Albert Zhao, AWS Developer Community Manager&lt;/li&gt;
&lt;li&gt;Mark Pergola, AWS Community Content Manager&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This list is not exhaustive and if you are aware of other key individuals involved in the AWS Community Builders program, please share in the comments so the list can be updated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do you want to become an AWS Community Builder? 🤔
&lt;/h2&gt;

&lt;p&gt;If you're someone who is driven to make an impact, wants to be part of something special, and is passionate about helping others in their AWS journey, then the AWS Community Builders program may be the perfect fit for you. The program is designed for individuals who want to build long-term relationships, improve their self-confidence, and be recognized in the AWS community. Most importantly, the program is built on the belief that the success of a group is greater than that of an individual. If you share these values and are passionate about AWS, consider applying to the program to take your community involvement to the next level.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuli5bfyq83ettxjhrp4x.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuli5bfyq83ettxjhrp4x.gif" alt="Mic Drop" width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dont's ❌
&lt;/h2&gt;

&lt;p&gt;The most important part of this blog post is about taking action on your ideas for creating and sharing content. Don't let fear or perfectionism hold you back from starting. It may seem daunting, but remember that progress is made one step at a time.&lt;/p&gt;

&lt;p&gt;For example, instead of putting off creating a YouTube channel because you're worried about the perfect banner or intro, just start recording a video. Don't worry about whether your content will be valuable to others, just share what you know and what you're passionate about.&lt;/p&gt;

&lt;p&gt;It's also important to not get too caught up in watching others and trying to emulate their success. While it's great to be inspired by others, remember that everyone's journey is unique and you will learn the most by taking action and creating your own content. Don't put pressure on yourself to create top-notch content right away, just start and you'll get better with time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff0t6sbrxqsjyejngquvl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff0t6sbrxqsjyejngquvl.png" alt="Procrastination" width="800" height="533"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Do's ✅
&lt;/h2&gt;

&lt;p&gt;There are many ways to get started in the AWS community and make an impact. Social media platforms like LinkedIn and Twitter are great places to start. You can increase visibility by using relevant tags such as #aws, #cloud, #awscommunity, #awscommunitybuilder, and #awscommunitybuilders. Don't forget to also like, comment, and share posts made by others, and consider mentioning companies in your posts using the "@" symbol. Joining AWS groups on social media, such as the &lt;a href="https://www.linkedin.com/groups/6814264/" rel="noopener noreferrer"&gt;AWS Certified Global Community&lt;/a&gt;, can also be beneficial.&lt;/p&gt;

&lt;p&gt;Another great way to get involved is to join your local &lt;a href="https://aws.amazon.com/developer/community/usergroups/" rel="noopener noreferrer"&gt;AWS User Groups&lt;/a&gt;. Meetups are a great opportunity to improve your public speaking skills and you can reach out to the organizers and offer your help with organizing meetups and community days.&lt;/p&gt;

&lt;p&gt;Blogging is a great way to improve your writing skills and you can start today by creating an account on &lt;a href="https://dev.to"&gt;https://dev.to&lt;/a&gt; or &lt;a href="https://medium.com" rel="noopener noreferrer"&gt;https://medium.com&lt;/a&gt;. Interacting on platforms such as &lt;a href="https://twitter.com/awsdevelopers" rel="noopener noreferrer"&gt;Twitter's AWS Developers group&lt;/a&gt;, &lt;a href="https://repost.aws/" rel="noopener noreferrer"&gt;AWS re:Post&lt;/a&gt;, &lt;a href="https://www.reddit.com/r/aws/" rel="noopener noreferrer"&gt;Reddit&lt;/a&gt;, and &lt;a href="https://stackoverflow.com/questions/tagged/amazon-web-services?sort=newest" rel="noopener noreferrer"&gt;Stack Overflow&lt;/a&gt; can also be beneficial.&lt;/p&gt;

&lt;p&gt;If you're interested in contributing to open source projects, consider checking out &lt;a href="https://github.com/awslabs" rel="noopener noreferrer"&gt;GitHub - AWS Labs&lt;/a&gt; and see if you can add any value by contributing code or by improving documentation.&lt;/p&gt;

&lt;p&gt;Connecting with and following AWS Heroes, Ambassadors, User Group Organizers/Leaders/Volunteers and Community Builders can give you insights on what they are working on and how you can contribute. You can also check out &lt;a href="https://aws.amazon.com/blogs/aws/tag/week-in-review/" rel="noopener noreferrer"&gt;AWS Week in Review&lt;/a&gt; and &lt;a href="https://aws.amazon.com/new" rel="noopener noreferrer"&gt;What's New with AWS&lt;/a&gt; to stay up to date with the latest news and developments in the AWS community.&lt;/p&gt;

&lt;p&gt;Finally, consider starting an AWS newsletter, in which you can summarize the latest news and developments and share your thoughts and insights on why certain features are important or amazing. You already got one subscriber (me)!&lt;/p&gt;

&lt;h2&gt;
  
  
  Optional do's ✅
&lt;/h2&gt;

&lt;p&gt;Becoming an AWS Community Builder can be a challenging journey, but one way to increase your chances of success is by obtaining AWS certifications. Not only will these certifications help you learn more about AWS and advance your career, but they also demonstrate your knowledge and skills to others in the community.&lt;/p&gt;

&lt;p&gt;To help you on your certification journey, here are some resources that can be useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud Quest is a fun role-playing game that allows you to build solutions in a live AWS environment.&lt;/li&gt;
&lt;li&gt;AWS Educate is open to any individual, regardless of where they are in their education, technical experience, or career journey. &lt;/li&gt;
&lt;li&gt;AWS Skill Builder is an AWS learning center that helps you improve your cloud skills.&lt;/li&gt;
&lt;li&gt;Adrian Cantrill offers some of the best AWS training available, and many of his fundamentals courses can be watched for free on his YouTube channel.&lt;/li&gt;
&lt;li&gt;Stephane Maarek is a best-selling instructor and Kafka expert who offers AWS certification courses on Udemy.&lt;/li&gt;
&lt;li&gt;Jon Bonso from Tutorials Dojo offers some of the best practice exams available, with explanations for correct and incorrect answers.&lt;/li&gt;
&lt;li&gt;Neal Davis from Digital Cloud Training offers top-quality training, cheatsheets, and free resources on his website and on the &lt;a href="https://www.youtube.com/c/Freecodecamp/search?query=aws%20certified" rel="noopener noreferrer"&gt;YouTube channel of freeCodeCamp&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Andrew Brown who is an AWS Hero and has created a learning platform called ExamPro which has great resources for becoming AWS certified. He also has created multiple AWS certification courses which are available for free on the YouTube channel of freeCodeCamp.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A Cloud Guru, Cloud Academy, Udemy, Coursera, Whizlabs, MeasureUp and many other platforms also offer AWS certification courses and practice exams.&lt;/p&gt;

&lt;p&gt;It's important to note that these are just a few of the many resources available, and it's important to find one that works best for you and your learning style. Additionally, it's also important to note that obtaining certifications is not the only way to become an AWS Community Builder, and it's important to also actively engage in the community by sharing your knowledge, helping others, and contributing to open-source projects. Joining and participating in local AWS user groups, speaking at meetups, and creating content such as blogs, videos, and podcasts are also great ways to build your presence in the community.&lt;/p&gt;

&lt;p&gt;Ultimately, becoming an AWS Community Builder is about consistently putting in the effort to learn, share, and engage with others in the community. Whether it's through obtaining certifications, participating in online forums, or speaking at events, it's important to find ways to add value and make a positive impact in the community.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tell me the benefits! 👍
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3qbpkwv71i3uhbapzggt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3qbpkwv71i3uhbapzggt.png" alt="Benefits" width="800" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are many benefits to becoming an AWS Community Builder, including increased visibility and recognition within the community. As a member of the program, your name will be listed in the Community Builders directory, which can help you gain more visibility and recognition within the community.&lt;/p&gt;

&lt;p&gt;You will also gain access to exclusive resources and opportunities, such as invitations to private platforms like the Community Builders Slack workspace where you can connect with other Community Builders and AWS employees, including subject matter experts.&lt;/p&gt;

&lt;p&gt;In addition to these opportunities, you will also receive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access to AWS product teams and information&lt;/li&gt;
&lt;li&gt;AWS promotional credits to use in your own AWS accounts to build projects&lt;/li&gt;
&lt;li&gt;Access to training resources such as Cloud Academy&lt;/li&gt;
&lt;li&gt;One certification voucher for an AWS exam&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But perhaps one of the most exciting benefits is the exclusive AWS swag, such as water bottles, stickers, t-shirts, hats, and backpacks.&lt;/p&gt;

&lt;p&gt;It's worth noting that AWS is always working to improve the benefits of the program, so you can expect them to evolve over time. Another fun fact is that if you ever attend the AWS re:Invent conference in Las Vegas, as a Community Builder you will receive special recognition, such as a Community Builder sticker on your badge and access to shorter lines for keynotes and events. This can give you some extra time to rest and recover from any previous night's activities 😉.&lt;/p&gt;

&lt;h2&gt;
  
  
  I am NOT convinced! Sounds like a lot of work! 📚
&lt;/h2&gt;

&lt;p&gt;It's important to remember that becoming an AWS Community Builder doesn't require you to do everything on this list. The beauty of the community is that we all bring different skills and perspectives to the table. Instead of trying to do everything at once, start small by dedicating 15-30 minutes a day to building your community presence. Incorporating it into your daily work can also be helpful. For example, use the knowledge you gain from working on a project to create a blog post.&lt;/p&gt;

&lt;p&gt;Personally, one of the biggest motivators for me is pushing myself out of my comfort zone. By becoming more visible in the community, I've learned to be more confident in my skills and abilities, which has helped me grow as a professional. Additionally, being recognized by others in the community is rewarding and helps me build my confidence. The best part is getting to meet so many amazing people in the process.&lt;/p&gt;

&lt;h2&gt;
  
  
  But I don't have any time ⏱
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyllex8zf2xseejodobh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyllex8zf2xseejodobh.png" alt="Busy" width="500" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I agree it can be challenging to find time to become an AWS Community Builder. However, it is important to remember that you don't have to do everything at once. Instead, start small by setting aside 15 or 30 minutes a day to write blogs or create content. You can also make it part of your daily routine, for example, by writing a blog post about a project you are working on.&lt;/p&gt;

&lt;p&gt;It's important to break out of your comfort zone and start taking action instead of just making plans. You can create a dev.to account in just a few minutes and start writing right away. You can even save drafts and continue working on them later.&lt;/p&gt;

&lt;p&gt;It's also helpful to find someone who can coach and support you in your efforts. Consider having a weekly catch-up with a colleague to discuss your progress and get feedback on your content. Remember, it's never too late to start, and even small steps can make a big difference in the long run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What has changed for me? 🧐
&lt;/h2&gt;

&lt;p&gt;In the time since I began writing this blog, I have had the opportunity to speak at and lead workshops at various AWS events. I have been sharing my experiences and insights on social media platforms such as Twitter and LinkedIn. In fact, I even received a public thank you from Werner Vogels, the CTO of AWS, for creating a special birthday video for him.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73w7y8b5na8wtr82e67e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73w7y8b5na8wtr82e67e.png" alt="Werner" width="800" height="801"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally, I have started my own YouTube channel, where I share tips and tutorials on various AWS-related topics. While it was tempting to spend a lot of time perfecting the channel's banner and intro, I learned that it's actually quite simple to create a professional-looking design using tools like PowerPoint.&lt;/p&gt;

&lt;p&gt;One of the most valuable things that has helped me stay motivated and on track with my goals is having regular catch-up sessions with a mentor. These check-ins allow me to receive feedback and guidance, which helps me to stay focused and continue to grow as a community builder.&lt;/p&gt;

&lt;h2&gt;
  
  
  I am convinced! But how to apply? 🍀
&lt;/h2&gt;

&lt;p&gt;To kickstart your journey as an AWS Community Builder, you can begin by adding your name to &lt;a href="https://pages.awscloud.com/aws-community-builders-program-waitlist.html" rel="noopener noreferrer"&gt;the waitlist&lt;/a&gt; for the program (this link only works when applications are closed). By doing so, you'll be notified when the next cycle of applications is open, and receive instructions on how to apply. Additionally, you can take steps to begin building your presence within the AWS community by engaging on social media platforms, joining local user groups, and contributing to community resources such as Github and Stack Overflow. Remember to focus on consistent and steady progress, rather than trying to do everything at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Good to know 📚
&lt;/h2&gt;

&lt;p&gt;When applying to the AWS Community Builders program, it's important to choose the categories that align with the content you've created or plan to create. The categories available are Cloud Operations, Containers, Data, Dev Tools, Front-End Web &amp;amp; Mobile, Game Tech, Graviton Arm, Machine Learning, Networking &amp;amp; Content Delivery, Security &amp;amp; Identity, Serverless and Storage. You can choose two categories when applying, but keep in mind that the content you submit should be relevant to these categories.&lt;/p&gt;

&lt;p&gt;AWS Community Builders are also grouped by geographic region, including Asia Pacific, Europe, Middle East, &amp;amp; Africa, Latin America, and USA &amp;amp; Canada. As of October 2022, there are around 2350 AWS Community Builders worldwide.&lt;/p&gt;

&lt;p&gt;One way to find other Community Builders in your area is to check out the map created by &lt;a class="mentioned-user" href="https://dev.to/jdonboch"&gt;@jdonboch&lt;/a&gt;, which uses AWS Location Services. You can find the map &lt;a href="https://acbmap.humbleg.com/aws/#1/0/0" rel="noopener noreferrer"&gt;here&lt;/a&gt; and read more about it in his blog post &lt;a href="https://dev.to/aws-builders/aws-location-service-where-my-aws-community-builders-at-e02"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thank you
&lt;/h2&gt;

&lt;p&gt;Thank you for reading my blog post. I hope you found it informative and helpful in your journey to becoming an AWS Community Builder. If you are interested in keeping up with my content, please consider subscribing to my dev.to account and YouTube channel &lt;a href="https://youtube.com/@obsessedbyaws" rel="noopener noreferrer"&gt;Obsessed By AWS&lt;/a&gt;. Your support will not only help me reach my goal of 100 subscribers, but also ensure that you stay updated on my latest content and updates.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>awscommunitybuilders</category>
      <category>community</category>
      <category>awscommunitybuilder</category>
    </item>
  </channel>
</rss>
