<?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 Naoufal EL GAFA on Medium]]></title>
        <description><![CDATA[Stories by Naoufal EL GAFA on Medium]]></description>
        <link>https://medium.com/@naoufal-gafa?source=rss-42674a45a048------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zMG9ccD_FYOhlpPzdHwkCA.png</url>
            <title>Stories by Naoufal EL GAFA on Medium</title>
            <link>https://medium.com/@naoufal-gafa?source=rss-42674a45a048------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 19:36:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@naoufal-gafa/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[EKS Hybride With Terraform: EC2 & Fargate]]></title>
            <link>https://naoufal-gafa.medium.com/eks-hybride-with-terraform-ec2-fargate-9ca3849070a5?source=rss-42674a45a048------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ca3849070a5</guid>
            <category><![CDATA[aws-fargate]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws-eks-fargate]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[aws-eks-using-terraform]]></category>
            <dc:creator><![CDATA[Naoufal EL GAFA]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 21:37:47 GMT</pubDate>
            <atom:updated>2023-03-10T21:37:47.823Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*t-YAcRK9evOdCy2EextbKg.png" /></figure><p>It has been a long time since I last wrote a new story. There have been a lot of changes, a lot of stuff to manage, and many problems to resolve 😅.</p><p>But today, I am back with a new story where I will be talking about an EKS Hybrid Cluster with EC2 and Fargate, deployed with Terraform.</p><h3>Context</h3><p>When you arrive at a new project in a large company with a critical environment that requires maintaining a blueprint, you need to have a clear understanding of what has been previously done before implementing new features to the blueprint.</p><p>Furthermore, if you utilize the AWS EKS CLI, it will automatically install all necessary resources, and customization is unnecessary since all resources are deployed automatically 👌🏼.</p><p>The blueprint in question is an #EKS Blueprint with #EC2, and my task was to add a new feature to include the ability to use #EKS with #<strong>Fargate</strong>, keeping in mind that the Terraform EKS Module has not been implemented in the blueprint yet.</p><h3>Prerequisites:</h3><ul><li>A good understanding of EKS</li><li>A good understanding of FargateProfile: <a href="https://docs.aws.amazon.com/eks/latest/userguide/fargate.html">https://docs.aws.amazon.com/eks/latest/userguide/fargate.html</a></li><li>A good understanding of Terraform</li><li>A good understanding of AWS resources such as Security Groups and Networking.</li></ul><p>There are a lot of tutorials that explain how to deploy EKS with Terraform, such as <a href="https://engineering.finleap.com/posts/2020-02-27-eks-fargate-terraform/">https://engineering.finleap.com/posts/2020-02-27-eks-fargate-terraform/</a>.</p><p>However, in this story, I’ll provide a <strong>SOLUTION</strong> to a significant problem that isn’t mentioned in these tutorials when using #<strong>NodeGroups </strong>with <strong>#AWSLaunchTemplate</strong> and <strong>#Fargate 💪🏼</strong>.</p><h4>4 Steps to Add Fargate :</h4><ol><li>Create a Fargate Profile</li><li>Create a Role with principal service: eks-fargate-pods.amazonaws.com</li><li>Create a policy attachment with this role and this policy arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy</li><li>Attache the role to the Fargate Profile</li></ol><p>You can find all these steps in this Gist</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8464c90bfd30eac18c6816421bca165b/href">https://medium.com/media/8464c90bfd30eac18c6816421bca165b/href</a></iframe><p>The end 😂😂😂😂😂,</p><p><strong>I’m joking. Now, we will talk about the problem and the solution.</strong></p><h3>The Problem :</h3><p>So, with this example, everything normally works fine, assuming that you already have your node groups working. When you deploy a new pod on Fargate, it should work fine 🙂.</p><p><strong>However, communication between pods on Fargate and pods on EC2 will not be resolved. 😮</strong></p><p>For example, if you run this command from a pod deployed on Fargate, you will experience a DNS timeout</p><pre>kubectl exec -it [podname] -n fargate-example -- nslookup kube-dns.kube-system.svc.cluster.local</pre><p>If you run the same command from a pod deployed on an EC2 node to resolve the pod on Fargate, it will work 😱 😡.</p><p><strong>Keep in mind that we already have a custom security group attached to the EKS control plane to allow communication between the control plane and nodes.</strong></p><h3>Solution:</h3><p>After weeks of debugging and searching through AWS Documentation, we contacted <strong>AWS to see what the solution would be</strong>.😎</p><p>Be ready, it’s too simple but more difficult to find: <strong>When Terraform deploys the EKS Cluster, EKS will create a default security group, and we must attach this default security group to our managed nodes, especially when our node groups use a launch template to which we attach security groups</strong>.</p><p>To do so :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98c410c805ae7ff2e2176edb337654b5/href">https://medium.com/media/98c410c805ae7ff2e2176edb337654b5/href</a></iframe><h3>Conclusion :</h3><blockquote>“When you have a hybrid cluster with EC2 and Fargate, and you want to resolve DNS between pods deployed on Fargate and others on EC2, always have the reflex to attach the default security group of your cluster to your node groups, especially when you customize the security group attached to your launch template.”</blockquote><p><strong>magic word 🤪 : aws_eks_cluster.eks_cluster.vpc_config.0.cluster_security_group_id</strong></p><p>For more stories, please <strong>subscribe</strong> and <strong>interact</strong>. If you have <strong>another</strong> <strong>subject</strong> in mind that you would like me to <strong>explain</strong>, please feel free to put it in the comments.🙏🏼</p><p>See you ✌🏼</p><ul><li><a href="https://levelup.gitconnected.com/aws-s3m-pattern-terraform-devops-for-a-10-years-child-dac4610017ff">AWS S3M Pattern: Terraform &amp; DevOps for a 10 Years Child</a></li><li><a href="https://medium.com/geekculture/5-steps-to-auto-install-k8s-with-cloud-config-ad2935c559c7">3 Steps To Auto-Install K8S with Cloud-config</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ca3849070a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Steps To Auto-Install K8S with Cloud-config]]></title>
            <link>https://naoufal-gafa.medium.com/3-steps-to-auto-install-k8s-with-cloud-config-1c4f9a6ba572?source=rss-42674a45a048------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c4f9a6ba572</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Naoufal EL GAFA]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 10:38:20 GMT</pubDate>
            <atom:updated>2021-08-03T11:10:28.670Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part-2: Deploy Bonus Examples K8S Cluster “For Beginner”</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i8cA-SkF049B8-tamnvKow.png" /></figure><p>This article is the continuation of the previous one</p><p><a href="https://naoufal-gafa.medium.com/5-steps-to-auto-install-k8s-with-cloud-config-ad2935c559c7">3 Steps To Auto-Install K8S with Cloud-config</a></p><blockquote><strong>In a real Prod Environment, the exposed services must use LoadBalancer or IngressController or both to communicate with the outside.</strong></blockquote><blockquote><strong>However for the bonus examples i’ll make it simple by exposing our services via NodePorts</strong></blockquote><blockquote><strong>The Goals is always to be familiarized with this techno</strong> 😉</blockquote><h3>Bonus 1 : Install Kubernetes Dashboard</h3><h4>To deploy K8s Dashboard, execute the following command:</h4><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml">https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml</a></pre><h4>Create An Authentication Token (RBAC)</h4><pre># created a service account<br>kubectl create serviceaccount dashboard-admin-sa</pre><pre># Bind the dashboard admin service account to the cluster-admin role<br>kubectl create clusterrolebinding dashboard-admin-sa --clusterrole=cluster-admin --serviceaccount=default:dashboard-admin-sa</pre><h4>Change the type of the Kubernetes-dashboard service to be a NodePort</h4><pre>kubectl edit svc kubernetes-dashboard -n kubernetes-dashboard<br># in the file change type to be NodePort</pre><h4>Describe the service of Kubernetes Dashboard to get the NodePort :</h4><pre>kubectl describe service kubernetes-dashboard -n kubernetes-dashboard</pre><pre>Name:                     kubernetes-dashboard<br>...<br>NodePort:                 &lt;unset&gt;  32278/TCP<br>...</pre><h4>Reach your dashboard via the internet :</h4><ul><li>Type this address in your navigator : <a href="http://https//[Public_Address_IP_Of"><strong>HTTPS://[Public_Address_IP_Of</strong></a><strong> Worker1]:[NodePort]</strong></li></ul><blockquote>you can find the public IP address of your worker on your Azure Portal</blockquote><ul><li>To get the token run on your master node :</li></ul><pre>kubectl get secret $(kubectl get sa/dashboard-admin-sa -o jsonpath=”{.secrets[0].name}”) -o go-template=”{{.data.token | base64decode}}”</pre><pre>eyJhbGciOiJSUzI1NiIsImtpZCI6I...</pre><h3>Bonus 2: Run HelloWorld Example</h3><h4>Use these commands to deploy a simple Hello-world Example :</h4><pre># run the hello-world pod<br>kubectl run hello-world --image=k8s.gcr.io/echoserver:1.4 --port=8080</pre><pre># expose the pod<br>kubectl expose pod hello-world --type=NodePort --port=80 --target-port=8080 --name hello-world-service</pre><pre># get or describe the service to get the node port<br>kubectl get svc hello-world-service</pre><h4>Verify if your pod is running with the Kubernetes dashboard</h4><figure><img alt="K8S Installation with Cloud-config" src="https://cdn-images-1.medium.com/max/1024/1*KRoCfPr8DkW7hMJGzq4DXw.jpeg" /><figcaption>k8s dashboard</figcaption></figure><h4>Reach your hello-world pod via internet : <a href="http://https//[Public_Address_IP_Of">HTTPS://[Public_Address_IP_Of</a> Worker1]:[NodePort]</h4><figure><img alt="K8S Installation with Cloud-config" src="https://cdn-images-1.medium.com/max/1024/1*9NHGJKh5n2uLkk2-Jw4yQw.jpeg" /><figcaption>k8s hello-world</figcaption></figure><h3>Conclusion</h3><p>It was a quick Tuto to deploy k8s Dashboard and the hello-world example.</p><p><strong>In the next story, </strong>I’ll add another <strong>layer </strong>of <strong>automation </strong>by using <strong>terraform (IaC) </strong>with <strong>cloud-init</strong> and <strong>CI/CD</strong> to deploy the complete <strong>IAAS of K8S</strong> clusters with one <strong>button click</strong> 😀.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c4f9a6ba572" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Steps To Auto-Install K8S with Cloud-config]]></title>
            <link>https://medium.com/geekculture/5-steps-to-auto-install-k8s-with-cloud-config-ad2935c559c7?source=rss-42674a45a048------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad2935c559c7</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Naoufal EL GAFA]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 00:12:54 GMT</pubDate>
            <atom:updated>2021-08-15T15:38:28.062Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part-1: Auto-Install, Configure K8S Cluster From scratch “For Beginner”</h4><blockquote>Me: “Son, can you plz install for me the <strong>K8S Cluster </strong>😆 ??”</blockquote><blockquote>Son: ”<strong>On Prod Env</strong> ! 😲”</blockquote><blockquote>Me : “Yes Plz !! It’s <strong>easy </strong>than you <strong>think </strong>😉”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d2G5pxCptBLaoNmUKimArg.jpeg" /><figcaption><strong>We&#39;ll Do It</strong></figcaption></figure><p>Installing a K8S Cluster from scratch was challenging work to do 😫, the <strong>k8s </strong>official documentation is too big and the <strong>pieces </strong>of <strong>information </strong>are dispatched in different sections 😅, so for someone who wants to learn this <strong>technology </strong>from <strong>scratch</strong>, it takes <strong>much </strong>time to <strong>search</strong>, <strong>understand</strong>, <strong>install </strong>and <strong>configure</strong>.</p><p>I started this story with an <strong>imaginary </strong>conversation with my <strong>3-year-old son </strong>to prove that it is too <strong>easy </strong>than you think to <strong>install </strong>a <strong>K8S </strong>cluster in a similar <strong>production</strong> environment without a complex <strong>implementation </strong>of the <strong>security </strong>aspect 😝.</p><p>The <strong>goal </strong>at <strong>first </strong>is to <strong>familiarize beginners </strong>with this <strong>environment</strong> by simplifying the installation and configuration of a K8S Cluster in a <strong>Similar Production Environment</strong></p><p>You can find the bonus examples here 👌 :</p><p><a href="https://naoufal-gafa.medium.com/3-steps-to-auto-install-k8s-with-cloud-config-1c4f9a6ba572">3 Steps To Auto-Install K8S with Cloud-config</a></p><p>Let get started 😁</p><h3>Context</h3><p>For <strong>Learning Environments, </strong>you can use <strong>minikube, </strong><strong>micro-k8s</strong> or <strong>kind</strong>, all these three installs and configure <strong>Kubernetes </strong>quickly, and no need for some advanced system configuration.</p><p>However, in a <strong>Production environment</strong>, we have 3 ways to do it :</p><ul><li><strong>kubeadm</strong></li><li><strong>kops</strong></li><li><strong>kubesray</strong></li></ul><p>I will simplify the steps to setting up our PAAS <strong>K8S </strong>with <strong>two Azure VM </strong>( you can choose any other cloud provider VMs) with <strong>kubeadm </strong>by using the <a href="https://cloudinit.readthedocs.io/en/latest/topics/format.html#cloud-config-data"><strong>Cloud-config data</strong></a><strong> </strong>on the <strong>custom-data</strong> (<a href="https://cloudinit.readthedocs.io/en/latest/topics/format.html#user-data-formats"><strong>user-data</strong></a> for other cloud providers) of the <strong>VMs,</strong> and <strong>trust me </strong>it will help you <strong>save time</strong> 😇.</p><blockquote>Prerequisites :</blockquote><blockquote>→ Azure Account (or Create One)</blockquote><h3>Step 1: Create a Network Security Group</h3><p>Before creating VMs, let create the required <strong>Network Security Groups (NSG) </strong>that will be used for different machines :</p><ul><li>Go to Network security groups and create these two NSG as mentioned in the image below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9qAOcgjhnKkRd7wWErXQA.jpeg" /><figcaption>Network Security Group</figcaption></figure><ul><li><strong>medium-k8s-master-nsg</strong> will be attached to <strong>the network interface</strong> <strong>of the control plane node (VM) → </strong>The inbound security rules must satisfy the <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#check-required-ports">k8s requirement</a>, you should <strong>open </strong>these <strong>ports</strong>: <strong>6443</strong>, <strong>2379–2380</strong>, <strong>10250- 10251</strong></li></ul><figure><img alt="K8S Installation with Cloud-config" src="https://cdn-images-1.medium.com/max/1024/1*IZSCJyXw7ndO6BNdndeS-A.jpeg" /><figcaption>medium-k8s-master-nsg</figcaption></figure><ul><li><strong>medium-k8s-worker-nsg</strong> will be attached to the <strong>network interface of the worker’s node (VM) → </strong>The inbound security rules must satisfy the <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#check-required-ports">k8s requirement</a>, you should <strong>open </strong>these <strong>ports</strong>: 10250, 30000–32767</li></ul><figure><img alt="K8S Installation with Cloud-config" src="https://cdn-images-1.medium.com/max/1024/1*AUMdr7XFcMI2AyULDrlRAA.jpeg" /><figcaption><strong>medium-k8s-workers-nsg</strong></figcaption></figure><blockquote>For both don’t forget to open ssh 😉</blockquote><h3>Step 2: Create your VMs on Azure :</h3><p>All <strong>VMs </strong>will run the latest <strong>version </strong>of <strong>Ubuntu </strong>and according to the <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#before-you-begin"><strong>doc </strong></a>they must have at less: RAM ≥<strong>2 GB</strong> &amp; <strong>CPU</strong>≥ <strong>2 CPUs</strong></p><blockquote>If you create a new account with Azure you will have <strong>750 hours</strong> of Linux VM <strong>Free </strong>for <strong>12 month</strong> and <strong>200$ credit</strong> to use for <strong>30 days</strong> to test <strong>Azure payed services </strong>like the <strong>VMs </strong>that we will used it in this tuto 😉</blockquote><p>Go to virtual machines and click on <strong>“Create”</strong>, <strong>“Virtual machine”. </strong>try to follow the steps below by configuring each tab of the VM Creation 👌.</p><h4>1. Basics Tab :</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*Ij-tq99Tar7Kuj-LE01R-Q.jpeg" /><figcaption><strong>Basic Configuration — 1</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XO7Z9HAXvb95a6q1Gy8yBA.jpeg" /><figcaption><strong>Basic Configuration — 2</strong></figcaption></figure><h4>2. Networking tab</h4><p>Go to the Networking tabs and select the NSG created before:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*GDjlXVxWe_jOar7wRl3bZA.jpeg" /><figcaption><strong>Link NSG</strong></figcaption></figure><blockquote>Now is time to go to “<strong>Advanced Tab</strong>” and paste the <strong>“magic code”</strong> on the <strong>Custom data</strong></blockquote><h4>3. Advanced Tab</h4><p>This code will <strong>update </strong>&amp; <strong>upgrade </strong>the system, install <strong>docker, kubeadm, kubelet, and kubectl</strong>, and <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#letting-iptables-see-bridged-traffic"><strong>Letting </strong></a><a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#letting-iptables-see-bridged-traffic"><strong>iptables see bridged traffic</strong></a>.</p><blockquote><strong>I commented on each step and command of this file for a better understunding </strong>👌.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46b1fe14720efa50e59dd991ceb909ea/href">https://medium.com/media/46b1fe14720efa50e59dd991ceb909ea/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mRWSur9jl5SmEFcV6NNuOg.jpeg" /><figcaption><strong>Advanced Tab</strong></figcaption></figure><ul><li>All is done, click on <strong>“Review + create”</strong> and<strong> “Create”</strong></li><li>Download the private key and save it at ~/.ssh folder</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*ddlZ44e2O3FqM0XqnQhy0A.jpeg" /></figure><ul><li>Now <strong>repeat </strong>the same <strong>things </strong>to <strong>create </strong>the <strong>worker </strong>node machine by attaching the <strong>worker’s network security group</strong> for this time <strong>medium-k8s-workers-nsg</strong></li><li>SSH your machine with your downloaded private key :</li></ul><pre>chmod 400 ~/.ssh/medium-k8s-master_key.pem<br>ssh -i ~/.ssh/medium-k8s-master_key.pem k8s-user@40.127.103.3 #the ip address of your machine</pre><h3>Step 3: Configure your K8S Cluster</h3><h4>Configure the Master Node:</h4><blockquote>You must deploy a <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni">Container Network Interface</a> (CNI) based Pod network add-on so that your Pods can communicate with each other.</blockquote><blockquote>In our case, we will use <strong>Flannel </strong>as a <strong>CNIadd-on</strong> to implements the <a href="https://kubernetes.io/docs/concepts/cluster-administration/networking/#how-to-implement-the-kubernetes-networking-model">Kubernetes networking model</a>. so we have to pass that into the <strong>kubeadm init</strong> command.</blockquote><ul><li>On the master node, init your cluster by specifying the P<strong>od Network CIDR</strong></li></ul><pre>sudo kubeadm init --pod-network-cidr=10.244.0.0/16</pre><ul><li><strong>Copy </strong>and <strong>save </strong>the <strong>generated join command</strong></li></ul><pre>sudo kubeadm join 10.1.0.4:6443 --token 4tyt9j.uve6tfdb3a7rvb63         --discovery-token-ca-cert-hash sha256:04c3d3f38b3229fe7b8f808b02bbd48ce95d8a973882b281db579ce6734555c5</pre><ul><li>Get the configuration in a publically available place for <strong>kubectl </strong>to use:</li></ul><pre>mkdir -p $HOME/.kube<br>sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config<br>sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><ul><li>Deploy <a href="https://github.com/flannel-io/flannel#flannel">Flannel </a>Manually</li></ul><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml">https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml</a></pre><h4>Configure the slave node :</h4><p><strong>Paste </strong>the join command on the worker node by adding --node-name worker1.</p><blockquote>Do the same if you have multiple workers 👌.</blockquote><p>Example :</p><pre>sudo kubeadm join 10.1.0.4:6443 --token 4tyt9j.uve6tfdb3a7rvb63         --discovery-token-ca-cert-hash sha256:04c3d3f38b3229fe7b8f808b02bbd48ce95d8a973882b281db579ce6734555c5 --node-name worker1</pre><h4>Check your cluster :</h4><ul><li>on the Master node run</li></ul><pre># to see all resources on all namespace<br>kubectl get all --all-namespaces</pre><pre># to verify the joined worker nodes<br>kubectl get nodes</pre><pre>NAME                STATUS   ROLES                  AGE     VERSION<br>medium-k8s-master   Ready    control-plane,master   3d22h   v1.21.3<br>worker2             Ready    &lt;none&gt;                 3d22h   v1.21.3</pre><blockquote>All is done for the installation and basic configuration of a K8S Cluster, now is time to deploy the Bonus Examples</blockquote><blockquote><strong>See you on the next article 🙋</strong></blockquote><h3>Conclusion</h3><p><strong>Cloud-init </strong>is a great tool to initialize cloud instances(Azure VM), it allows us to automate the packages installations, files creation, and command execution 💪.<br>This automation limit <strong>manual interventions </strong>to the <strong>configuration </strong>of the cluster. So in <strong>few minutes</strong>, you’ll have your <strong>cluster ready</strong> and you can start <strong>deploying </strong>basics examples like <strong>k8s dashboard </strong>&amp; <strong>hello world</strong>).</p><p>You can now do whatever you want with your cluster: installing a <strong>MetalLb </strong>to create services of kind <strong>LoadBalancer</strong>, working with <strong>Ingress Controller</strong>, mounting <strong>volumes, deploying Prometheus and Grafana dashboard</strong>…</p><p><strong>In the next story, you will have the bonus examples</strong> ✌️</p><p>If you are interested in <strong>AWS Cloud Architecture</strong>, please <strong>refer </strong>to my articles about <strong>micro </strong>and <strong>serverless architectures</strong></p><ul><li><a href="https://naoufal-gafa.medium.com/aws-when-serverless-and-microservice-get-married-securely-6585f7856a0f">AWS S3M Pattern: 5 Steps to marry Serverless &amp; Microservice Securely</a></li><li><a href="https://levelup.gitconnected.com/aws-s3m-pattern-terraform-devops-for-a-10-years-child-dac4610017ff">AWS S3M Pattern: Terraform &amp; DevOps for a 10 Years Child</a></li><li><a href="https://medium.com/codex/aco-architecture-5-tips-to-auto-costoptimization-on-aws-67f026e3abcc">ACO Architecture: 5 Tips to Auto-CostOptimization on AWS</a></li></ul><blockquote><strong>Don’t forget to </strong>Clap<strong>, Comment, Share and Subscribe to be updated with the latest stories 😜</strong></blockquote><blockquote>If you have any remarks, feel free to contact me on my <a href="https://www.facebook.com/neogafa">Fb Page</a>, <a href="https://twitter.com/NaoufalGafa">Twitter</a>, or via <a href="https://www.elgafa.com/">my website</a></blockquote><h3>References</h3><ul><li><a href="https://kubernetes.io/docs">K8s Documentation</a></li><li><a href="https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md">K8S Dashboard</a></li><li><a href="https://betterprogramming.pub/kubernetes-from-scratch-4691283e3995">Kubernetes From Scratch</a></li><li><a href="https://gist.github.com/tsertkov/63592dda12d1b1818b7297fd2dccee0f">K8s cloud-config</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad2935c559c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/5-steps-to-auto-install-k8s-with-cloud-config-ad2935c559c7">3 Steps To Auto-Install K8S with Cloud-config</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ACO Architecture: 5 Tips to Auto-CostOptimization on AWS]]></title>
            <link>https://medium.com/codex/aco-architecture-5-tips-to-auto-costoptimization-on-aws-67f026e3abcc?source=rss-42674a45a048------2</link>
            <guid isPermaLink="false">https://medium.com/p/67f026e3abcc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[aws-cost-optimization]]></category>
            <category><![CDATA[finops]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Naoufal EL GAFA]]></dc:creator>
            <pubDate>Mon, 10 May 2021 07:02:36 GMT</pubDate>
            <atom:updated>2021-05-13T01:00:02.685Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part -1: ACO Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P9l3yqcWKZy-9CnSkW32PQ.jpeg" /><figcaption>AACO — Cost Optimization on AWS</figcaption></figure><p>I remember my first bill with AWS was $5 in 2016 knowing I had a year of the free tier 😠, I was shocked because I was sure that I only used the included services in the free offer.</p><p>However, when I studied my billing I discovered that I chose <strong>developers Support</strong> and is not included in the free tier 😛.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*nx5OcpqZ201oPNI8Y3UHuw.jpeg" /></figure><blockquote>Conclusion : Ignorance is Expensive 😲</blockquote><p>Budgeting on AWS is such an important aspect that an <strong>architect </strong>must take care of. we can always suggest a good-looking architecture with micro-services tied to serverless with managed services etc … 💪</p><p>But if the bills are too high at the end of the month we will have a problem 😅</p><p>The AWS Well-Architected is based on five pillars: operational excellence, security, reliability, performance efficiency, and <strong>cost optimization</strong>.</p><p>We&#39;ll talk in this story about the fifth.</p><p>For more about my stories</p><p><a href="https://naoufal-gafa.medium.com/">Naoufal EL GAFA - Medium</a></p><h3>Cost Optimization</h3><p>The cost optimization pillar focuses on avoiding unnecessary costs. Key topics include understanding and controlling where money is being spent, selecting the most appropriate and right number of resource types, analyzing spend over time, and scaling to meet business needs without overspending.</p><p>AWS has made a <a href="https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/cost-optimization.html">whitepaper </a>that groups best practices for cost optimization to help companies, but I’ll make it simple as usual and I’ll show you some tips to implement the <strong>ACO Architecture (Auto Cost Optimization) </strong>for Cost Optimization in your different services by using <strong>AWS Budgets</strong>, <strong>SNS and Lambda.</strong></p><blockquote>This tips will work fine if you have an <strong>Individual AWS account</strong>.</blockquote><blockquote>If you belong to an AWS organization or you are a company, they are other advanced tools to FinOps</blockquote><h3>5 Tips to Implement ACO Architecture :</h3><p>The ACO Architecture is based on a simple reflex:</p><blockquote><strong>If my spent budget reaches X% of my threshold I’ll stop, pause or whatever the appropriate(s) service (s) </strong>👌<strong>.</strong></blockquote><p>You have two choices to do it :</p><ul><li><strong>Cost Budget</strong>: Based on a specific amount. (For example 20$)</li><li><strong>Usage Budget</strong>: Based on <strong>service usage</strong>. (For example Ec2 Data Transfer, ECS Fargat vCPU Hours)</li></ul><p>In this Story, I’ll focus on <strong>Usage Budget</strong></p><h4>I - Abstract Architecture :</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3loM43AIuE0h7JESaq9Z6w.png" /><figcaption>Abstract ACO Architecture</figcaption></figure><blockquote><strong>To summarize this architecture :</strong></blockquote><blockquote>I <strong>create </strong>a <strong>budget </strong>in whish I <strong>define </strong>a <strong>threshold </strong>for my <strong>Usage Service</strong> to <strong>send </strong>an <strong>Alert </strong>to a <strong>Specific SNS Topic</strong> that will <strong>trigger </strong>a <strong>Lambda </strong>to — stop, pause, or whatever you want — <strong>specified services</strong>.</blockquote><h4>II - 5 Tips To implement :</h4><ol><li>Refer to your <strong>M-1</strong> (previous month…) billing to see what service you need to optimize cost.</li><li>Extract <strong>Usage Type Category</strong>, <strong>Usage Type</strong>, And <strong>Usage</strong> from the concerned service as shown on the billing image bellow (<strong>Bills of the M-1</strong>). <strong>“We will use it at the next story”</strong></li><li>Create a <strong>Budget </strong>and Define a Threshold-based on your <strong>Usage Type &amp; Usage Per Month</strong></li><li><strong>Send Budget Alert</strong> to an <strong>SNS Topic</strong> that triggers<strong> </strong>a <strong>Lambda </strong>to <strong>Stop/Pause </strong>your <strong>specific service </strong>if the spent budget reaches an <strong>X%</strong> of the <strong>defined threshold</strong></li><li>Assign the appropriate <strong>Policies &amp; Permission </strong>to <strong>Lambda &amp; SNS Topic</strong></li></ol><figure><img alt="AWS ACO Architecture — Bills" src="https://cdn-images-1.medium.com/max/1024/1*jCFp5trLKJMDPVPlD8cHFA.png" /><figcaption>Bills of the M-1</figcaption></figure><h3>Conclusion</h3><p>As you can see a basic implementation of auto-cost optimization isn’t complex. You can apply this architecture in your personal project to avoid spending a lot of money.</p><p>In the next Stroy, I will Implement this <strong>Abstract ACO Architecture </strong>with the AWS Service <strong>“ECS Fargate Container”, </strong>by making a <strong>Terraform File</strong> that you can simply adapt and use for your own needs.</p><p>For those who don&#39;t know yet how to <strong>automate </strong>an <strong>AWS Architecture</strong> with <strong>Terraform </strong>and <strong>DevOps </strong>you can refer to my previous story here:</p><p><a href="https://levelup.gitconnected.com/aws-s3m-pattern-terraform-devops-for-a-10-years-child-dac4610017ff">AWS S3M Pattern: Terraform &amp; DevOps for a 10 Years Child</a></p><p>Thank you for reading my stories 🙏</p><p><strong>If you Like it Share it 😜</strong> and If you have any remarks, or if something doesn’t seem clear, please leave a comment or contact me on my <a href="https://www.facebook.com/neogafa">Fb Page</a>, <a href="https://twitter.com/NaoufalGafa">Twitter</a>, or via <a href="https://www.elgafa.com/">my website</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67f026e3abcc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/aco-architecture-5-tips-to-auto-costoptimization-on-aws-67f026e3abcc">ACO Architecture: 5 Tips to Auto-CostOptimization on AWS</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS S3M Pattern: Terraform & DevOps for a 10 Years Child]]></title>
            <link>https://levelup.gitconnected.com/aws-s3m-pattern-terraform-devops-for-a-10-years-child-dac4610017ff?source=rss-42674a45a048------2</link>
            <guid isPermaLink="false">https://medium.com/p/dac4610017ff</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[software-engineer]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Naoufal EL GAFA]]></dc:creator>
            <pubDate>Mon, 22 Feb 2021 12:34:27 GMT</pubDate>
            <atom:updated>2022-08-03T23:56:40.426Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part-2: Terraform &amp; DevOps</h4><h3>“Tricks make you save time to Code &amp; Deploy your Terraform Config File Easily”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0ypnDIQokQeK98Emvc86Q.png" /></figure><p>As a Software Architect or a FullStack-Developer (someone with a developer background), I always had this fear of the syntax of Terraform configurations (HashiCorp Configuration Language: HCL).</p><p>Every time I read an example of a file with this syntax I couldn’t understand anything and I didn&#39;t know why.</p><p>However, I figured out why: “it was because my brain was formatted or programmed about how to design software, how to make an algorithm to solve a problem, etc … And nothing else”, so I tried to understand the Terraform config file with this mindset and I complicated my understanding of a simple configuration language (HCL),</p><p>So I wrote this story to share with you Tips &amp; Tricks for a better understanding and deploying Terraform by implementing S3M Pattern that I wrote before.</p><blockquote>To understand better the implemented example, please refer to my previous story</blockquote><p><a href="https://naoufal-gafa.medium.com/aws-when-serverless-and-microservice-get-married-securely-6585f7856a0f">AWS S3M Pattern: 5 Steps to marry Serverless &amp; Microservice Securely</a></p><p>So, Let’s go 😉</p><blockquote><em>Prerequisite:</em></blockquote><blockquote>→ AWS Account</blockquote><blockquote>→ <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html">AWS Programatically Acount</a> with Programmatic access and Admin Permission</blockquote><blockquote>→ <a href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html">AWS CLI configured in your laptop</a> (if you want to run your infra from you laptop (~/.aws/config )</blockquote><blockquote>→ A better understanding of S3M Pattern</blockquote><h3>Terraform: What? Why? How?</h3><h4>What Is Terraform?</h4><p>Is an IaC Software Tool 😲 →Infra as Code Software Tool 😳→ A software that allows us to code our InfraStructure 😜.</p><p>Coding infra may be done with two methods: Imperative (How) or Declarative (What) or both together.</p><p><strong><em>Imperative :</em></strong></p><ul><li>Focuses on How the infrastructure must be done</li><li>Defines specific commands that need to be executed in the appropriate order to end with the desired conclusion</li></ul><p><strong><em>Declarative </em></strong>:</p><ul><li>Focus on What the eventual target configuration should be</li><li>Defines the Desired State and the system executes what needs to happen to achieve that Desired State</li></ul><p>And Terraform is Declarative, so now you know why as a software architect, I complicated things, my mind was always focusing on How (always designing how), but if you need to understand easily Terraform you should switch your mind on What and everything will become too easy 😉</p><h4>Why should we use it?</h4><p>Terraform makes a great tool when it comes to DevOps &amp; Portability. There are the reasons to consider Terraform as one of your IaC tools :</p><ul><li>Portability: This is the big problem that Terraform Solves: it makes it easy to Duplicate Infra in different environments (DEV, PRE, PROD) at the same Cloud Provider. Also and because Terraform is completely platforms agnostic, it facilitates the coding resources of the new Cloud Provider if the company decides to change it Cloud Provider.</li><li>Terraform lets you define infrastructure in a config file and will enable you to track changes to infrastructure with ease by having your code in source control (Git), building it, and deploying it.</li><li>Terraform has a lively community and is open source, there is a massive community developing around this tool. Many people are already using it, and it’s easier to find people who know how to use it, plugins, extensions, professional support, etc. This also means Terraform is evolving at a much faster rate. They do releases very often.</li><li>Terraform’s speed and operations are exceptional. One cool thing about Terraform is, its plan command lets you see what changes you’re about to apply before you apply them.</li></ul><h4>How to Use it?</h4><ul><li><a href="https://www.terraform.io/downloads.html">Download the latest version and install it</a></li><li>Choose a folder and Create a file with .tf extension and write this simple example :</li></ul><pre># Declare wish provider you want to use<br>provider &quot;aws&quot; {<br>   region = &quot;us-east-2&quot;<br>}</pre><pre># Declare a VPC<br>resource &quot;aws_vpc&quot; &quot;s3m-vpc&quot; {<br>    cidr_block = &quot;10.0.0.0/16&quot;<br>    enable_dns_hostnames = true<br>     tags = {<br>    &quot;project&quot; = &quot;S3M&quot;<br>    &quot;tuto&quot;=&quot;medium&quot;<br>  }<br>}</pre><ul><li>In the same folder open a terminal and run these commands</li></ul><pre>terraform init</pre><blockquote>this command is to download all dependencies for your cloud provider (like npm install or dotnet restore for developers lol )</blockquote><pre>terraform plan </pre><blockquote>this command is for creating an execution plan. Terraform performs a refresh, unless explicitly disabled, and then determines what actions are necessary to achieve the desired state specified in the configuration files.</blockquote><blockquote>You can skip this command and apply directly your IaC, but is recommended to see what you have in your plan and fix errors or bugs before applying your infra</blockquote><pre>terraform apply</pre><blockquote>The terraform apply command is used to apply the changes required to reach the desired state of the configuration, or the pre-determined set of actions generated by a terraform plan execution plan.</blockquote><ul><li>You can now go to your account and verify if the VPC is created in the <strong>us-east-2 region</strong></li><li>And finally, to destroy what are you created, you can run this command :</li></ul><pre>terraform destroy</pre><h3>Tips to implement Terraform on Complex Architectures</h3><p>In this section, I’ll give you some <strong>tips &amp; tricks</strong> to save your time when coding the infra of a <strong>Complex Architecture</strong>.</p><p>As an example, we will take the <a href="https://naoufal-gafa.medium.com/aws-when-serverless-and-microservice-get-married-securely-6585f7856a0f"><strong>S3M Pattern</strong></a> that I wrote before. As a reminder this the architecture :</p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern" src="https://cdn-images-1.medium.com/max/1024/1*eRuttnmEGGww1pyAZhgXoQ.png" /><figcaption>S3M Pattern</figcaption></figure><p><a href="https://naoufal-gafa.medium.com/aws-when-serverless-and-microservice-get-married-securely-6585f7856a0f">AWS S3M Pattern: 5 Steps to marry Serverless &amp; Microservice Securely</a></p><h4><strong><em>Tip 1: To-Do</em></strong><em> Liste of </em><strong><em>What </em></strong><em>we want</em> 😜 :</h4><p>As you can see, for this <strong>pattern </strong>we need these <strong>blocks</strong>:</p><ol><li><strong>VPC </strong>with three <strong>subnets </strong>(two <strong>privates </strong>and one <strong>public</strong>)</li><li><strong>APIGateway</strong> with VPC <strong>Link</strong></li><li><strong>Authorizer </strong>(<strong>Lambda </strong>and <strong>API Gateway</strong>)</li><li><strong>ECS Cluster Fargat</strong> with <strong>TaskDefinition </strong>and <strong>Service</strong></li><li><strong>NLB </strong>(Network Load Balancer with a <strong>TargetGroup</strong>)</li><li><strong>S3 </strong>For Static Web Site Hosting</li></ol><h4><em>Tip 2: Create a </em><strong><em>*.tf</em></strong><em> file for each </em><strong><em>block</em>😄:</strong></h4><ol><li>vpc.tf</li><li>api-gateway.tf</li><li>authorizer.tf</li><li>cluster.tf</li><li>load-balancer.tf</li><li>s3.tf</li><li>To properly organize our code, we can make also a folder for different policies (JSON files)</li></ol><h4><em>Tip 3: The </em><strong><em>Magic </em></strong><em>of </em><strong><em>Copy-Past </em>😅</strong></h4><ol><li>O<a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs"><strong><em>pen the Terraform Documentation for AWS</em></strong></a></li><li>For each file: <strong>copy-past</strong> the configuration and adapt it like the image below:</li></ol><figure><img alt="Terraform With DevOps explained to a 10 Years Child — filter" src="https://cdn-images-1.medium.com/max/968/1*nNqrxbKK6VHXGezRifwYWg.png" /><figcaption>Filter on Terraform</figcaption></figure><p>So, for example, the <strong>vpc.tf </strong>file will look like this if we implement it with the <strong>S3M Pattern</strong>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e60496fdd87802e95c840d88152860c/href">https://medium.com/media/1e60496fdd87802e95c840d88152860c/href</a></iframe><blockquote>You can clone the complete example from <a href="https://github.com/ngaffa/S3M_IAC"><strong><em>here</em></strong></a><strong><em> ✌️</em> </strong>and follow the “<strong>How to Use it</strong>” explained before.</blockquote><blockquote>If you are asking: <strong>what about the </strong>fulfillment’s order ?<strong>!</strong> Should we start with VPC, ECS, APIGateway or…?</blockquote><blockquote>Answer : Is not your problem 😝, you don’t need to care about this😃, your job is to Describe, and Terraform Job is to Define the best way to execute your staff 😉</blockquote><h3>DevOps Philosophy</h3><h4>Definition</h4><p>What is really DevOps? <strong>DevOps is not a job title </strong>😠, in fact, it is a set of practices that combines software development (<em>Dev</em>) and IT operations (<em>Ops</em>).</p><p>DevOps initiatives can create cultural changes in companies by:</p><ul><li>Transforming the way operations, developers, and testers collaborate during the development and <strong>delivery processes</strong> 😃.</li><li>Getting these groups to work cohesively is a critical challenge in enterprise DevOps adoption 😃.</li><li>DevOps is as much about the culture, as it is about the toolchain.</li></ul><p><strong>So when some companies are looking for a DevOps engineer within their workflows, it means that they are not ready to change their philosophy and culture, and this may just deepen the disconnect between developers and operational teams </strong>😅<strong>.</strong></p><h4>Toolchains</h4><p>DevOps tools fit into one or more activities, which supports specific <strong>DevOps initiatives</strong>: Plan, Create, Verify, Package, Release, Configure, Monitor, and Version Control. For more info click <a href="https://en.wikipedia.org/wiki/DevOps_toolchain#Plan">here</a></p><blockquote>I’ll keep it simple in this story by focusing on these tools: <strong>Create (Code)</strong>, <strong>Package (Artifact)</strong>, <strong>Release (Deploy)</strong>, <strong>Configure (IaC), Version Control.</strong></blockquote><h3>Automatize all with GitHub Actions: (Get your Hands Dirty)</h3><p>Now that you know what are <strong>Terraform </strong>&amp; <strong>DevOps </strong>about, let&#39;s make some automatization to <strong>Package</strong>, <strong>Release </strong>and <strong>Configure </strong>the <strong>delivery process of the Backend, FrontEnd, and IaC (Config) </strong>with <strong>GitHub Actions</strong></p><p><strong>GitHub Actions</strong> makes it easy to automate all our software workflows with <strong>CI/CD</strong>. we will use it to <strong>Package</strong>, <strong>Release, </strong>and <strong>Configure</strong> our code right from <strong>GitHub</strong>.</p><blockquote><em>Prerequisites</em>:</blockquote><blockquote>→ GitHub Account: you will need a GitHub account to clone my repo examples in yours to automatize and build pipelines</blockquote><blockquote>→ Terraform Free Account: Explained in IAC Repository below</blockquote><p>For the automatization I make 3 Pipeline, one for each Repository:</p><ol><li><a href="https://github.com/ngaffa/S3M_IAC">IaC Repository</a></li><li><a href="https://github.com/ngaffa/S3M-BackEnd">API Repository</a></li><li><a href="https://github.com/ngaffa/S3M-FrontEnd">Static Web Site Repository</a></li></ol><p>As you can see, for each Repo I have a <strong>Yaml</strong> file that exists in <strong>/.github/workflows</strong>. This file will be interpreted by the <strong>Action Workflow of GitHub </strong>to run a pipeline that builds and deploys.</p><p>All Yaml files are well commented for a better understanding 😃</p><ol><li>For IaC: The pipeline will simply apply our infra</li><li>For API: The pipeline will <strong>containerize </strong>our package in a <strong>docker image</strong> and push it to <strong>Ecr Repo</strong></li><li>For Static web Site: The pipeline will <strong>build </strong>our <strong>Angular </strong>project and <strong>deploy </strong>it to <strong>S3 Static Web Hosting</strong></li></ol><h4>IaC Repository :</h4><p>To automatize the deployment of your Terraform IaC code, you have two choices :</p><ul><li>By just using Github Action: <a href="https://acloudguru.com/blog/engineering/how-to-use-github-actions-to-automate-terraform">https://acloudguru.com/blog/engineering/how-to-use-github-actions-to-automate-terraform</a></li><li>By using Terraform Cloud Api (the example below):<a href="https://learn.hashicorp.com/tutorials/terraform/github-actions">https://learn.hashicorp.com/tutorials/terraform/github-actions</a></li></ul><p>In our case, I choose to make it with Terraform Cloud to manage all terraform staff and workflow on the terraform cloud workspace, so it makes it easy for a team to manage and approve architectures and it is deeply integrated with Terraform’s workflows and data, which allows it to make Terraform significantly more convenient and powerful.</p><p>So firstly you should create a free account with Terraform and follow these steps.</p><p><strong><em>1- Create Your Organization</em></strong></p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Terraform Organization" src="https://cdn-images-1.medium.com/max/1024/1*IZOMx6S8Nyax_c1BC-k_DQ.png" /><figcaption>Terraform organization</figcaption></figure><p>Once the organization created, it’s time to create the workflow</p><p><strong><em>2- Create The Workflow</em></strong></p><p>To do so, click on API-driven workflow as shown in the image below and create your workflow</p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Terraform Worflow" src="https://cdn-images-1.medium.com/max/892/1*DLlg00_iE0nv-YHaOnurtw.png" /><figcaption>Terraform Workflow</figcaption></figure><p>Name your workspace and create it</p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Terraform Workspace" src="https://cdn-images-1.medium.com/max/889/1*v17EBC10ZMfJjmp3_uQSQA.png" /><figcaption>Terraform workspace</figcaption></figure><p>Once the workspace is created, terraform will generate for you this code to use in your main config file (<strong>main.tf)</strong> that exists in your repository.</p><p>So, copy-paste this code (a full example can be found<a href="https://github.com/ngaffa/S3M_IAC"> in my repo</a>)</p><pre>terraform {<br>  backend &quot;remote&quot; {<br>    organization = &quot;your organization name&quot;</pre><pre>workspaces {<br>      name = &quot;your workspace name&quot;<br>    }<br>  }<br>}</pre><p><strong><em>3- Generate a Terraform Cloud User API token:</em></strong></p><ul><li>Go to: <a href="https://app.terraform.io/app/settings/tokens">https://app.terraform.io/app/settings/tokens</a> and click on <strong>“Create an API token”</strong></li></ul><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Terraform User Token API" src="https://cdn-images-1.medium.com/max/1024/1*wZHZSH8BDFZ9xXMsypFChQ.png" /><figcaption>Terraform User API Token</figcaption></figure><ul><li>Give it a description to help you identify this token later and click on <strong>“Create API token”</strong></li></ul><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Terraform Token" src="https://cdn-images-1.medium.com/max/571/1*uKrOKCfSIU8HFAKlR5WH9g.png" /></figure><ul><li>Copy the generated token</li></ul><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Terraform Token" src="https://cdn-images-1.medium.com/max/556/1*uIgG071gxjqWPUs20XXP3w.png" /><figcaption>Terraform Generated Token</figcaption></figure><p><strong><em>4- Store the generated token as a GitHub secret on the IaC Repository:</em></strong></p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Github secrets" src="https://cdn-images-1.medium.com/max/1024/1*w88mmV0mdWCaBdFqH22b3w.png" /><figcaption>Repo Secret</figcaption></figure><p>You can follow the <a href="https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository">GitHub Docs here</a>.</p><p><strong><em>5- Store the AWS Keys on Terraform Cloud Environment Variables :</em></strong></p><p>We need to save our <strong>AWS Access Key</strong> and<strong> Secret Key</strong> on T<strong>erraform Environment Variable</strong>, so when the Github pipeline run, it will use these credentials to <strong>Plan </strong>and <strong>Apply our </strong>infra to the <strong>AWS Account</strong>.</p><p>To do so go to <a href="https://learn.hashicorp.com/tutorials/terraform/cloud-workspace-configure">https://learn.hashicorp.com/tutorials/terraform/cloud-workspace-configure</a> and follow the steps bellow</p><ul><li>Add Environment Variables</li></ul><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Terraform Environment Variables" src="https://cdn-images-1.medium.com/max/783/1*j9veCwKXqQZDlGfP1HdQTg.png" /><figcaption>Create Terraform Environment Variables</figcaption></figure><ul><li>Create these two environment variables and make them <strong>sensitive</strong>:</li></ul><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Terraform Environment Variables" src="https://cdn-images-1.medium.com/max/748/1*BtoRfvx7AU-4hv2H5un5Rg.png" /><figcaption>Terraform Secrets</figcaption></figure><p>For more info about managing secrets on Terraform, you can follow this <a href="https://blog.gruntwork.io/a-comprehensive-guide-to-managing-secrets-in-your-terraform-code-1d586955ace1">Blog</a></p><p><strong><em>6- Run your pipeline on GitHub</em></strong></p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — GitHub Pipeline" src="https://cdn-images-1.medium.com/max/1024/1*Zul6f4vfq2plY6Szm9uvWQ.png" /><figcaption>GitHub Pipeline</figcaption></figure><h4>API Repository :</h4><p>After the deployment of our Infrastructure, now it’s time to deploy our API, otherwise, the pipeline will simply push a docker image into ECR (that’s all 😄)</p><p>Don’t forget to add the <strong>AWS_ACCESS_KEY_ID </strong>and <strong>AWS_SECRET_ACCESS_KEY </strong>in the secret of your <strong>API Repository</strong>, and run the pipeline via the <strong>GitHub Action Tab</strong></p><p>The full example can be found <a href="https://github.com/ngaffa/S3M-BackEnd"><strong>here</strong></a></p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Github Secrets" src="https://cdn-images-1.medium.com/max/1024/1*O_-uFuJ2UxnjkCo2pjxAMQ.png" /><figcaption>API Secrets</figcaption></figure><h4>Static Web Site Repository :</h4><p>Because we did not attach a custom domain name to our <strong>API Gateway</strong> we should copy the <strong>EndPoint </strong>generated by our IaC Deployment and past it to the environment variable of the <strong>Static Web Site</strong></p><blockquote>Another option more complicated is to store the environment variable in a Configuration Manager like (AWS secrets manager) or use a Cloud Agnostic Tools like <a href="https://github.com/mozilla/sops">SOPS</a></blockquote><p>1- Go to your <strong>APIGateway Dashboard</strong>, click on the created <strong>API</strong>, go to <strong>Stages </strong>and <strong>copy </strong>the endpoint</p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Api Gateway EndPoint" src="https://cdn-images-1.medium.com/max/1024/1*pMtY6dZ_vMzyxckd2ll5gw.png" /><figcaption>API Gateway EndPoint</figcaption></figure><p>2- Go to your <strong>Static WebSite Repository</strong>, update the environment file and make a commit</p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — S3 Front" src="https://cdn-images-1.medium.com/max/1024/1*gnUCJyi4X_pCOyzvRxFAcg.png" /><figcaption>Static Web Site Environment</figcaption></figure><p>3- Run your Pipeline (Don’t forget to add the <strong>AWS_ACCESS_KEY_ID </strong>and <strong>AWS_SECRET_ACCESS_KEY </strong>in the secret of your API Repository, and run the pipeline via the <strong>GitHub Action Tab)</strong></p><p>4- Check if everything works by going to your <strong>s3 static web site Endpoint</strong>, copying the link, pasting it to your browser, and clicking on the <strong>“Get weather”</strong> button</p><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — S3 Link" src="https://cdn-images-1.medium.com/max/966/1*6FDVWNwXZ46PA6G9Ee7GJw.png" /><figcaption>S3 link</figcaption></figure><figure><img alt="Terraform With DevOps explained to a 10 Years Child — S3M Pattern — Front check" src="https://cdn-images-1.medium.com/max/887/1*jGJcf-74jCf4XeH9JANDWQ.png" /><figcaption>Final Check</figcaption></figure><p>Greaaaaaaaaaat, everything automatized and worked like magic 😄</p><h3>Conclusion</h3><p>In real life, <strong>coding </strong>and <strong>managing </strong>the source code of the <strong>Infra </strong>is such a great thing because it allows the <strong>Company Architect </strong>to follow all <strong>changeset </strong>and apply only the changes without destroying all the infra architecture.</p><p>In real life, <strong>coding </strong>and <strong>managing </strong>the <strong>Infra </strong>source code is such a great thing as it allows the <strong>company architect </strong>to keep up with all the changes and apply only the <strong>necessary updates </strong>without destroying the entire system.</p><p>The <strong>IaC philosophy </strong>also facilitates the <strong>portability </strong>of the<strong> Infrastructures:</strong></p><ul><li>Between <strong>different clouds provider</strong></li><li>Between different <strong>environment </strong>of the <strong>same </strong>cloud provider</li></ul><p>When we tied IaC with <strong>real DevOps philosophy</strong>, we save much more the time of process <strong>delivery </strong>while <strong>keeping </strong>a better <strong>quality </strong>of <strong>code.</strong></p><p>If you are new to these technologies<strong> (AWS, IaC, DevOps)</strong>, this blog will help you understand the sequence of the different bricks <strong>(AWS, IaC, DevOps)</strong> and will prevent you from following many tutorials and going in all directions.</p><p>I wish to thank by the way Soufian Belehrache for his technical advice.</p><p>If you have any remarks, or if something doesn’t seem clear, please leave a comment or contact me on my <a href="https://www.facebook.com/neogafa">Fb Page</a>, <a href="https://twitter.com/NaoufalGafa">Twitter</a>, or via <a href="https://www.elgafa.com/">my website</a></p><p>Finally, I have a challenge for you:</p><ul><li>Create a GitHub account if you don&#39;t already have one</li><li>Create a Terraform Free Account</li><li>Apply what are you learned in this Story <strong><em>“Section Automatize all with GitHub Actions: (Get your Hands Dirty)”</em></strong></li><li>Good luck</li></ul><p>See you at the next Story ✌️.</p><h3>References</h3><ul><li><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs">Terraform Docs for AWS Provider</a></li><li><a href="https://en.wikipedia.org/wiki/Terraform_(software)">Terraform Definition</a></li><li><a href="https://blog.gruntwork.io/an-introduction-to-terraform-f17df9c6d180">Introduction on Terraform</a></li><li><a href="https://www.chakray.com/creating-fargate-ecs-task-aws-using-terraform/">Creating a Fargate ECS Task</a></li><li><a href="https://github.com/alex/ecs-terraform/blob/master/services.tf">ECS with Terraform</a></li><li><a href="https://gist.github.com/mendhak/8303d60cbfe8c9bf1905def3ccdb2176">Authorizer with Terraform</a></li><li><a href="https://en.wikipedia.org/wiki/DevOps#:~:text=DevOps%20is%20a%20set%20of,delivery%20with%20high%20software%20quality.">DevOps</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dac4610017ff" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/aws-s3m-pattern-terraform-devops-for-a-10-years-child-dac4610017ff">AWS S3M Pattern: Terraform &amp; DevOps for a 10 Years Child</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS S3M Pattern: 5 Steps to marry Serverless & Microservice Securely]]></title>
            <link>https://naoufal-gafa.medium.com/aws-when-serverless-and-microservice-get-married-securely-6585f7856a0f?source=rss-42674a45a048------2</link>
            <guid isPermaLink="false">https://medium.com/p/6585f7856a0f</guid>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[net-core]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Naoufal EL GAFA]]></dc:creator>
            <pubDate>Wed, 30 Dec 2020 16:46:28 GMT</pubDate>
            <atom:updated>2021-04-05T19:03:26.703Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Part-1: AWS Console</h4><h3>“Save your time with this Abstract Pattern to make complex Cloud Architectures”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DvE_9qEBO0VqbicppVezQ.png" /></figure><p>Making <strong>serverless </strong>architectures tied to <strong>microservices</strong> architectures on the AWS cloud is a fun job and it allows us to learn new things every day</p><p>But mostly, we need <strong>Abstract Patterns</strong> that already exist to <strong>implement </strong>them and <strong>adapt </strong>them according to our use case to avoid <strong>spending a lot of time</strong> designing something that <strong>already exists</strong>.</p><p>My <strong>goal </strong>in this Story is to introduce you to one of my favorite <strong>Patterns</strong> that <strong>securely marry serverless </strong>and <strong>micro-services </strong>architecture 😎.</p><p>This <strong>Pattern </strong>will help you to save lots of time when <strong>designing </strong>and <strong>thinking </strong>about a <strong>project </strong>that requires <strong>authentication </strong>to access one or more <strong>microservices</strong> deployed in a <strong>private network</strong>.</p><p>It is <strong>Strong</strong>, <strong>Secure</strong>, <strong>Serverless, </strong>and <strong>Micro, </strong>So I named it <strong>S3M, </strong>and I’m going to make it<strong> </strong>as <strong>Abstract</strong> as possible, and implement it with a concrete example of my favorite trending technologies, so you’ll have the <strong>choice </strong>to <strong>implement </strong>it your <strong>way </strong>💪.</p><h3>Use case :</h3><p>Assuming that we are invited to develop an application that consists of a <strong>Front-end</strong> that communicates with <strong>many microservices backends</strong> that are deployed on containers managed by ECS/Fargate (or EKS) and protected in a <strong>private network</strong>.</p><p>All these microservices will use the same logic of authentication/authorization. For example: <strong>blocking all non-authenticated calls</strong>, <strong>verifying the JWT token</strong>, and r<strong>equesting roles from a DynamoDB table</strong> to manage permission.</p><p>A custom <strong>Authorizer </strong>as a <strong>solution </strong>is the best choice to <strong>centralize </strong>all auth logic rather than developing each logical authentication/authorization for each micro-service, but how? 👌</p><blockquote>for more info : <a href="https://www.alexdebrie.com/posts/lambda-custom-authorizers/">The Complete Guide to Custom Authorizers</a></blockquote><p>To access these micro-services, we need to implement the <strong>API Gateway private integration</strong>: all requests will be verified by the authorizer of the <strong>API Gateway</strong> and passed through an <strong>NLB </strong>in a private network by a <strong>VPC Links </strong>that routes <strong>incoming requests (API calls) </strong>to the <strong>targeted resource (Containers)</strong>.</p><blockquote>for more info : <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-private-integration.html">API Gateway Private Integration</a></blockquote><p>Take a look at the <strong>architecture below</strong>.</p><p>You can find <strong>Part - 2 here :</strong></p><p><a href="https://levelup.gitconnected.com/aws-s3m-pattern-terraform-devops-for-a-10-years-child-dac4610017ff">AWS S3M Pattern: Terraform &amp; DevOps for a 10 Years Child</a></p><h3>Project Architecture</h3><p>To understand <strong>S3M Abstract Pattern</strong> with a concrete example we’ll follow this architecture :</p><figure><img alt="Global Architecture for S3M Pattern" src="https://cdn-images-1.medium.com/max/1024/1*eRuttnmEGGww1pyAZhgXoQ.png" /><figcaption>S3M: Architecture</figcaption></figure><p>Resumen: We have a front that communicates with a backend having as entry point an API Gateway that includes Authorizer In Front of private NLB that routes incoming requests to the targeted resource (Containers)</p><p>So, As you can see, the <strong>S3M Pattern</strong> consists of a(n):</p><ul><li><strong>Authentication Provider </strong>to generate a <strong>JWT Token</strong> (in this Story I’ll make it simple 😊, so I’ll generate one <a href="https://www.jsonwebtoken.io/">here</a>)</li><li><strong>Front-end framework</strong> (<strong>Angular </strong>in my case)</li><li><strong>Backend-end API </strong>(<strong>.Net Core </strong>in my case)</li><li><strong>Private </strong>and<strong> Public Subnets</strong></li><li><strong>Container Manager and Containers </strong>for backend deployment (<strong>ECS/Fargate</strong> in my case)</li><li><strong>Registry </strong>for docker image (<strong>ECR </strong>in my case)</li><li><strong>NLB </strong>(Network Load Balancer)</li><li><strong>VPC Links</strong></li><li><strong>API Gateway</strong></li><li><strong>Lambda Authorizer</strong> (NodeJs in my case)</li></ul><p>Take a deep breath and analyze the architecture to fully understand it, and if all seems good, <strong>it’s time to get our hands dirty😊</strong></p><blockquote>Prerequisite:</blockquote><blockquote>→ AWS Account</blockquote><blockquote>→ <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html">AWS Programatically Acount</a> with <strong>Programmatic access and Admin Permission</strong></blockquote><blockquote>→ Basic knowledge of the backend and frontend technos besides an initiation in the AWS cloud will be better to completely understand 😀</blockquote><p>In this Story, I will show you the implementation by using AWS Console. To <strong>Automate The setting Up </strong>of this <strong>Architecture</strong>, I made a new <strong>Story </strong>that you can find it here</p><p><a href="https://levelup.gitconnected.com/aws-s3m-pattern-terraform-devops-for-a-10-years-child-dac4610017ff">AWS S3M Pattern: Terraform &amp; DevOps for a 10 Years Child</a></p><h3><strong>Steps for Technical Implementation</strong></h3><h4><strong>Step 1: let create our Angular Front-End :</strong></h4><blockquote>Prerequisite:</blockquote><blockquote>→ Install Angular Globally in your machine, open a terminal and type</blockquote><pre>npm install -g @angular/cli</pre><ul><li><strong>Clone the angular project example from my </strong><a href="https://github.com/ngaffa/S3M-FrontEnd"><strong>GitHub Repo</strong></a><strong> or you can follow the steps bellow</strong></li><li>Generate your JWT token <a href="https://www.jsonwebtoken.io/">here </a>and replace it at the app.component.ts</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de2466053e98220788d8813ac76e70d0/href">https://medium.com/media/de2466053e98220788d8813ac76e70d0/href</a></iframe><h4><strong>Step 2: let create our backend with .net core :</strong></h4><blockquote>Prerequisite:</blockquote><blockquote>→ Install <a href="https://visualstudio.microsoft.com/fr/vs/">Visual Studio 2019</a> or <a href="https://code.visualstudio.com/docs/languages/dotnet">VSCode with .netcore</a></blockquote><ul><li><strong>Clone the .net core project from my </strong><a href="https://github.com/ngaffa/S3M-BackEnd"><strong>GitHub Repo</strong></a></li><li><em>You will find this example controller (</em><strong><em>WeatherForecastController </em></strong><em>with </em><strong><em>GET </em></strong><em>method): it sufficient for our test</em></li></ul><figure><img alt="S3A Backen Step" src="https://cdn-images-1.medium.com/max/303/1*89s4t3eo9X2GfRl4n-libA.png" /><figcaption>Controller example</figcaption></figure><ul><li>I already enabled cors, then we can access the backend from any origin globally</li></ul><pre>app.UseCors(&quot;AllowOrigin&quot;);</pre><pre>services.AddCors(c =&gt;<br>  {<br>  c.AddPolicy(&quot;AllowOrigin&quot;, <br>    options =&gt; AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod());<br>  });</pre><h4><strong>Step 3: let make a local test :</strong></h4><ul><li>Start your Backend by clicking at the play button of your Visual Studio and <strong>copy-paste</strong> the <strong>localhost port</strong> of your backend in the dev environment variable <strong>(environement.ts)</strong> of your <strong>Angular front </strong>(in my case the backend port is <strong>49159</strong>)</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f009efe68090cab6f55dea2e49e1994/href">https://medium.com/media/7f009efe68090cab6f55dea2e49e1994/href</a></iframe><ul><li>Start your angular project → in the route folder of your cloned front-end, open a terminal, and type:</li></ul><pre>npm i // to install all dependency</pre><pre>ng serve</pre><ul><li>The interest of this test is to see if the back and the front communicate without any problem locally as well as to be sure that the JWT Token has been passed in the header of the request</li></ul><figure><img alt="Local Test of Testing Decoupled Web Application" src="https://cdn-images-1.medium.com/max/1024/1*Q0LQrd5UZ-8y3nzq1pHwiA.gif" /><figcaption>Local Test of Testing Decoupled Web Application</figcaption></figure><h4><strong>Step 4: let prepare our AWS infrastructure:</strong></h4><ol><li><strong><em>Create a container in ECR (Elastic Container Repository):</em></strong></li></ol><p>Amazon Elastic Container Registry (ECR) is a fully managed container registry that makes it easy to store, manage, share, and deploy your container images and artifacts anywhere.</p><ul><li>Open the <a href="https://console.aws.amazon.com/ecr/repositories">ECR Dashboard</a></li><li>Click on <strong>“Create Repository”</strong></li><li>Name your repo and click <strong>“Create Repository”</strong>, that’s it! 😜</li></ul><figure><img alt="Create a Repository into Elastic Container Registry for docker images" src="https://cdn-images-1.medium.com/max/951/1*hLH7Q4howh8SlOCgMnBCFw.png" /><figcaption>Elastic Container Registry</figcaption></figure><p><strong><em>2. Create an ECS Cluster (Elastic Container Service):</em></strong></p><p>Amazon ECS makes it easy to deploy, manage, and scale Docker containers running applications, services, and batch processes. Amazon ECS places containers across your cluster based on your resource needs and is integrated with familiar features like Elastic Load Balancing, EC2 security groups, EBS volumes, and IAM roles.</p><ul><li>After creating the repo you will stay on the same page in which you can create also a cluster or you can go <a href="https://console.aws.amazon.com/ecs/home">here</a></li><li>Click on the <strong>Clusters </strong>at the left menu and click on “<strong>Create Cluster</strong>”</li><li>Select the template <strong>Networking Only </strong>and click <strong>“next step”</strong></li></ul><figure><img alt="ECS Cluster Template" src="https://cdn-images-1.medium.com/max/1024/1*oy2xX-yjvASmQE30VwyZKA.png" /><figcaption>ECS Cluster</figcaption></figure><ul><li>Name your container and check the “<strong>Create VPC</strong>” option, choose <strong>3 subnets </strong>and click<strong> “Create” and </strong>wait</li></ul><figure><img alt="Create an Elastic Container Cluster with Network Template" src="https://cdn-images-1.medium.com/max/1024/1*fCsFXMBs4yfDHHAuB2voGA.png" /><figcaption>Cluster Networking Template</figcaption></figure><ul><li>By default, the created subnets are <strong>public </strong>so, in the next step, we will make <strong>two </strong>of them <strong>privates </strong>and create a<strong> NatGateway </strong>in the <strong>public </strong>one <strong>to allow </strong>private resources<strong> </strong>like <strong>ECS Tasks </strong>to pull<strong> docker images </strong>from the registry<strong>.</strong></li></ul><p><strong><em>3. Configure VPC :</em></strong></p><p>A VPC is an isolated portion of the AWS cloud populated by AWS objects, in the step before we create one with <strong>3</strong> <strong>public Subnet</strong></p><p>let make 2 of them private and leave one Public (<strong>for example the 10.0.2.0/24 will stay public</strong>)</p><ul><li>Go to <a href="https://console.aws.amazon.com/vpc/home#NatGateways:"><strong>VPC Dashboard </strong></a>and create a new <strong>NatGateway</strong> and as a subnet choose the one that you’ll let it public <strong>(I choose 10.0.2.0/24 )</strong></li><li>⚠️ to know the IP of the subnet go to <a href="https://console.aws.amazon.com/vpc/home#subnets:">the subnets table</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*ncYTiyHLqA4bApgi3poROA.png" /></figure><ul><li>Go now to the<a href="https://console.aws.amazon.com/vpc/home#RouteTables"> <strong>“Route Table”</strong></a>, you will notice 2 new ones are created, one private and one public, and the public one has the <strong>three created subnet</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CjX9xYYzAh8WKVSnJvlgvg.png" /><figcaption>Route Table</figcaption></figure><ul><li>Select the private <strong>route table → </strong>in the route tab click on <strong>“edit route”</strong> and add a route to the Nat Gateway created</li></ul><pre>0.0.0.0/0 =&gt; NatGateway</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VCBuaDqJoHAlmteCxcXX4w.gif" /><figcaption>Add Route 0.0.0.0/0 targeting NAT Gateway</figcaption></figure><ul><li>Now associate the remaining subnets (<strong>2 Subnets</strong>) to this <strong>route table (private) </strong>and change their names (replace /<strong>public </strong>by /<strong>private</strong>) → In the <strong>“Subnet Associations”</strong> tab click on <strong>“Edit Subnet Association”</strong> and select the subnets to associate <strong>(10.0.0.0/24 </strong>and <strong>10.0.1.0/24)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PkBPSxCa-UeyemBGfarxdw.gif" /><figcaption>Route Table Subnets Association</figcaption></figure><blockquote><strong>Done for the container and the subnets, we will back again to create services and tasks … don’t worry !! like a said these steps is for preparing infrastructures 😊</strong></blockquote><p><strong><em>4. Create an NLB :</em></strong></p><p>Elastic Load Balancing automatically distributes your incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses, in one or more Availability Zones.</p><p>Network Load Balancer functions at the fourth layer of the Open Systems Interconnection (OSI) model. It can handle millions of requests per second. After the load balancer receives a connection request, it selects a target from the target group for the default rule. It attempts to open a TCP connection to the selected target on the port specified in the listener configuration.</p><ul><li>Go to <a href="https://console.aws.amazon.com/ec2/v2/home?#LoadBalancers:sort=loadBalancerName">EC2 </a>console in the left menu scroll down, click on <strong>“Load Balancers” </strong>then on<strong> “Create Load Balancer” </strong>then choose<strong> “Network Load Balancer”</strong> and click <strong>“Create”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JReEPcmz5E9ZApboQTT8sQ.jpeg" /><figcaption>Load Balancers Types</figcaption></figure><ul><li>Name your <strong>NLB</strong>, The scheme<strong> </strong>must be <strong>“internal” </strong>and for<strong> </strong>VPC you should select the <strong>“created one (Step 4.3) ”</strong> and check all its <strong>private subnets</strong></li></ul><figure><img alt="Create a Network Load Balancer" src="https://cdn-images-1.medium.com/max/1024/1*FnfxN4rdEebu6yAqgZMbow.png" /><figcaption>NLB</figcaption></figure><ul><li>Click <strong>“Next: Configure Security Settings” </strong>then <strong>“Next: Configure Routing”</strong></li><li>For <strong>Target Type</strong> choose <strong>IP</strong> → for Protocol choose <strong>“TCP” → </strong>then <strong>“Next: Register targets” </strong>then <strong>“Next: Review” </strong>and <strong>“Create”</strong></li><li>Copy the DNS Name of the created <strong>NLB</strong>, we&#39;ll need it for the <strong>VPC Links</strong></li></ul><figure><img alt="Get the DNS of Network Load Balancer" src="https://cdn-images-1.medium.com/max/1024/1*x5qJSx-06izQYIwdfcXnhA.png" /><figcaption>NLB DNS</figcaption></figure><blockquote>Don’t worry, we will register our target after creating our cluster’s <strong>service 😜</strong></blockquote><p><strong><em>5. Create the VPC Link :</em></strong></p><p>VPC link is encapsulated by an API Gateway resource of <a href="https://docs.aws.amazon.com/apigateway/api-reference/resource/vpc-link/">VpcLink</a>. It is responsible for forwarding API method requests to the VPC resources and returns backend responses to the caller. For an API developer, a VPCLink is functionally equivalent to an integration endpoint.</p><ul><li>Go to the <a href="https://console.aws.amazon.com/apigateway/main/apis">API Gateway dashboard</a>, in the left menu click <strong>“VPC Links”</strong>, then click <strong>“Create” </strong>and choose <strong>“VPC Link for REST APIs”</strong></li><li>Name it, and for <strong>“Target NLB”</strong>, you know what to do 😝 (select the NLB created in the step before<strong>(Step 4.4)</strong> and click <strong>“Create”</strong></li></ul><figure><img alt="Create a VPC Link" src="https://cdn-images-1.medium.com/max/1003/1*Asfm_AMwA220Lppjo9osLQ.png" /><figcaption>VPC Link</figcaption></figure><ul><li>⚠️ The <strong>VPC Link </strong>takes a few minutes for creation, so is <strong>recommended </strong>to wait for its creation before going to the next step.</li></ul><p><strong><em>6. Create the ApiGateway and connect it to the NLB:</em></strong></p><p>API Gateway API with private integration provides our customers access to HTTP/HTTPS resources within your Amazon Virtual Private Cloud (Amazon VPC). Such VPC resources are HTTP/HTTPS endpoints on an EC2 instance behind a Network Load Balancer in the VPC. The Network Load Balancer encapsulates the VPC resource and routes incoming requests to the targeted resource.</p><ul><li>Go to the <a href="https://console.aws.amazon.com/apigateway/main/apis">API gateway Dashboard</a> and click <strong>“Create API”</strong>, choose the <strong>“REST API”</strong> Template and click <strong>“Build”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHfzQpqOxfltv7PF7hXyug.png" /></figure><ul><li>Select <strong>“New API” </strong>then name it and click <strong>“Create API”</strong></li><li>Click <strong>“Action/Create Resource</strong> then configure as explained in the image below and click <strong>“Create Resources”</strong></li></ul><figure><img alt="Create API Gateway Resource as proxy" src="https://cdn-images-1.medium.com/max/1024/1*kDk2rFbD-iIyBZegVcJBEA.png" /><figcaption>API Gateway Resource</figcaption></figure><ul><li>By default the method <strong>“Any”</strong> is created in this <strong>resource </strong>and we should just configure it by selecting the <strong>“VPC link” </strong>and <strong>copy-paste</strong> the generated <strong>“DNS of the NLB”</strong> that we have created before <strong>(Step 4.4)</strong> concatenated by <strong>“/{proxy}” </strong>at the end<strong> </strong>in the endpoint URL as explained in the image below, then click <strong>“save”.</strong></li><li>For example, if your DNS is: s3m-nlb-private-b144930068ace954.elb.us-east-1.amazonaws.com in the <strong>endpoint URL</strong> should be: <a href="http://s3m-nlb-private-b144930068ace954.elb.us-east-1.amazonaws.com/%7Bproxy%7D">http://s3m-nlb-private-b144930068ace954.elb.us-east-1.amazonaws.com/{proxy}</a></li></ul><figure><img alt="Api Gateway Proxy mode with NLB and VPC Link" src="https://cdn-images-1.medium.com/max/1024/1*gFVDESfCA6qs8skSUTMoTw.png" /><figcaption>Setup Proxy for ApiGateway</figcaption></figure><p>So, as you can see, we created our <strong>Container Manager (ECS Cluster)</strong>, our <strong>container registry (ECR)</strong>, and also our <strong>NLB</strong> connected with <strong>API Gateway</strong> via the <strong>VPC Link.</strong></p><blockquote>Almost done, you can take a 15 min break ✌️. The next step will be to connect the <strong>Lambda Authorize</strong> with the <strong>API Gateway</strong>.</blockquote><p><strong><em>7. Create the Lambda Authoriser:</em></strong></p><p>A <em>Lambda authorizer</em> (formerly known as a <em>custom authorizer</em>) is an API Gateway feature that uses a Lambda function to control access to your API.</p><p>A Lambda authorizer is useful if you want to implement a custom authorization scheme that uses a bearer token authentication strategy such as OAuth or SAML, or that uses request parameters to determine the caller’s identity.</p><ul><li>Go to <a href="https://console.aws.amazon.com/lambda/home?">Lambda dashboard</a> and click on <strong>“Create Function”</strong>, Select <strong>“Author From Scratch”</strong>, name it, leave the runtime at <strong>node.js 12.x</strong>, then click <strong>“Create Function”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6PoVs2cyALQn7cI89vDD3A.png" /><figcaption>Create a Lambda Function</figcaption></figure><ul><li>You can download the lambda zip from my <a href="https://github.com/ngaffa/S3M-Authorizer/blob/main/s3m-lambda%20authorizer.zip"><strong>Github Repo</strong></a></li><li>Scroll down to Function code, on the right side click on <strong>“Actions”</strong> and upload <strong>“Upload a .zip file”, </strong>then upload the<strong> downloaded zip </strong>and click <strong>“save” </strong>(I made this zip for you to avoid creating <strong>“layers”</strong> etc …)</li></ul><figure><img alt="Upload a zip to an  AWS Lambda" src="https://cdn-images-1.medium.com/max/1024/1*MsdynvV_h0cG9w0J1F9ZRA.gif" /><figcaption>Upload Lambda as a ZIp</figcaption></figure><blockquote>This gist is inspired by <a href="https://github.com/awslabs/aws-apigateway-lambda-authorizer-blueprints">AWS Labs</a></blockquote><p><strong>8. Attach the Authoriser to the API Gateway:</strong></p><ul><li>Go to <a href="https://console.aws.amazon.com/apigateway/main/apis?">ApiGateway Dashboard</a> (always verify your region) and select the API that you created before <strong>(Step 4.5)</strong>, in the left menu scroll down to the Authorizers and click on <strong>“Create new Authorizer”</strong> → name it → at the <strong>Lambda Function</strong> select the one we have created before <strong>(Step 4.7)</strong>, for <strong>“Lambda Event” </strong>check <strong>“Token”</strong> and copy-paste <strong>“Authorization” </strong>in <strong>Token Source</strong>, then click on <strong>“Create”</strong> and <strong>“Grant &amp; Create”</strong></li></ul><figure><img alt="Attach Lambda Authorizer to Api Gateway Authorizer, #Authorizer" src="https://cdn-images-1.medium.com/max/1024/1*xU9QYMYYVqCHEnNFTYbiGw.png" /></figure><ul><li>Now attach the <strong>Authorizer</strong> to the <strong>resources </strong>→ Select <strong>“Resources”</strong> in the left menu → select <strong>“Any”</strong> method and click on <strong>“Method Request” </strong>→ then attach the <strong>created Authorizer </strong>(if the authorizer doesn&#39;t appear refresh the page)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VVG1ghufIoQ3DiUCJ_ZWLg.png" /></figure><ul><li>Now let deploy our <strong>API Gateway </strong>(choose a new stage and create one) and copy-paste the <strong>API Endpoint</strong> into the Angular project<strong> Prod environment variable </strong>(environment.prod.ts) <strong>that </strong>you have cloned before<strong> (Step 3.1)</strong>. !!! (make sure to have <strong>“/” </strong>at the end of the endpoint)</li></ul><figure><img alt="Deploy th Api Gateway and Copy-paste the endpoint into the Front" src="https://cdn-images-1.medium.com/max/1024/1*2KgGYnD_8RqwYPqlxTn5fg.gif" /><figcaption>Deploy the API Gateway and Copy-paste the endpoint into the Front</figcaption></figure><blockquote>→ Next Step we’ll prepare S3 Bucket for hosting our front</blockquote><p><strong>9. <em>Create S3 Bucket for Static Web Site Hosting:</em></strong></p><p>You can use Amazon S3 to host a static website. On a <em>static</em> website, individual webpages include static content. They might also contain client-side scripts.</p><ul><li>Go to <a href="https://s3.console.aws.amazon.com/s3/bucket/create">S3 Dashboard </a>and click on <strong>“Create bucket”</strong>, name it, uncheck <strong>“Block all public access”</strong> then check <strong>“I Acknowledge….”</strong>, then click <strong>“Create Bucket”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eaf3XC5gyJzwm76WkB4d6Q.jpeg" /></figure><ul><li>Now enable <strong>“Static Web Site Hosting”</strong>, to do so → select the <strong>created Bucket →</strong> to go to <strong>“Properties” → </strong>Scroll down to the bottom, at <strong>Static website hosting </strong>click on <strong>“Edit” →</strong> then enable it as shown in the image below → then click <strong>“Save changes”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MUKlmXh-1WSCm_Xjh5muyg.png" /></figure><blockquote><strong>Our Infrastructure is Ready now, let deploy our front, back, create task and services and bring all pieces together 💪</strong></blockquote><h4>Step 5: Bring All Pieces together (Deployment):</h4><ol><li><strong><em>Let host our Angular Front-end :</em></strong></li></ol><ul><li>In the route directory of the Angular Project, open a terminal and type</li></ul><pre>ng build --prod</pre><ul><li>It will generate a new folder called <strong>“dist”</strong></li><li>Open the <a href="https://s3.console.aws.amazon.com/s3/home">S3 Dashboard</a> → select the bucket that we created before <strong>(Step 4.9)</strong> and click on <strong>“Upload” → </strong>then go to the generated <strong>“dist” </strong>folder and <strong>drag and drop </strong>all its contents to this <strong>Bucket.</strong></li><li>All the contents should be reachable by everyone, take a look at the GIF below</li><li>Check the <strong>link </strong>of your <strong>hosted application </strong>(properties of the bucket scroll down to Static Web Hosting)</li></ul><figure><img alt="Host Angular Front in S3 Bucket for hosting static website" src="https://cdn-images-1.medium.com/max/1024/1*AQtPLxG8F056HWekTS15Ow.gif" /><figcaption>Deploy Angular Front to S3</figcaption></figure><p><strong>2. L<em>et deploy our backend as a docker image :</em></strong></p><blockquote>Prerequisite:</blockquote><blockquote>→ Install the <a href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html">latest version of the <strong>AWS CLI</strong></a></blockquote><ul><li>Go to <a href="https://console.aws.amazon.com/ecr/repositories">ECR Dashboard</a> (always verify region) and select the repository that we created before <strong>(Step 4.1)</strong></li><li>Click on <strong>“View Push Command” </strong>to see the command that should be used to push the docker image</li><li>Go to the <strong>“route folder” </strong>of your backend solution and open a <strong>terminal</strong></li><li>Follow the <strong>“View push Command”</strong> window, then replace the second command with this one</li></ul><pre>docker build -t s3m-test -f .\S3MExampleBackend\Dockerfile .</pre><figure><img alt="Build .net docker image and push it to ECR" src="https://cdn-images-1.medium.com/max/1024/1*h0U467HwIA2k1II8sUWoYA.gif" /><figcaption>Deploy Backend</figcaption></figure><ul><li><strong>Copy the URI of the pushed image</strong></li></ul><p><strong><em>3. Let create a Task Definition:</em></strong></p><p>Task definitions specify the container information for your application, such as how many containers are part of your task, what resources they will use, how they are linked together, and which host ports they will use.</p><ul><li>Go to <a href="https://console.aws.amazon.com/ecs/#/taskDefinitions">ECS Dashboard,</a> in the left menu select <strong>“Task Definitions”</strong> then click on <strong>“Create New Task Definition”</strong></li><li>Select Launch Type as <strong>Fargate</strong></li><li>Name your task → scroll down to <strong>Task Execution Role</strong>, if you haven&#39;t yet a role select <strong>“create one”</strong> it will be created automatically.</li><li>Add your container (name it → past the <strong>URI </strong>of pushed image → For memory Limits take 128, and for port-mapping take 80</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xVrxGlgu-0ROgGkWkmdF_w.gif" /><figcaption>Task Definition</figcaption></figure><p><strong><em>4. Let Create a Service :</em></strong></p><p>A service lets you specify how many copies of your task definition to run and maintain in a cluster. We will use it with a <strong>Network Load Balancer </strong>to distribute incoming traffic to containers in our service.</p><ul><li>Go to the <a href="https://console.aws.amazon.com/ecs/home#/clusters">ECS Dashboard</a> → in the left menu select <strong>“Clusters”</strong> then select the Cluster that we created before<strong> (Step 4.2)</strong></li><li>In the <strong>“Service tab” </strong>click on <strong>“Create”</strong></li><li>For <strong>Launch Type</strong> select <strong>“Fargate” →</strong> for <strong>Task Definition</strong> select <strong>“the one created before (Step 5.3) ” →</strong> give it a name and a number of tasks → then click <strong>“Next Step”</strong></li><li>For the <strong>VPC </strong>choose the <strong>“created VPC” (Step 4.3) </strong>and select its <strong>private network</strong></li><li>For <strong>Load Balancer</strong> select the <strong>“One Created Before” (Step 4.4) </strong>and for production listener, select <strong>TCP:80 →</strong> then click on <strong>“next step”</strong> then <strong>“Create Service” →</strong> then <strong>“view Service”</strong> and wait for <strong>task Status</strong> to become <strong>“RUNNING”</strong></li></ul><figure><img alt="Create an ECS Service" src="https://cdn-images-1.medium.com/max/1024/1*k-PTwPH-r0fh-k7VUIubdw.gif" /><figcaption>ECS Service</figcaption></figure><blockquote>All pieces now are together let test our application</blockquote><h3>Test the Applications</h3><ul><li>Search the link of your hosted app in s3 <strong>(Step 5.1 scroll down to static Web Hosting and open the link)</strong></li><li>Example: <a href="http://s3m-angular-front.s3-website-us-east-1.amazonaws.com/">http://s3m-angular-front.s3-website-us-east-1.amazonaws.com</a></li><li>Click on the button <strong>“Get weather” </strong>and you will see your app working</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EaDZ0bYG7HH4n6qw8Vh92g.gif" /></figure><blockquote><strong>Yeeeeeeees everything work like a magic 😜</strong></blockquote><p>That means, all pieces are well connected and we respect every step of the infrastructure as well as deployment to make our project works.</p><p>Also, in the <strong>Authorizer code,</strong> we tell it that only <strong>admin </strong>can make a call, and in the generated token if you remember <strong>admin </strong>is set to <strong>true</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*leVkpJWdjBFXvZ2oNJWHmg.png" /><figcaption>JWT</figcaption></figure><p>Let reverse the if’s condition of the <strong>Lambda Authorizer</strong> and see what happen, so if the user is not admin he can do a call otherwise no</p><ul><li>Go to Lambda Dashboard → Select the one created before <strong>(Step 4.7)</strong> → scroll down to the code and replace</li></ul><pre>if(decodedJwt.admin) by if(!decodedJwt.admin)</pre><ul><li>Then Deploy the function → you will see that you are not authorized to make this call</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nxa2uRQWYKK0MDKrLlkpKA.png" /></figure><h3>Conclusion</h3><p>My goal in this story is to make it easy for everyone to implement the <strong>S3M Pattern.</strong></p><p>In the next Story, you will discover the setting up of automation by using <strong>DevOps &amp; Terraform </strong>with <strong>ci/cd</strong> for backend, frontend as well as <strong>IaC </strong>deployment with (<strong>GitHub Action </strong>and <strong>Terraform Cloud</strong>).</p><p><a href="https://levelup.gitconnected.com/aws-s3m-pattern-terraform-devops-for-a-10-years-child-dac4610017ff">AWS S3M Pattern: Terraform &amp; DevOps for a 10 Years Child</a></p><p>I wish to thank by the way <a href="https://medium.com/u/bb1ad7390fcb">Valentin Lecerf</a> and Soufian Belehrache for their technical advice.</p><p>If you have any remarks, or if something doesn’t seem clear, please leave a comment or contact me on my <a href="https://www.facebook.com/neogafa"><strong>Fb Page</strong></a>, <a href="https://twitter.com/NaoufalGafa"><strong>Twitter</strong></a>, or <a href="https://www.elgafa.com/"><strong>my website</strong></a></p><p><a href="https://elgafa.com/">GAFA Naoufal Portfolio</a></p><p>Finally, I have a challenge for you:</p><ul><li>Create a new backend with a different endpoint ( Different Controller, for example, ValusController that return a list of string)</li><li>Deploy it, you have 3 choices:</li></ul><ol><li>On the same Task Definition</li><li>On different task definition and service</li><li>On different Cluster, Task definition, and service</li></ol><ul><li>Add a new button in your Front to call the new API</li></ul><p>You will see that everything works as expected, we can deploy many micro-services as we want without changing anything in the infrastructure.</p><p>See you at the next Story ✌️.</p><h3>References</h3><ul><li><a href="https://www.alexdebrie.com/posts/lambda-custom-authorizers/">The Complete Guide to Custom Authorizers</a></li><li><a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-private-integration.html">API Gateway Private Integration</a></li><li><a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/get-set-up-for-amazon-ecr.html">Setting Up with ECR</a></li><li><a href="https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-getting-started.html">Getting Started with Amazon ECS on AWS Fargate</a></li><li><a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html">Hosting a static website using Amazon S3</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6585f7856a0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>