<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammad Naimur Rahman on Medium]]></title>
        <description><![CDATA[Stories by Mohammad Naimur Rahman on Medium]]></description>
        <link>https://medium.com/@naiem_ece?source=rss-b1be580fbed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YvEHZ7fXTbzARDdK8uM1UA.jpeg</url>
            <title>Stories by Mohammad Naimur Rahman on Medium</title>
            <link>https://medium.com/@naiem_ece?source=rss-b1be580fbed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 14:51:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@naiem_ece/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Concurrency & Parallelism in Python: Threading and Multiprocessing]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-link"><a href="https://medium.com/learn-python-programming/concurrency-parallelism-in-python-threading-and-multiprocessing-6caa40228b36?source=rss-b1be580fbed------2">Continue reading on Learn Python Programming »</a></p></div>]]></description>
            <link>https://medium.com/learn-python-programming/concurrency-parallelism-in-python-threading-and-multiprocessing-6caa40228b36?source=rss-b1be580fbed------2</link>
            <guid isPermaLink="false">https://medium.com/p/6caa40228b36</guid>
            <dc:creator><![CDATA[Mohammad Naimur Rahman]]></dc:creator>
            <pubDate>Tue, 28 Feb 2023 20:16:48 GMT</pubDate>
            <atom:updated>2023-02-28T20:16:48.382Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[AWS Lambda custom package deployment: requests, pandas, NumPy]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-link"><a href="https://medium.com/@naiem_ece/aws-lambda-custom-package-deployment-requests-pandas-numpy-f82355cf2a8c?source=rss-b1be580fbed------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@naiem_ece/aws-lambda-custom-package-deployment-requests-pandas-numpy-f82355cf2a8c?source=rss-b1be580fbed------2</link>
            <guid isPermaLink="false">https://medium.com/p/f82355cf2a8c</guid>
            <dc:creator><![CDATA[Mohammad Naimur Rahman]]></dc:creator>
            <pubDate>Tue, 28 Feb 2023 18:32:43 GMT</pubDate>
            <atom:updated>2023-02-28T18:32:43.942Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Sending Custom Metrics to CloudWatch Using Lambda]]></title>
            <link>https://medium.com/serverless-platform-architecture/sending-custom-metrics-to-cloudwatch-using-lambda-9ef8f5af4504?source=rss-b1be580fbed------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ef8f5af4504</guid>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Mohammad Naimur Rahman]]></dc:creator>
            <pubDate>Wed, 30 Jun 2021 22:11:59 GMT</pubDate>
            <atom:updated>2021-07-15T22:27:04.726Z</atom:updated>
            <content:encoded><![CDATA[<p>Create custom metrics in CloudWatch and add them to the dashboard as a widget</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*uaqyPWyVO6uBk9Bs0StsYw.jpeg" /><figcaption>Sending Custom Metrics to CloudWatch Using Lambda</figcaption></figure><h3><strong>Introduction:</strong></h3><p>In this article, we will discuss how custom metrics can be collected and sent to CloudWatch, and add that widget in the CloudWatch dashboard. Here, lambda is used to collect the metrics, and then those metrics are sent to CloudWatch. A dashboard can be created where we can add all those widgets to it. Here, lambda is triggered periodically using the event bridge. However, a lambda can be triggered based on the event as well.</p><h3><strong>Description:</strong></h3><p>In this demonstration, a lambda is created to collect the data which would be pushed to CloudWatch to show as custom metrics on the dashboard. When a lambda is created from the AWS console, and create a new execution IAM role is selected then that role gives lambda permission to send logs to Amazon CloudWatch as default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LUjnB3D9qJCMyta9VpTew.png" /><figcaption><strong>Lambda creation with new IAM as the execution role</strong></figcaption></figure><p>The role has a policy that can perform the below actions to CloudWatch by default.</p><ul><li>logs:CreateLogGroup</li><li>logs:CreateLogStream</li><li>logs:PutLogEvents</li></ul><p>Additional permission is needed to add to the JSON policy document to perform the <strong>PutMetricData </strong>action on the CloudWatch.</p><ul><li>logs:PutMetricData</li></ul><p>The figure shows the policy for added to the lambda execution role to send metrics to CloudWatch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BLUyn-Imwm8xidxe-8MjOA.png" /><figcaption><strong>Policy to push custom metrics to CloudWatch</strong></figcaption></figure><h3><strong>Code:</strong></h3><p>The lambda function runs the code given below that pushes the metrics to the CloudWatch. In this demonstration, we are collecting data for IoT devices that are online, and the number of total devices/controllers connected to the platform. Also, it is collecting the net number of alerts sent by the devices.</p><p>In order to create a metric in CloudWatch, there are several fields that are necessary. Those fields are provided below with details for each metric data.</p><ul><li><strong>Namespace</strong>: This entity name will appear on the Metric tab in CloudWatch.</li><li><strong>MetricData</strong> <br> — <strong>MetricName</strong>: This is the metric name that will appear on the chart (A MetricData can have multiple MetricName representing different metrics)<br> — <strong>Dimension</strong>: This is a list of dictionary datatype as “Name” and “Value”. This allows multiple “Name” &amp; “Value” for a single entity.<br> — <strong>Unit</strong>: This is the Unit that will appear on the top of the Y-axis.<br> — <strong>Value</strong>: This is the actual value of the data plotted on the Y-axis.</li></ul><pre>import boto3<br>import random</pre><pre>cloudwatch = boto3.client(&#39;cloudwatch&#39;)</pre><pre>def publishing_metrics(num,total,alarm):<br>    response = cloudwatch.put_metric_data(<br>        MetricData = [<br>            {<br>                &#39;MetricName&#39;: &#39;OnlineDevices&#39;,<br>                &#39;Dimensions&#39;: [<br>                    {<br>                        &#39;Name&#39;: &#39;LastMessages&#39;,<br>                        &#39;Value&#39;: &#39;With-in-one-hour&#39;<br>                    },<br>                    {<br>                        &#39;Name&#39;: &#39;APP_VERSION&#39;,<br>                        &#39;Value&#39;: &#39;1.0&#39;<br>                    },<br>                    ],<br>                    &#39;Unit&#39;: &#39;Count&#39;,<br>                    &#39;Value&#39;: num<br>            },<br>            {<br>                &#39;MetricName&#39;: &#39;TotalDevices&#39;,<br>                &#39;Dimensions&#39;: [<br>                    {<br>                        &#39;Name&#39;: &#39;LastMessages&#39;,<br>                        &#39;Value&#39;: &#39;With-in-one-year&#39;<br>                    },<br>                    {<br>                        &#39;Name&#39;: &#39;APP_VERSION&#39;,<br>                        &#39;Value&#39;: &#39;1.0&#39;<br>                    },<br>                    ],<br>                    &#39;Unit&#39;: &#39;Count&#39;,<br>                    &#39;Value&#39;: total<br>            },<br>            ],<br>            Namespace = &#39;ConnectedControllers&#39;)<br>    response = cloudwatch.put_metric_data(<br>        MetricData = [<br>            {<br>                &#39;MetricName&#39;: &#39;OnlineDevices&#39;,<br>                &#39;Dimensions&#39;: [<br>                    {<br>                        &#39;Name&#39;: &#39;LastMessages&#39;,<br>                        &#39;Value&#39;: &#39;With-in-one-hour&#39;<br>                    },<br>                    {<br>                        &#39;Name&#39;: &#39;APP_VERSION&#39;,<br>                        &#39;Value&#39;: &#39;1.0&#39;<br>                    },<br>                    ],<br>                    &#39;Unit&#39;: &#39;Count&#39;,<br>                    &#39;Value&#39;: num<br>            },<br>            {<br>                &#39;MetricName&#39;: &#39;TotalDevices&#39;,<br>                &#39;Dimensions&#39;: [<br>                    {<br>                        &#39;Name&#39;: &#39;LastMessages&#39;,<br>                        &#39;Value&#39;: &#39;With-in-one-year&#39;<br>                    },<br>                    {<br>                        &#39;Name&#39;: &#39;APP_VERSION&#39;,<br>                        &#39;Value&#39;: &#39;1.0&#39;<br>                    },<br>                    ],<br>                    &#39;Unit&#39;: &#39;Count&#39;,<br>                    &#39;Value&#39;: total<br>            },<br>            {<br>                &#39;MetricName&#39;: &#39;AlarmReportedDevice&#39;,<br>                &#39;Dimensions&#39;: [<br>                    {<br>                        &#39;Name&#39;: &#39;LastMessages&#39;,<br>                        &#39;Value&#39;: &#39;With-in-one-hour&#39;<br>                    },<br>                    {<br>                        &#39;Name&#39;: &#39;APP_VERSION&#39;,<br>                        &#39;Value&#39;: &#39;1.0&#39;<br>                    },<br>                    ],<br>                    &#39;Unit&#39;: &#39;Count&#39;,<br>                    &#39;Value&#39;: alarm<br>            },<br>            ],<br>            Namespace = &#39;ControllersAlarm&#39;)</pre><p>The unit must be a value in the set below.</p><p>[ Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None ].</p><p>In the code above, it is sending data to the CloudWatch with custom Namespace (“ConnectedControllers”, “ControllersAlarm”) that appear under Custom Namespace in the CloudWatch Metric tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vzY9id4yFvbKyvFhsZF5wQ.png" /><figcaption><strong>Custom Metrics for CloudWatch</strong></figcaption></figure><p><strong>ConnectedControllers </strong>widget<strong> </strong>shown in the figure below contains two metrics (OnlineDevice, TotalDevices).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FrM1qBCZnytLJrEZVt7PHw.png" /><figcaption><strong>ConnectedControllers Widget</strong></figcaption></figure><p><strong>ControllersAlarm </strong>widget is shown in the figure below contains three metrics (AlarmReportedDevice, OnlineDevice, TotalDevices).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iO_tm1EbFZEFyrvc33phzQ.png" /><figcaption><strong>ControllersAlarm Widget</strong></figcaption></figure><p>Those widgets can be added to different CloudWatch dashboards.</p><h3><strong>Conclusion:</strong></h3><p>This article covered how custom metrics can be sent to CloudWatch and how to add those metrics to the CloudWatch dashboard.</p><p>Thank you for reading the article. Please feel free to provide feedback and/or post questions in the comment section.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ef8f5af4504" width="1" height="1" alt=""><hr><p><a href="https://medium.com/serverless-platform-architecture/sending-custom-metrics-to-cloudwatch-using-lambda-9ef8f5af4504">Sending Custom Metrics to CloudWatch Using Lambda</a> was originally published in <a href="https://medium.com/serverless-platform-architecture">Serverless Platform Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[List, Tuple, Set, and Dictionary data types and use cases]]></title>
            <link>https://medium.com/learn-python-programming/list-tuple-set-and-dictionary-data-type-and-use-cases-b6d02e1c7bbb?source=rss-b1be580fbed------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6d02e1c7bbb</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Mohammad Naimur Rahman]]></dc:creator>
            <pubDate>Mon, 22 Mar 2021 00:50:57 GMT</pubDate>
            <atom:updated>2021-05-19T02:02:17.526Z</atom:updated>
            <content:encoded><![CDATA[<p>Python sequence and mapping data types and use cases</p><p>List, Tuple, Set, Dictionary are some of the most commonly used data types in python. All those data types have specific advantages depending on the type of operation that needs to be performed. Choosing the right type of data is very important as this can lead to high execution time and inefficient memory usages. This article will cover those sequence and mapping data types and it’s use cases.</p><p>One of the most important terms for data types is mutability. The term mutable means the new item(s) can be added or existing item(s) can be updated or deleted from the data structure. Immutable means items or elements are fixed in the data structured insert, update, and delete is not permitted.</p><h3><strong>List:</strong></h3><p>A list is a collection of elements. The items in a list are separated by a comma.</p><ul><li>Items in the list can be accessed by their index e.g. a[0] = 1.</li><li>The list is mutable. So, items can be added, updated, and deleted from the list.</li><li>As the list is mutable, hence accessing or iterating items from the list has more time complexity due to its dynamic nature over a tuple.</li><li>The list can store any type of data element e.g. int, str, etc.</li></ul><pre>&gt;&gt;&gt; a = [1,2,3,4,5,6]<br>&gt;&gt;&gt; type(a)<br>&lt;class &#39;list&#39;&gt;</pre><p>The list is useful over tuple when we need to perform add or delete on the data structure. Because of this dynamic nature choosing a list over a tuple will increase the runtime of the program while accessing or iterating items from the list.</p><h3>Tuple:</h3><p>A tuple is a collection of data elements like a list. The items in a tuple are separated by a comma. However, the major difference is, a tuple is immutable.</p><pre>&gt;&gt;&gt; a = (1,2,3,4,5,6)<br>&gt;&gt;&gt; type(a)<br>&lt;class &#39;tuple&#39;&gt;<br>&gt;&gt;&gt; len(a)<br>6</pre><ul><li>Items in the tuple can be accessed by its index e.g. a[0] =1</li><li>Items can’t be added or deleted once the tuple is defined.</li><li>Also, items can’t be updated in a tuple</li></ul><pre>&gt;&gt;&gt; a<br>(1, 2, 3, 4, 5)<br>&gt;&gt;&gt; a[0]<br>1<br>&gt;&gt;&gt; a[0] = 6<br>Traceback (most recent call last):<br>File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>TypeError: &#39;tuple&#39; object does not support item assignment</pre><ul><li>The tuple can store any type of data element e.g. int, str, etc</li></ul><p>The tuple is preferred over a list when we need to deal with a fixed data type e.g. [‘MON’, ‘TUE’, ‘WED’, ‘THU’, ‘FRI’, ‘SAT’, ‘SUN’]. Because of the immutable nature, a tuple is efficient in terms of the runtime of the program while accessing or iterating items from it.</p><h3><strong>Set</strong>:</h3><p>Set is an unordered collection of data elements. Items in a set are separated by a comma.</p><pre>&gt;&gt;&gt; a = {1,2,3,4,5,6}<br>&gt;&gt;&gt; type(a)<br>&lt;class &#39;set&#39;&gt;<br>&gt;&gt;&gt; len(a)<br>6</pre><ul><li>set is an unordered collection of data elements. So, items in the set can’t be accessed by its index.</li></ul><pre>&gt;&gt;&gt; a = {1,2,3,4,5,6}<br>&gt;&gt;&gt; a[0]<br>Traceback (most recent call last):<br>  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>TypeError: &#39;set&#39; object is not subscriptable</pre><ul><li>set does not allow duplicates. So adding an existing element to the set will not make any change. However, items in a set can be deleted/removed.</li></ul><pre>&gt;&gt;&gt; a = {1,2,3,4,5,6}<br>&gt;&gt;&gt; a.add(1)<br>&gt;&gt;&gt; a<br>{1, 2, 3, 4, 5, 6}<br>&gt;&gt;&gt; a.remove(1)<br>&gt;&gt;&gt; a<br>{2, 3, 4, 5, 6}</pre><p>Set is really useful when a programmer needs to check whether an item exists in the data structure. This leads to an efficient time complexity over tuple or list.</p><p><strong>frozenset():</strong></p><p>frozenset() is an immutable version of a set. Using frozenset() function, a given iterable can be converted to a frozen set. frozenset does not allow add, update, and delete operation on it.</p><pre>&gt;&gt;&gt; a =frozenset({1,2,3,4,5,6})<br>&gt;&gt;&gt; a<br>frozenset({1, 2, 3, 4, 5, 6})<br>&gt;&gt;&gt; a.add(1)<br>Traceback (most recent call last):<br>  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>AttributeError: &#39;frozenset&#39; object has no attribute &#39;add&#39;<br>&gt;&gt;&gt; a.remove(1)<br>Traceback (most recent call last):<br>  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>AttributeError: &#39;frozenset&#39; object has no attribute &#39;remove&#39;</pre><h3><strong>Dictionary (dict)</strong>:</h3><p>Dictionary is a data type that stores data values as key: values pair. Dictionary is written in curly brackets with comma-separated key: value pair.</p><pre>&gt;&gt;&gt; a = {&#39;a&#39;:1,&#39;b&#39;:2,&#39;c&#39;:3}<br>&gt;&gt;&gt; type(a)<br>&lt;class &#39;dict&#39;&gt;<br>&gt;&gt;&gt; len(a)<br>3</pre><ul><li>dict is an ordered collection of elements that allow the addition, update, and deletion of items.</li><li>dict allows retrieving values using keys. keys and values can be accessed by the following. e.g. a.keys() gives all the keys, a.values() return all the values.</li></ul><pre>&gt;&gt;&gt; a.keys()<br>dict_keys([&#39;a&#39;, &#39;b&#39;, &#39;c&#39;])<br>&gt;&gt;&gt; a.values()<br>dict_values([1, 2, 3])</pre><ul><li>A key is unique to a dictionary meaning key can’t be duplicated in the same dictionary. Also, a value can be retrieved by providing a corresponding key.</li></ul><pre>&gt;&gt;&gt; a[&#39;a&#39;]<br>1</pre><ul><li>A key can be any type of data element e.g. int, str, etc. However, values for a key can be int, str, list(), set(), tuple.</li></ul><pre>&gt;&gt;&gt; a = {&#39;a&#39;:1,2:&#39;b&#39;,&#39;c&#39;:[1,2,3]}<br>&gt;&gt;&gt; a[&#39;a&#39;]<br>1<br>&gt;&gt;&gt; a[&#39;c&#39;]<br>[1, 2, 3]<br>&gt;&gt;&gt; a[2]<br>&#39;b&#39;</pre><p>This article provides a basic idea about list, tuple, set, and dictionary in python.</p><p>Thank you for reading this article. Please feel free to provide feedback and post questions in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6d02e1c7bbb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/learn-python-programming/list-tuple-set-and-dictionary-data-type-and-use-cases-b6d02e1c7bbb">List, Tuple, Set, and Dictionary data types and use cases</a> was originally published in <a href="https://medium.com/learn-python-programming">Learn Python Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Export documents (images, pdf) stored as blob/ binary in SQL server using Python]]></title>
            <link>https://medium.com/learn-python-programming/export-documents-images-pdf-stored-as-blob-binary-in-sql-server-using-python-4691e05598cc?source=rss-b1be580fbed------2</link>
            <guid isPermaLink="false">https://medium.com/p/4691e05598cc</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[binary]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[unstructured-data]]></category>
            <dc:creator><![CDATA[Mohammad Naimur Rahman]]></dc:creator>
            <pubDate>Sat, 20 Feb 2021 19:12:06 GMT</pubDate>
            <atom:updated>2021-02-23T02:58:03.211Z</atom:updated>
            <content:encoded><![CDATA[<p>Export documents stored in SQL Server using python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*O_LfjEAAGHAf7hbu5O2ZHQ.jpeg" /><figcaption>Fig. 1: Exporting PDF/ Image stored in SQL server</figcaption></figure><h3><strong>Introduction</strong></h3><p>In this article, we will discuss exporting or extracting document files such as images, pdf, text files stored in the SQL Server table using python.</p><p>Unstructured data e.g. image, pdf, document file can be stored in an SQL database as binary content. However, exporting those content can be challenging depending upon the process available to use.</p><h3><strong>Code</strong></h3><p>The below code shows an illustration of exporting unstructured files stored in an SQL server using python.</p><p>The example uses pymsssql library to export data from the MSSQL server. Statement query defines in <strong>stmt</strong> which shows column <strong>ReportFileName </strong>(name of the file), and <strong>ReportContent</strong> is the actual file content.</p><pre>import pymssql<br>stmt = &quot;Select ReportFileName,ReportContent from &lt;db_name&gt;.&lt;tablename&gt;;&quot;<br>conn = pymssql.connect(server=&quot;&lt;server IP/URL&gt;&quot;,user=&quot;&lt;username&gt;&quot;,password=&quot;&lt;password&gt;&quot;,database=&quot;&lt;datebase_name&gt;&quot;)<br>cursor = conn.cursor()<br>cursor.execute(stmt)<br>row = cursor.fetchall()<br>for i in row:<br>    try:<br>        with open(i[0], &#39;wb&#39;) as outfile:<br>            outfile.write(i[1])<br>            outfile.close()<br>            print(&quot;Filename Saved as: &quot; + i[0])<br>    except:<br>        pass</pre><h3><strong>Conclusion</strong></h3><p>In this article, we discussed how the document file can be exported from the SQL server. Depending upon the type of server (MSSQL, MySQL, or Postgre SQL) corresponding library can be used.</p><p>Please provide feedback/post questions in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4691e05598cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/learn-python-programming/export-documents-images-pdf-stored-as-blob-binary-in-sql-server-using-python-4691e05598cc">Export documents (images, pdf) stored as blob/ binary in SQL server using Python</a> was originally published in <a href="https://medium.com/learn-python-programming">Learn Python Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a custom domain without migrating the parent domain and certificates in AWS for APIs]]></title>
            <link>https://medium.com/serverless-platform-architecture/create-a-custom-domain-without-migrating-the-parent-domain-and-certificates-in-aws-for-apis-3c471019504b?source=rss-b1be580fbed------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c471019504b</guid>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[domain-names]]></category>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <dc:creator><![CDATA[Mohammad Naimur Rahman]]></dc:creator>
            <pubDate>Wed, 03 Feb 2021 21:22:19 GMT</pubDate>
            <atom:updated>2021-02-03T21:24:34.595Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*3N3hD4GZA18VFXjM7FzAVw.jpeg" /><figcaption><strong>Fig 1. API gateway as an entry point for API</strong></figcaption></figure><h3><strong>Introduction</strong></h3><p>In this article, we are going to discuss how we can create custom domains for web and API microservices without migrating the parent domain and SSL certificates in AWS. Also, this is useful when your parent domain and DNS service is not managed by AWS (AWS DNS entry can be used to manage only DNS at the parent domain managed side).</p><h3>Managing Certificates through ACM</h3><p>AWS Certificate Manager (ACM) allows requesting public certificates for domains trusted by the browser and operating systems. You can request certificates for your domain or import an existing certificate without requesting a new one. Here, we will explain how we can request a public certificate for your domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lrOkaVi-vuBva4cfPoRDow.png" /><figcaption><strong>Fig 2. ACM service to request a certificate</strong></figcaption></figure><p>Add the domain name for which you need the certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcZjIMDvKp2yvgKVZRQSxw.png" /><figcaption><strong>Fig 3. Add domain name</strong></figcaption></figure><p>Now the domain validation can be performed in two ways. DNS validation will provide a CNAME entry that needs to be added to the DNS entry for the parent domain. Email validation requires providing the email address of the contact address of the domain owner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2d7-o3laslwJ1tcxdzqiw.png" /><figcaption><strong>Fig 4. Validation method (DNS/ Email)</strong></figcaption></figure><p>Once the validation is completed, you can use Amazon issued certificate for our domain with AWS services like API Gateway.</p><h3>Create custom domain</h3><p>A subdomain for the parent domain can be created from the custom domain tab under the API gateway service. Provide the preferred domain name and choose the certificate from the ACM tab as shown in the figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Ty0zC34Ts2imCWOfv8-1Q.png" /><figcaption><strong>Fig 5. Create Custom Domain</strong></figcaption></figure><p>Once the custom domain is created it will provide a CloudFront endpoint as an entry. Now this record needs to be added as a CNAME in the parent domain DNS entry. e.g. api.example.com -&gt; CNAME (Record Type) -&gt; Cloudfront URL. Those are marked in the figure below with red boxes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dV5BOZ0Wn91ax2eXvS_77g.png" /><figcaption><strong>Fig 6. Endpoint Configuration for Custom Domain Names</strong></figcaption></figure><p>Now in the API mapping section, the custom domain can be mapped to API created from the API gateway. Users requesting resources to the custom domain will route to the corresponding API.</p><h3>Conclusion</h3><p>In this article, we covered ACM to issue a certificate for a domain and use it for the custom domain. Also, the Custom domain can be mapped to the API gateways. API gateway can be used as a single point of entry for the web applications and API microservices hosted in AWS. This is really useful when the parent domain is not owned by AWS and DNS is also not managed by AWS Route 53 service.</p><p>Please provide feedback/post questions in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c471019504b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/serverless-platform-architecture/create-a-custom-domain-without-migrating-the-parent-domain-and-certificates-in-aws-for-apis-3c471019504b">Create a custom domain without migrating the parent domain and certificates in AWS for APIs</a> was originally published in <a href="https://medium.com/serverless-platform-architecture">Serverless Platform Architecture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>