<?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 Mamadou kebe on Medium]]></title>
        <description><![CDATA[Stories by Mamadou kebe on Medium]]></description>
        <link>https://medium.com/@mamakebe027?source=rss-af58ada9e0f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QtceplkKjI5Ul8D-OR-x8g.jpeg</url>
            <title>Stories by Mamadou kebe on Medium</title>
            <link>https://medium.com/@mamakebe027?source=rss-af58ada9e0f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:09:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mamakebe027/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[Deploying an Application on AWS EC2 Using Ansible — Step-by-Step Guide for Beginners]]></title>
            <link>https://medium.com/@mamakebe027/deploying-an-application-on-aws-ec2-using-ansible-step-by-step-guide-for-beginners-24ed81d92cfc?source=rss-af58ada9e0f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/24ed81d92cfc</guid>
            <dc:creator><![CDATA[Mamadou kebe]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 12:31:20 GMT</pubDate>
            <atom:updated>2025-12-31T12:31:20.640Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying an Application on AWS EC2 Using Ansible — Step-by-Step Guide for Beginners</h3><blockquote>In modern DevOps environments, manual server configuration is error-prone and does not scale. Configuration management tools like <strong>Ansible</strong> allow us to automate application deployment in a repeatable, reliable way.</blockquote><blockquote>In this article, I will show you <strong>step by step</strong> how to deploy an application on an AWS EC2 instance using Ansible, while explaining key Ansible concepts along the way.</blockquote><h3>Prerequisites</h3><p>### Prerequisites<br>- AWS account<br>- Basic knowledge of Linux<br>- An running EC2 instance (Ubuntu 22.04)<br>- SSH key pair<br>- Ansible installed on your local machine</p><p><strong>Let’s verify if ansible is installed on my local machine</strong></p><pre>ansible --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pl06XVRAoz3NPlaiQrRV9w.png" /></figure><p>An ec2 has already been created we don’t need to show you how create , you can refer to blog or aws documentation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a3r6JGUCSquFDpNO_Pjgdw.png" /></figure><h3>Why Ansible?</h3><ul><li>Agentless (uses SSH)</li><li>Simple YAML syntax</li><li>Idempotent (safe to re-run)</li></ul><h3>Core Ansible Concepts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3yyDjM8P3LoLnudJYlxeQ.png" /></figure><p>In this demo , i will show you the inventory and the playbook</p><h3><strong>Inventory</strong></h3><p>we will be using the following inventory :</p><pre>[targets]<br>web-server-1 ansible_host=35.175.199.79 ansible_user=ubuntu ansible_ssh_private_key_file=serverweb.pem<br><br>[targets:vars]<br>ansible_ssh_common_args=&#39;-o StrictHostKeyChecking=no&#39;</pre><h4>[targets]</h4><p>This is an <strong>Ansible host group</strong>.<br> You can name it anything (web, servers, prod, etc.).</p><h4>web-server-1</h4><p>This is a <strong>logical hostname (alias)</strong> used by Ansible.<br> It does <strong>not</strong> need to match the actual EC2 hostname.</p><blockquote>Best practice: use meaningful names like web-prod-1</blockquote><h4>ansible_host=35.175.199.79</h4><ul><li>This is the <strong>public IP</strong> of your EC2 instance</li><li>Ansible will connect to this IP via SSH</li></ul><h4>ansible_user=ubuntu</h4><ul><li>Correct for <strong>Ubuntu-based EC2 AMIs</strong></li><li>(For Amazon Linux it would be ec2-user)</li></ul><h4>ansible_ssh_private_key_file=serverweb.pem</h4><ul><li>This is the <strong>SSH private key</strong></li></ul><p>Must: Exist locally annd have correct permissions:</p><pre>chmod 400 serverweb.pem</pre><p>Test This Inventory :</p><pre>yawiz % ansible targets -i hosts -m ping</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gTbtIJc2Bl_2nLlXCsV_ww.png" /></figure><p>We can reach our ec2 server successfully .</p><h4>Now let me show you the <strong>playbook</strong></h4><p>Here our playbook config file .</p><pre>---<br>- name: Install Docker, Git and deploy Yawiz web application<br>  hosts: all<br>  become: yes<br><br>  vars:<br>    docker_packages:<br>      - apt-transport-https<br>      - ca-certificates<br>      - curl<br>      - software-properties-common<br>      - gnupg-agent<br>    docker_repo_key_url: https://download.docker.com/linux/ubuntu/gpg<br>    docker_repo: &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable&quot;<br>    app_name: &quot;yawiz-web&quot;<br>    app_dest: &quot;/opt/yawiz&quot;<br><br>  tasks:<br>    - name: Update APT and install dependencies<br>      apt:<br>        name: &quot;{{ docker_packages }}&quot;<br>        state: present<br>        update_cache: yes<br><br>    - name: Add Docker GPG key<br>      apt_key:<br>        url: &quot;{{ docker_repo_key_url }}&quot;<br>        state: present<br><br>    - name: Add Docker repository<br>      apt_repository:<br>        repo: &quot;{{ docker_repo }}&quot;<br>        state: present<br><br>    - name: Install Docker Engine<br>      apt:<br>        name:<br>          - docker-ce<br>          - docker-ce-cli<br>          - containerd.io<br>        state: present<br>        update_cache: yes<br><br>    - name: Ensure Docker service is running<br>      service:<br>        name: docker<br>        state: started<br>        enabled: yes<br><br>    - name: Add ubuntu user to docker group<br>      user:<br>        name: ubuntu<br>        groups: docker<br>        append: yes<br><br>    - name: Install Git<br>      apt:<br>        name: git<br>        state: present<br><br>    - name: Create application directory<br>      file:<br>        path: &quot;{{ app_dest }}&quot;<br>        state: directory<br>        owner: ubuntu<br>        group: ubuntu<br>        mode: &#39;0755&#39;<br><br>    - name: Copy application files<br>      copy:<br>        src: &quot;{{ item }}&quot;<br>        dest: &quot;{{ app_dest }}/&quot;<br>        owner: ubuntu<br>        group: ubuntu<br>        mode: &#39;0644&#39;<br>      with_items:<br>        - Dockerfile<br>        - index.html<br>        - style.css<br>        - script.js<br><br>    - name: Stop existing container<br>      docker_container:<br>        name: &quot;{{ app_name }}&quot;<br>        state: absent<br>      ignore_errors: yes<br><br>    - name: Remove existing image<br>      docker_image:<br>        name: &quot;{{ app_name }}&quot;<br>        state: absent<br>      ignore_errors: yes<br><br>    - name: Build Docker image<br>      docker_image:<br>        name: &quot;{{ app_name }}&quot;<br>        build:<br>          path: &quot;{{ app_dest }}&quot;<br>        source: build<br>        state: present<br><br>    - name: Run Docker container<br>      docker_container:<br>        name: &quot;{{ app_name }}&quot;<br>        image: &quot;{{ app_name }}&quot;<br>        state: started<br>        restart_policy: always<br>        ports:<br>          - &quot;80:80&quot;<br><br>    - name: Wait for application to be ready<br>      wait_for:<br>        port: 80<br>        host: &quot;{{ ansible_default_ipv4.address }}&quot;<br>        delay: 10<br>        timeout: 60<br><br>    - name: Show running containers<br>      command: docker ps<br>      register: docker_ps<br>      changed_when: false<br><br>    - name: Display deployment status<br>      debug:<br>        msg: &quot;✅ Application deployed successfully on {{ inventory_hostname }} at http://{{ ansible_default_ipv4.address }}&quot;</pre><p>This Ansible playbook <strong>automates the entire deployment lifecycle</strong> of a web application on an Ubuntu EC2 instance:</p><ul><li>Installs Docker and Git</li><li>Builds a Docker image</li><li>Runs the application container</li><li>Verifies the deployment</li></ul><h4>Playbook Header</h4><pre>---<br>- name: Install Docker, Git and deploy Yawiz web application<br>  hosts: all<br>  become: yes</pre><h3>---</h3><p>Marks the beginning of a YAML document.</p><h4><strong>name</strong></h4><p>Human-readable description of what the playbook does.</p><p>📌 <strong>Best practice:</strong> Always name your plays clearly.</p><p>hosts: all</p><p>The play runs on <strong>all hosts</strong> defined in the inventory.</p><p>You could restrict this to a group like web.</p><p>become: yes</p><p>Executes tasks with <strong>sudo privileges</strong></p><p>Required for installing packages and managing services</p><h4>Variables Section (Reusability &amp; Clean Code)</h4><pre>vars:<br>  docker_packages:<br>    - apt-transport-https<br>    - ca-certificates<br>    - curl<br>    - software-properties-common<br>    - gnupg-agent</pre><h3>Why use variables?</h3><p>Avoid hardcoding values</p><p>Improve readability</p><p>Easier maintenance</p><p>These packages are <strong>required dependencies</strong> to install Docker securely on Ubuntu.</p><pre>docker_repo_key_url: https://download.docker.com/linux/ubuntu/gpg<br>docker_repo: &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable&quot;</pre><p>Adds Docker’s <strong>official GPG key</strong></p><p>Uses a <strong>dynamic Ubuntu release</strong> (e.g. jammy, focal)</p><p>Makes the playbook portable across Ubuntu versions</p><pre>app_name: &quot;yawiz-web&quot;<br>app_dest: &quot;/opt/yawiz&quot;</pre><h4>System Preparation Tasks</h4><p>Update APT &amp; Install Dependencies</p><pre>- name: Update APT and install dependencies<br>  apt:<br>    name: &quot;{{ docker_packages }}&quot;<br>    state: present<br>    update_cache: yes</pre><ul><li>Updates package cache</li><li>Installs required dependencies</li><li><strong>Idempotent</strong>: runs safely multiple times</li></ul><h4>Docker Installation (Official &amp; Secure)</h4><h4>Add Docker GPG Key</h4><pre>- name: Add Docker repository<br>  apt_repository:<br>    repo: &quot;{{ docker_repo }}&quot;<br>    state: present</pre><h4>Install Docker Engine</h4><pre>- name: Install Docker Engine<br>  apt:<br>    name:<br>      - docker-ce<br>      - docker-ce-cli<br>      - containerd.io<br>    state: present<br>    update_cache: yes</pre><p>Installs:</p><p>Docker Engine</p><p>Docker CLI</p><p>Container runtime</p><h4>Start &amp; Enable Docker</h4><pre>- name: Ensure Docker service is running<br>  service:<br>    name: docker<br>    state: started<br>    enabled: yes</pre><h4>Add User to Docker Group</h4><pre>- name: Add ubuntu user to docker group<br>  user:<br>    name: ubuntu<br>    groups: docker<br>    append: yes</pre><h4>Git Installation</h4><pre>- name: Install Git<br>  apt:<br>    name: git<br>    state: present</pre><h4>Application Directory Setup</h4><pre>- name: Create application directory<br>  file:<br>    path: &quot;{{ app_dest }}&quot;<br>    state: directory<br>    owner: ubuntu<br>    group: ubuntu<br>    mode: &#39;0755&#39;</pre><h4>Copy Application Files</h4><pre>- name: Copy application files<br>  copy:<br>    src: &quot;{{ item }}&quot;<br>    dest: &quot;{{ app_dest }}/&quot;</pre><h4>Clean Old Deployment (Idempotency)</h4><h4>Stop Existing Container</h4><pre>- name: Stop existing container<br>  docker_container:<br>    name: &quot;{{ app_name }}&quot;<br>    state: absent<br>  ignore_errors: yes</pre><h4>Build &amp; Run the Application</h4><pre>- name: Build Docker image<br>  docker_image:<br>    name: &quot;{{ app_name }}&quot;<br>    build:<br>      path: &quot;{{ app_dest }}&quot;</pre><h4>Run Docker Container</h4><pre>- name: Run Docker container<br>  docker_container:<br>    name: &quot;{{ app_name }}&quot;<br>    image: &quot;{{ app_name }}&quot;<br>    ports:<br>      - &quot;80:80&quot;</pre><h4>Display Deployment Status</h4><pre>- name: Display deployment status<br>  debug:<br>    msg: &quot;✅ Application deployed successfully on {{ inventory_hostname }}&quot;</pre><p><em>This playbook demonstrates how Ansible can be used not only for configuration management, but also for complete application deployment workflows using Docker.</em></p><p>Now we can lanch the playbook from my localmachine to deploy the app on our ubuntu server.<br>Be on directory where you have the playbook and excute the following command:</p><pre>ansible-playbook -i hosts deploy_with_ansible.yml</pre><h4>Here is what going on:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdK7_OX6FXl0IwJlD2txlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOiMoS98_qCRxRX3JJ28eA.png" /></figure><p>If everything is correct we should see : Application deployed successfully on web-server-1 at <a href="http://10.0.1.14/">http://10.0.1.14</a>&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9LHyAwoOHwImM8llac756A.png" /></figure><p>Finally if we past the publicip4 of the ubuntu server on our webrowser it should return our deployed application webpage . Let’s check :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkr12Xc4HN31YQW2ImsGSA.png" /></figure><h3>Conclusion</h3><p>In this article, we walked through a <strong>complete, end-to-end deployment</strong> of a web application on an AWS EC2 instance using <strong>Ansible</strong>. Starting from SSH connectivity and inventory configuration, we explored core Ansible concepts such as <strong>playbooks, variables, modules, and idempotency</strong>, and then applied them to a real-world use case.</p><p>By combining <strong>Ansible and Docker</strong>, we were able to fully automate server configuration, application packaging, and deployment in a <strong>repeatable and reliable</strong> way. This approach not only reduces manual errors but also reflects how modern <strong>DevOps teams manage infrastructure and applications at scale</strong>.</p><p>This setup can be easily extended by introducing <strong>Ansible roles</strong>, <strong>dynamic AWS inventory</strong>, <strong>CI/CD pipelines</strong>, or additional security hardening. As your infrastructure grows, Ansible remains a powerful and simple tool to maintain consistency across environments.</p><p>If you’re learning DevOps or working with AWS, mastering Ansible is a key step toward building <strong>scalable, automated, and production-ready systems</strong>.</p><p>Thank you for reading — feel free to share this article, leave a comment, or connect with me if you’d like to dive deeper into <strong>AWS, DevOps, and cloud automation</strong> 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24ed81d92cfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Système d’alertes sportives]]></title>
            <link>https://medium.com/@mamakebe027/syst%C3%A8me-dalertes-sportives-2f44d00a8ebe?source=rss-af58ada9e0f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f44d00a8ebe</guid>
            <dc:creator><![CDATA[Mamadou kebe]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 15:38:40 GMT</pubDate>
            <atom:updated>2025-01-08T15:38:40.790Z</atom:updated>
            <content:encoded><![CDATA[<p>Ce projet est un système d’alerte qui envoie des notifications en temps réel sur les scores des matchs de la NBA aux utilisateurs abonnés par SMS/Email. Il s’appuie sur Amazon SNS, AWS Lambda et Python, Amazon EvenBridge et les API de la NBA pour fournir aux fans de sport des informations actualisées sur les matchs. Le projet démontre les principes de l’informatique en nuage et les mécanismes de notification efficaces.</p><h3>Fonctionnalités</h3><ul><li>Récupère les scores des matchs de la NBA en direct à l’aide d’une API externe.</li><li>Envoi de mises à jour formatées des scores aux abonnés par SMS/Email à l’aide d’Amazon SNS.</li><li>Automatisation programmée pour des mises à jour régulières à l’aide d’Amazon EventBridge.</li><li>Conçu dans un souci de sécurité, selon le principe du moindre privilège pour les rôles IAM.</li></ul><h4>Conditions préalables</h4><ul><li>Compte gratuit avec abonnement et clé API sur <a href="https://sportsdata.io/">sportsdata.io</a></li><li>Compte AWS personnel avec une compréhension de base d’AWS et de Python</li></ul><h4>Setup Instructions<br>Clone the Repository</h4><pre>git clone https://github.com/mamadoukebe19/30dayschallengeweek2.git<br>cd game-day-notifications</pre><h4>Créer un topic SNS</h4><p>— Ouvrez la console de gestion AWS.<br> — Naviguez jusqu’au service SNS.<br> — Cliquez sur Create Topic (Créer un sujet) et sélectionnez Standard comme type de sujet.<br> — Nommez le topic(par exemple, gd_topic) et notez l’ARN.<br> — Cliquez sur Create Topic (Créer un thème).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*nSoBuZ5y7VJtUlZnF-9-PQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*iUQhW_CtJdAyOjn1NODiag.png" /></figure><h4>Ajouter des abonnements au Topic SNS</h4><p>Après avoir créé le thème, cliquez sur le nom du thème dans la liste.<br>Naviguez jusqu’à l’onglet Abonnements et cliquez sur Créer un abonnement.<br>Sélectionnez un protocole :<br> — Pour Email :<br>Choisissez Email.<br> — Saisissez une adresse électronique valide.<br>Pour SMS (numéro de téléphone) :<br> — Choisissez SMS.<br>Saisissez un numéro de téléphone valide au format international (par exemple, +1234567890).</p><p>Cliquez sur Créer un abonnement.<br>Si vous avez ajouté un abonnement par courriel :<br>Vérifiez la boîte de réception de l’adresse électronique fournie.<br>Confirmez l’abonnement en cliquant sur le lien de confirmation dans l’e-mail.<br>Pour les SMS, l’abonnement sera immédiatement actif après sa création.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VNTDUsi4RjLdkE3LyYrcg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3NJjmf2fnwhxQYpj5wRCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*xZAcXtVta6vPF_W9FMnRGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ppP8-viZvy5kTgx-8u8Sw.png" /></figure><h4>Créer la politique de publication SNS</h4><p>— Ouvrez le service IAM dans la console de gestion AWS.<br> — Naviguez vers Politiques → Créer une politique.<br> — Cliquez sur JSON et collez la politique JSON du fichier gd_sns_policy.json.<br> — Remplacez REGION et ACCOUNT_ID par votre région AWS et votre ID de compte.<br> — Cliquez sur Next (Suivant) : Tags (vous pouvez ne pas ajouter de tags).<br>Cliquez sur Suivant : Révision.<br> — Entrez un nom pour la politique (par exemple, gd_sns_policy).<br> — Révisez et cliquez sur Create Policy (Créer une politique).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*anEc7n9ZZ8TfTSmUEPbiXQ.png" /></figure><h4>Créer un rôle IAM pour Lambda</h4><p>— Ouvrez le service IAM dans la console de gestion AWS.<br>Cliquez sur Rôles → Créer un rôle.<br> — Sélectionnez le service AWS et choisissez Lambda.<br>Attachez les politiques suivantes :<br> — Politique de publication SNS (gd_sns_policy) (créée à l’étape précédente).<br>Rôle d’exécution de base Lambda (AWSLambdaBasicExecutionRole) (une politique gérée par AWS).<br>Cliquez sur Suivant : Tags (vous pouvez ignorer l’ajout de tags).<br> — Cliquez sur Suivant : Review (Révision).<br>Saisissez un nom pour le rôle (par exemple, gd_role).<br> — Révisez et cliquez sur Créer un rôle.<br>Copiez et enregistrez l’ARN du rôle pour l’utiliser dans la fonction Lambda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FOreQSrgvC1nsV_IRi_ezw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LtaVc26rdZKdw1-Md-t_RQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s0Ppkop5TaktHPUXv1c7Aw.png" /></figure><h4>Déployer la fonction Lambda</h4><p>— <strong>Ouvrez la console de gestion AWS et naviguez jusqu’au service Lambda.</strong><br>Cliquez sur Create Function (Créer une fonction).<br> — Sélectionnez Author from Scratch.<br>Saisissez un nom de fonction (par exemple, gd_notifications).<br> — Choisissez Python 3.x comme runtime.<br><strong>Attribuez le rôle IAM créé précédemment (gd_role) à la fonction.</strong><br> — Dans la section Code de la fonction :<br>Copiez le contenu du fichier src/gd_notifications.py depuis le référentiel.<br>Collez-le dans l’éditeur de code en ligne.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0G_3_dNNKqLeEfHcZxOnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCKz67z6h9QXbiZbxgAXVA.png" /></figure><p>— <strong>Dans la section Variables d’environnement, ajoutez les éléments</strong> suivants :<br>NBA_API_KEY : votre clé API NBA.<br>SNS_TOPIC_ARN : l’ARN du sujet SNS créé précédemment.<br>Cliquez sur Créer une fonction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-p2fHqrYbmag4ZW6FrWmsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQJVgwTiSkwn_MSt0Zy6UA.png" /></figure><h4>Configurer l’automatisation avec Eventbridge</h4><p><strong>Naviguez vers le service Eventbridge dans la console de gestion AWS.</strong><br>Allez dans Règles → Créer une règle.<br>Sélectionnez Event Source : Schedule.<br><strong>Définissez le calendrier cron pour quand vous voulez des mises à jour (par exemple, toutes les heures).</strong><br>Sous Cibles, sélectionnez la fonction Lambda (gd_notifications) et enregistrez la règle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ao7TfyrY2NBueji2eFlHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ao7TfyrY2NBueji2eFlHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DT5wGurtAfh5CsHZEO-VDQ.png" /></figure><h3>Final Resuls</h3><p>On a reçu une notification par Mail et SMS .La fonction nous a envoyées de données depuis <a href="https://sportsdata.io/">https://sportsdata.io</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*jalCzd3XOn_oYnD4T82OGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fAXCderhoDcmyHVsjzq5sw.jpeg" /></figure><h4>Ce que nous avons appris</h4><p>Concevoir un système de notification avec AWS SNS et Lambda.<br>Sécuriser les services AWS avec des politiques IAM de moindre privilège.<br>Automatiser les flux de travail à l’aide d’EventBridge.<br>Intégrer des API externes dans les flux de travail basés sur le cloud.</p><p><a href="https://www.youtube.com/hashtag/devopsallstarschallenge">#DevOpsAllStarsChallenge</a> <a href="https://www.youtube.com/hashtag/devopsallstarschallenge">#</a>Lecloudfacile <a href="https://www.youtube.com/hashtag/devopsallstarschallenge">#</a><a href="https://github.com/Rothyakinboro/30-Days-DevOps-Challenge">30-Days-DevOps-Challenge</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f44d00a8ebe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Surveillez Vos Instances EC2 Comme un Pro avec Grafana et CloudWatch]]></title>
            <link>https://medium.com/@mamakebe027/surveillez-vos-instances-ec2-comme-un-pro-avec-grafana-et-cloudwatch-69a2dcf72c00?source=rss-af58ada9e0f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/69a2dcf72c00</guid>
            <dc:creator><![CDATA[Mamadou kebe]]></dc:creator>
            <pubDate>Tue, 19 Nov 2024 20:28:38 GMT</pubDate>
            <atom:updated>2024-11-19T22:41:12.518Z</atom:updated>
            <content:encoded><![CDATA[<p>Surveiller votre infrastructure cloud est essentiel pour maintenir ses performances et sa disponibilité. Dans ce tutoriel, je vais vous guider pour mettre en place un système de surveillance de vos instances EC2 en utilisant <strong>AWS CloudWatch</strong> et <strong>Grafana</strong>.</p><p>À la fin, vous disposerez d’un tableau de bord en temps réel affichant des métriques comme l’utilisation du CPU, les entrées/sorties disque, le trafic réseau, et bien plus encore.</p><h3><strong>Étape 1 : Prérequis</strong></h3><p>Avant de commencer, assurez-vous d’avoir :</p><ol><li>Un compte <strong>AWS</strong> avec accès à CloudWatch.</li><li>Une <strong>instance EC2</strong> en cours d’exécution (Linux est préféré pour ce tutoriel).</li><li>Un serveur <strong>Grafana</strong> installé et fonctionnel.</li><li>Une compréhension de base d’AWS et de Grafana.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u6outtRVOiNhVJ9aGA-k1w.png" /><figcaption>voici mon serveur grafana et l’instance a surveiller (cloudwatch_serveur)</figcaption></figure><h3>Étape 2 : Activer la surveillance détaillée sur votre instance EC2</h3><p>Par défaut, EC2 fournit des métriques de base toutes les 5 minutes. Pour obtenir des données plus détaillées :</p><ol><li>Accédez au tableau de bord <strong>EC2</strong> dans la console de gestion AWS.</li><li>Sélectionnez votre instance EC2.</li><li>Cliquez sur <strong>Actions &gt; Monitor and troubleshoot &gt; Manage detailed monitoring</strong>.</li><li>Activez la surveillance détaillée (intervalle de 1 minute).</li></ol><p><strong>Remarque</strong> : La surveillance détaillée engendre des coûts supplémentaires.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5DOZo23bKRWy2WhaybbCpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-iFnYb1QGlVfrAzoaS4vA.png" /></figure><h3>Étape 3 : Installer et configurer l’agent CloudWatch sur l’instance EC2</h3><p>CloudWatch collecte les métriques au niveau du système d’exploitation grâce à l’<strong>agent CloudWatch</strong>.</p><p>Vous avez deux possibilités pour installer l’agent .<br>1_Installer à l’aide de CLI <br> Sur votre instance EC2 :</p><pre>sudo yum update -y # Pour Amazon Linux/Red Hat<br>sudo yum install amazon-cloudwatch-agent -y</pre><pre>sudo apt-get update # Pour ubuntu debian<br>sudo apt-get install amazon-cloudwatch-agent -y</pre><p>2 Installer l’agent cloud depuis console de gestion.<br>Accédez au tableau de bord <strong>EC2</strong> dans la console de gestion AWS.</p><ol><li>Sélectionnez votre instance EC2.</li><li>Cliquez sur <strong>Actions &gt; Monitor and troubleshoot &gt; Configure CloudWatch agent</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mW6Ryt5zd9eGn5hrtJG_Sw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WiwdTIhrQ7huwe5fCMvyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYPKeleR5O1VQUZdqXysMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pXhbQ2C8z9hb0c8Eksz26A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_qtrGTCVEYBfKtk_ricpw.png" /></figure><h3>Étape 3.3 : Vérifier les métriques dans CloudWatch</h3><p>Dans la console AWS, accédez à <strong>CloudWatch &gt; Metrics &gt; EC2</strong> pour visualiser les métriques.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J1VZWoFYXfiFbtscJZmRaw.png" /></figure><h4><strong>Étape 4 : Configurer Grafana et le connecter à CloudWatch</strong></h4><p>Suivivez cette documentation si vous ne savez pas comment le faire :</p><p><a href="https://000029.awsstudygroup.com/3-installgrafana/">Installing Grafana</a></p><p>Une fois grafana installer , reprenez l’addresse ip public de votre serveur suivi de :3000 il ne faut oubliez d’autoriser le traffic depuis le groupe de securité.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ziFdkJkltiOWfNoQc-Od7g.png" /></figure><h4>Étape 4.1 : Installer le plugin de source de données CloudWatch</h4><ol><li>Ouvrez Grafana et connectez-vous.</li><li>Allez dans <strong>Configuration &gt; Plugins</strong>.</li><li>Recherchez <strong>Amazon CloudWatch</strong> et activez le plugin.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3_QucZDRXveNKgRWZFaEA.png" /></figure><h3>Étape 4.2 : Ajouter la source de données CloudWatch</h3><ol><li>Accédez à <strong>Configuration &gt; Data Sources</strong>.</li><li>Cliquez sur <strong>Add Data Source</strong> et sélectionnez <strong>CloudWatch</strong>.</li><li>Renseignez les informations suivantes :</li></ol><ul><li><strong>Name</strong> : CloudWatch</li><li><strong>Default Region</strong> : Sélectionnez la région AWS où se trouve votre instance EC2.</li><li><strong>Access Key et Secret Key</strong> (ou utilisez un rôle IAM si Grafana est hébergé sur AWS).</li></ul><p>4 Cliquez sur <strong>Save &amp; Test</strong> pour valider la connexion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPWRhh2zH9AgCsRQK3WFJg.png" /></figure><h3>Étape 5.1 : Ajouter des panneaux pour les métriques EC2</h3><ol><li>Dans Grafana, accédez à <strong>Dashboards &gt; New Dashboard</strong>.</li><li>Cliquez sur <strong>Add a New Panel</strong> et configurez-le :</li></ol><ul><li><strong>Data Source</strong> : Sélectionnez CloudWatch.</li><li><strong>Namespace</strong> : Choisissez AWS/EC2.</li><li><strong>Metric</strong> : Par exemple, CPUUtilization.</li><li><strong>Dimensions</strong> : Définissez InstanceId avec l’ID de votre instance EC2.</li></ul><p>3 Personnalisez la visualisation :</p><ul><li>Changez le type de graphique (par exemple : série temporelle).</li><li>Ajustez les seuils, les couleurs et les étiquettes.</li><li>Répétez pour ajouter d’autres panneaux pour des métriques comme DiskReadOps, NetworkIn, etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W4tNcjFjZFiF9NjD54kIhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZgfQKv902hMJjsY9Ch-hRA.png" /></figure><h3>Étape 6 : Personnaliser les alertes dans Grafana (optionnel)</h3><p>Configurez des alertes pour recevoir des notifications en cas de dépassement de seuils spécifiques.</p><ol><li>Dans un panneau Grafana, cliquez sur <strong>Edit &gt; Alert &gt; Create Alert</strong>.</li><li>Définissez les conditions (par exemple : CPU &gt; 80 %).</li><li>Connectez une chaîne d’alerte (e-mail, Slack, ou PagerDuty).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C13buCmeBMG9Glm-m6R_3g.png" /></figure><h3>Conclusion</h3><p>Félicitations ! Nous avons mis en place un système de surveillance performant pour de nos instances EC2 avec Grafana et CloudWatch. Grâce à cette configuration, Nous pouvons surveiller les métriques critiques et recevoir des alertes pour maintenir les performances et la disponibilité de vos applications.</p><p>Quelles métriques surveillez-vous le plus dans votre infrastructure ? Partagez vos idées dans les commentaires !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69a2dcf72c00" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>