<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Emre Oztoprak</title>
    <description>The latest articles on DEV Community by Emre Oztoprak (@emreoztoprak).</description>
    <link>https://dev.to/emreoztoprak</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F720292%2F5db76520-510e-4648-b052-5495f6e521cb.jpeg</url>
      <title>DEV Community: Emre Oztoprak</title>
      <link>https://dev.to/emreoztoprak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emreoztoprak"/>
    <language>en</language>
    <item>
      <title>I built an AI agent that watches my Kubernetes cluster (and can’t break it)</title>
      <dc:creator>Emre Oztoprak</dc:creator>
      <pubDate>Sat, 18 Jul 2026 17:51:28 +0000</pubDate>
      <link>https://dev.to/emreoztoprak/i-built-an-ai-agent-that-watches-my-kubernetes-cluster-and-cant-break-it-44n7</link>
      <guid>https://dev.to/emreoztoprak/i-built-an-ai-agent-that-watches-my-kubernetes-cluster-and-cant-break-it-44n7</guid>
      <description>&lt;h1&gt;
  
  
  I built an AI that watches my Kubernetes cluster (and can't break it)
&lt;/h1&gt;

&lt;p&gt;I only ever found out something was wrong in my cluster when I happened to&lt;br&gt;
open a dashboard. That was the whole reason for this project.&lt;/p&gt;

&lt;p&gt;There are plenty of Kubernetes dashboards, and I didn't want to build&lt;br&gt;
another one. I wanted something that looks at the cluster &lt;em&gt;for&lt;/em&gt; me, pings me when something breaks, and can answer "why is payments-api failing?" without me grepping logs at midnight.&lt;/p&gt;

&lt;p&gt;The obvious answer in 2026 is "point an LLM at it". The obvious problem is&lt;br&gt;
that nobody in their right mind gives an LLM write access to their cluster.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://github.com/emreoztoprak/kentinel" rel="noopener noreferrer"&gt;Kentinel&lt;/a&gt; around one&lt;br&gt;
rule: the AI can see everything and touch nothing.&lt;/p&gt;
&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Every few minutes an agent snapshots the cluster — pod states, events,&lt;br&gt;
deployment availability, CPU/memory from Prometheus — and has an LLM review&lt;br&gt;
it. You get a healthy/warning/critical verdict with specific findings&lt;br&gt;
("checkout is in ImagePullBackOff, the image tag has a typo: 1.27-alpin&lt;br&gt;
should be 1.27-alpine"), not a wall of text.&lt;/p&gt;

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

&lt;p&gt;There's also a chat assistant. It answers with real read-only tools — it&lt;br&gt;
lists resources, reads logs, pulls events, queries metrics — so the answers are grounded in what it actually fetched, not what it imagines your cluster looks like.&lt;/p&gt;

&lt;p&gt;Status changes go to Slack, Discord, or Teams. Only transitions, so it won't message you every five minutes about the same problem. There's an optional daily digest too: what broke, what got fixed, what the LLM usage cost.&lt;/p&gt;

&lt;p&gt;Review history sits in SQLite on a PVC, so "when did this start?" still has an answer after a pod restart.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F19w2280qa6upg8fs55r1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F19w2280qa6upg8fs55r1.png" alt=" " width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The part I'm most happy with
&lt;/h2&gt;

&lt;p&gt;In assisted mode the agent can propose a fix. It shows up right in the chat as a diff with Approve and Reject buttons:&lt;/p&gt;

&lt;p&gt;The agent itself cannot apply anything. Its ServiceAccount has no write&lt;br&gt;
verbs at all — you can check with &lt;code&gt;kubectl auth can-i&lt;/code&gt;. When you approve, a separate server component (which does have write access) applies the change and records the outcome. Every proposal, approval, and rejection is kept.&lt;/p&gt;

&lt;p&gt;That's not a UX choice, it's RBAC. Even if the model goes completely off the rails, "can the AI break prod?" is answered by Kubernetes permissions, not by trusting a prompt. Fully autonomous remediation is explicitly a non-goal. One "the AI deleted my StatefulSet" story is one too many.&lt;/p&gt;
&lt;h2&gt;
  
  
  Nothing has to leave your cluster
&lt;/h2&gt;

&lt;p&gt;The default install ships a small Ollama model in-cluster. No API keys, no&lt;br&gt;
cluster data going anywhere. Being honest: the default model is small&lt;br&gt;
(qwen3 0.6b, picked so it runs on a 4GB minikube) and noticeably dumber&lt;br&gt;
than the cloud options. Claude, OpenAI, DeepSeek, and Gemini are supported&lt;br&gt;
and you can switch from the UI — on my own cluster I run claude-haiku and&lt;br&gt;
the difference in analysis quality is big. But if you're air-gapped, a&lt;br&gt;
bigger local model does fine.&lt;/p&gt;

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


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm &lt;span class="nb"&gt;install &lt;/span&gt;kentinel oci://ghcr.io/emreoztoprak/charts/kentinel &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; kentinel &lt;span class="nt"&gt;--create-namespace&lt;/span&gt;
kubectl &lt;span class="nt"&gt;-n&lt;/span&gt; kentinel port-forward svc/kentinel-server 8080:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The repo ships a demo stack for exactly this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make demo-up        &lt;span class="c"&gt;# a healthy little "shop"&lt;/span&gt;
make demo-incident  &lt;span class="c"&gt;# four realistic failures&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then watch the dashboard flag them and ask the assistant why. That loop —&lt;br&gt;
break it, watch the AI find it — is the best two minutes of the project.&lt;/p&gt;

&lt;p&gt;Code and docs: &lt;a href="https://github.com/emreoztoprak/kentinel" rel="noopener noreferrer"&gt;github.com/emreoztoprak/kentinel&lt;/a&gt;&lt;br&gt;
· &lt;a href="https://emreoztoprak.github.io/kentinel/" rel="noopener noreferrer"&gt;docs site&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you try it and something's wrong or missing, an issue&lt;br&gt;
would genuinely help.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>kubernetes</category>
      <category>llm</category>
      <category>devops</category>
    </item>
    <item>
      <title>Host a static website on AWS under a minute with Terraform</title>
      <dc:creator>Emre Oztoprak</dc:creator>
      <pubDate>Sun, 14 Nov 2021 20:23:32 +0000</pubDate>
      <link>https://dev.to/aws-builders/host-a-static-website-on-aws-under-a-minute-with-terraform-3hmd</link>
      <guid>https://dev.to/aws-builders/host-a-static-website-on-aws-under-a-minute-with-terraform-3hmd</guid>
      <description>&lt;p&gt;If you have a static website and you want a simple solution, S3 and Cloudfront are great choices. S3 with Cloudfront secure, scalable way to host static content. Also, we will get an SSL certificate for our domain and it will be free.&lt;/p&gt;

&lt;h4&gt;
  
  
  Prerequisites
&lt;/h4&gt;

&lt;p&gt;Before the deployment of this terraform module, make sure your hosted zone exists in Route 53 and move your domain to Route53 by changing NS records on your DNS provider.&lt;/p&gt;

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

&lt;p&gt;We will use 4 AWS Services;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;S3 - Storing website files (HTML, CSS, JavaScript)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cloudfront - CDN&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Certificate Manager - SSL Certificate&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Route 53 - DNS records&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since we are using Cloudfront we don't need the public bucket, so we will create a private S3 bucket. We will use OAI (Origin Access Identity) settings when we create Cloudfront. This means that only our Cloudfront distribution can access and read the files in our S3 bucket. Also, we will create an SSL certificate from Certificate Manager and Cloudfront redirect all HTTP traffic to HTTPS.&lt;/p&gt;

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

&lt;p&gt;First clone the repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone git@github.com:emreoztoprak/terraform-aws-s3-cloudfront-acm.git

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

&lt;/div&gt;



&lt;p&gt;Change these two variables in the &lt;strong&gt;terraform.tfvars&lt;/strong&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
SiteTags = "Example" (Tag value of the resources.)

domainName = "example.com"

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

&lt;/div&gt;



&lt;p&gt;You can now run this module when you change the variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform init
terraform plan
terrafom apply --auto-approve

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

&lt;/div&gt;



&lt;p&gt;After the deployment is completed upload your website files to in S3 Bucket. I configured DefaultRootObject as index.html. Basically, when users access your root URL they will see index.html file.&lt;/p&gt;

&lt;p&gt;I just uploaded a simple HTML file.&lt;/p&gt;

&lt;p&gt;Congratulations. You made it. :)&lt;/p&gt;

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

&lt;p&gt;Hope you find this tutorial helpful!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>terraform</category>
      <category>cloudfront</category>
      <category>s3</category>
    </item>
    <item>
      <title>Deploy Elastic Beanstalk Application with Terraform</title>
      <dc:creator>Emre Oztoprak</dc:creator>
      <pubDate>Thu, 21 Oct 2021 12:54:18 +0000</pubDate>
      <link>https://dev.to/aws-builders/deploy-elastic-beanstalk-application-with-terraform-2f9l</link>
      <guid>https://dev.to/aws-builders/deploy-elastic-beanstalk-application-with-terraform-2f9l</guid>
      <description>&lt;p&gt;AWS Elastic Beanstalk is a managed service for deploying and scaling web applications and services. It supports languages such as Java,&amp;nbsp;.NET, PHP, Node.js, Python, Ruby, Go, and also Docker. You can deploy these applications on Apache, Nginx, Passenger, and IIS.&lt;/p&gt;

&lt;p&gt;But Elastic Beanstalk has a lot of configurations. With Terraform we can automate this process. Later we can use the same Terraform script just changing variables.&lt;/p&gt;

&lt;p&gt;With this Terraform configuration, we will create PHP 8.0 Elastic Beanstalk WebServer Environment on Amazon Linux 2 and Nginx. Also Application Load Balancer and SSL certificate for our domain. We will validate this certificate, create A record for our domain and it will be pointed to Elastic Beanstalk Environment. In the end, it will create Cloudwatch alarms for Elastic Beanstalk Environment Health, LoadBalancer 5xx requests, and network out the traffic of our instances.&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Structure of our Terraform Configurations&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html" rel="noopener noreferrer"&gt;Create EC2 Key Pair&amp;nbsp;&lt;/a&gt;&lt;br&gt;
Creating key pair in the EC2 console and using the name of that key pair in Terraform is a secure way than passing the public key pair file in Terraform.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html" rel="noopener noreferrer"&gt;SNS Topic&lt;/a&gt;&lt;br&gt;
When Cloudwatch alarms are triggered you will get notifications via SNS. You can add subscriptions like E-Mail, SMS, or HTTP-HTTPS endpoint like Opsgenie. You can use the same SNS Topic later in different alarms.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingHostedZone.html" rel="noopener noreferrer"&gt;Route53 Public Hosted Zone&lt;/a&gt;&lt;br&gt;
SSL Certification and DNS Records for your domain&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clone the repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git@github.com:emreoztoprak/terraform-aws-elasticbeanstalk.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the variables in the terraform.tfvars file&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I set up one subnet for EC2 Instance and two subnets for ALB. You can change this any number you want.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;When everything is ready you can deploy with these 4 commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform init
terraform validate
terraform plan
terraform apply

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

&lt;/div&gt;



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

&lt;p&gt;&lt;a href="https://github.com/emreoztoprak/terraform-aws-elasticbeanstalk" rel="noopener noreferrer"&gt;Github repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope it was useful. Thank you for reading this article.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Send AWS Config Notification to Slack</title>
      <dc:creator>Emre Oztoprak</dc:creator>
      <pubDate>Wed, 06 Oct 2021 11:20:05 +0000</pubDate>
      <link>https://dev.to/aws-builders/send-aws-config-notification-to-slack-1f7j</link>
      <guid>https://dev.to/aws-builders/send-aws-config-notification-to-slack-1f7j</guid>
      <description>&lt;h3&gt;
  
  
  What is AWS Config?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;AWS Config provides a detailed view of the configuration of AWS resources in your AWS account. This includes how the resources are related to one another and how they were configured in the past so that you can see how the configurations and relationships change over time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s what AWS say. It’s basically compliance and auditing tool for your AWS resources. You can track your resources are compliant or not, according to the rules. Here are some sample rules;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ssh port disabled off all my instances?&lt;/li&gt;
&lt;li&gt;Deletion protection enabled on all my RDS instances?&lt;/li&gt;
&lt;li&gt;IAM Access Keys rotating every 90 day?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But there aren’t only 3 rules, there are too many rules. You can’t track all rules by manually. You want to get notified when a rule change status to &lt;strong&gt;non-compliant.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will do this by Amazon Eventbridge and little python code.&lt;br&gt;
Here our python code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import json, boto3, requests

def lambda_handler(event, context):

    time = event['time']
    region = event['region']
    rule = event["detail"]["configRuleName"]
    resource_type = event["detail"]["newEvaluationResult"]["evaluationResultIdentifier"]["evaluationResultQualifier"]["resourceType"]
    resource_id = event["detail"]["resourceId"]
    compliance = event["detail"]["newEvaluationResult"]["complianceType"]

    webhook_url = "YOUR SLACK WEBHOOK URL"
    slack_data = slack_data = {
    "blocks": [
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "\n*Config Compliance Change* :alert_:"
            }
        },
        {
            "type": "divider"
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "*`Compliance:`*  " + compliance + "\n*`Time:`* " + time + "\n*`Region:`* " + region + "\n*`Rule:`* " + rule +"\n*`Resource Type:`* "+resource_type+"\n*`Resource ID:`* "+ resource_id
            },
            "accessory": {
                "type": "image",
                "image_url": "https://i.ibb.co/BjWcWKt/Picture1.png",
                "alt_text": "thumbnail"
            }
        },
        {
            "type": "divider"
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "For more details."
            },
            "accessory": {
                "type": "button",
                "text": {
                    "type": "plain_text",
                    "text": "AWS Config"
                },
                "value": "click_me_123",
                "url": "https://console.aws.amazon.com/config/home?region="+region+"#/timeline/"+resource_type+"/"+resource_id+"/configuration",
                "action_id": "button-action"
            }
        }
    ]
}
    response = requests.post(
        webhook_url, data=json.dumps(slack_data),
        headers={'Content-Type': 'application/json'}
    )
    if response.status_code != 200:
        raise ValueError(
            'Request to slack returned an error %s, the response is:\n%s'
            % (response.status_code, response.text)
    )

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

&lt;/div&gt;



&lt;p&gt;After uploading our code to lambda, we open the Eventbridge console. First we need event pattern.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "source": ["aws.config"],
  "detail-type": ["Config Rules Compliance Change"],
  "detail": {
    "messageType": ["ComplianceChangeNotification"],
    "newEvaluationResult": {
      "complianceType": ["NON_COMPLIANT"]
    }
  }
}

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

&lt;/div&gt;



&lt;p&gt;This event will trigger our lambda function when &lt;strong&gt;“complianceType”&lt;/strong&gt; goes &lt;strong&gt;“NON_COMPLIANT”&lt;/strong&gt; status.&lt;/p&gt;

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

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

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

&lt;p&gt;Everything is ready now it’s time to see the results.&lt;/p&gt;

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

&lt;p&gt;AWS Config always checks your resources and rules and if a &lt;strong&gt;NON_COMPLIANT&lt;/strong&gt; type event occurs you will get notification like this.&lt;/p&gt;

&lt;p&gt;Thank you for taking the time and reading. I hope it was useful.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>monitoring</category>
      <category>compliance</category>
      <category>auditing</category>
    </item>
  </channel>
</rss>
