<?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: Navapon</title>
    <description>The latest articles on DEV Community by Navapon (@navapon).</description>
    <link>https://dev.to/navapon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F573331%2Fef3c7d6e-cc32-4884-abc3-e87f7152d5cd.jpg</url>
      <title>DEV Community: Navapon</title>
      <link>https://dev.to/navapon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/navapon"/>
    <language>en</language>
    <item>
      <title>Amazon Q x GitHub Actions: Enhancing Your CI/CD Pipeline with Generative AI</title>
      <dc:creator>Navapon</dc:creator>
      <pubDate>Mon, 26 Jan 2026 18:01:56 +0000</pubDate>
      <link>https://dev.to/aws-builders/amazon-q-x-github-actions-enhancing-your-cicd-pipeline-with-generative-ai-555f</link>
      <guid>https://dev.to/aws-builders/amazon-q-x-github-actions-enhancing-your-cicd-pipeline-with-generative-ai-555f</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Modern CI/CD pipelines face a major bottleneck—slow manual code reviews, delayed security feedback, and the dreaded cost of context switching.&lt;/p&gt;

&lt;p&gt;Let’s be honest: as humans, we have limits. As a reviewer, you have to mentally juggle code quality, style guidelines, security implications, and readability. And that’s on top of your &lt;em&gt;actual&lt;/em&gt; job: solving complex real-world problems, managing new projects, and surviving endless team meetings.&lt;/p&gt;

&lt;p&gt;Imagine having an intelligent automation layer that acts as the "first line of defense." A smart assistant that reviews the code &lt;em&gt;before&lt;/em&gt; you do, catching the low-hanging fruit so you can focus on the logic.&lt;/p&gt;

&lt;p&gt;Enter &lt;strong&gt;Amazon Q Developer&lt;/strong&gt; ( via GitHub Apps). It is an AI assistant that lives directly within your development environment, from your IDE to your GitHub Pull Requests.&lt;/p&gt;

&lt;p&gt;In this post, I’ll explain how integrating Amazon Q with GitHub Actions can streamline development, automate mundane tasks, and significantly enhance security (DevSecOps) and software quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started: Installation
&lt;/h2&gt;

&lt;p&gt;Setting this up is surprisingly simple. We don't need complex YAML configurations yet; we just need the GitHub App.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install the App:&lt;/strong&gt; Go to the &lt;a href="https://github.com/marketplace/amazon-q-developer" rel="noopener noreferrer"&gt;Amazon Q Developer GitHub Marketplace page&lt;/a&gt; and click install.&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%2Fs7ay54huv9a9vw9ccply.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%2Fs7ay54huv9a9vw9ccply.png" alt="GithubApps" width="800" height="1183"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify Installation:&lt;/strong&gt; Once authorized, that’s it! Everything is set. To make sure it was installed successfully, check your repository settings; you should see the app listed like this:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fbuzw8qyz4od2sbrni41p.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%2Fbuzw8qyz4od2sbrni41p.png" alt="VerifiedGithub" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The GitHub App requires permission to access your repository. You can choose to apply it to "All repositories" or select specific ones. It needs Read/Write access to function correctly.&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%2Fnzyzszzuefvks59pvghr.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%2Fnzyzszzuefvks59pvghr.png" alt="Permission" width="800" height="161"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Core Capabilities in the Pipeline
&lt;/h2&gt;

&lt;p&gt;There are two main "Agents" that Amazon Q brings to your GitHub workflow. Let's look at them:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Amazon Q Agent for Software Development (From Issue to PR)
&lt;/h3&gt;

&lt;p&gt;This agent can actually take a GitHub Issue description and write the code for you. While this blog focuses on the &lt;em&gt;review&lt;/em&gt; aspect, this feature is incredibly powerful for scaffolding or boilerplate tasks.&lt;br&gt;
I do not use these features often, mostly if I would like to do this stuff will do it at my cli by using &lt;code&gt;claude code&lt;/code&gt; or &lt;code&gt;kiro-cli.&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;If you are interested, you can learn more here:&lt;/em&gt; &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/github-feature-development.html" rel="noopener noreferrer"&gt;Amazon Q Developer User Guide&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Amazon Q Agent for Code Review (Automated PR Scanning)
&lt;/h3&gt;

&lt;p&gt;This is where the magic happens for the pipeline. When you open a Pull Request (PR), Amazon Q automatically scans your changes and performs a review based on several criteria.&lt;/p&gt;

&lt;p&gt;Here are the key features:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Security Scanning (DevSecOps)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;It detects vulnerabilities (CVEs), hardcoded secrets, and anti-patterns. This is crucial for a "Shift Left" strategy—catching security flaws before they ever reach a staging environment.&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%2Fwkbv2w2lq9p0cy1nhfsg.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%2Fwkbv2w2lq9p0cy1nhfsg.png" alt="Example of Security Review" width="800" height="1162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Code Quality &amp;amp; Refactoring&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;I once spent 20 minutes staring at a "bug" only to realize I had misspelled a variable name that my tired eyes missed. We've all been there. Amazon Q catches these simple typos and redundant logic instantly. It explains why the code is bad and how to improve it. This helps the PR creator self-review and fix issues before asking a human teammate to step in.&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%2F025y6ax7y2hvhokpe83w.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%2F025y6ax7y2hvhokpe83w.png" alt="Inline Code Comment" width="800" height="656"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Interactive Review&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;If you need a fresh look after making fixes, you don't have to wait. You can interact with the bot using comments like &lt;code&gt;/q review&lt;/code&gt; to request specific feedback or trigger a full re-scan.&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%2Fkf39l12sohmihn1xao4f.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%2Fkf39l12sohmihn1xao4f.png" alt="Example" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt; You can also apply the commit suggested by Amazon Q directly from the GitHub Console or your IDE with a single click.&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%2Faj3xoc6yfs16unwazp97.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%2Faj3xoc6yfs16unwazp97.png" alt="Apply Commit from Suggestion" width="800" height="713"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Customize your own System Project Prompts&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Tailor Amazon Q to your team's needs! Define custom coding standards in simple Markdown files in the project-root/.amazonq/rules directory. Amazon Q automatically follows your guidelines, ensuring consistent code quality across your entire project. &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/third-party-context-project-rules.html" rel="noopener noreferrer"&gt;Learn more&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The DevSecOps Advantage
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shift Left Security:&lt;/strong&gt; We catch vulnerabilities during the PR phase, long before deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The 24/7 Reviewer:&lt;/strong&gt; AI doesn't get "tired." It enforces consistent coding standards across every PR, whether it's 2 PM or 2 AM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency at Scale:&lt;/strong&gt; &lt;strong&gt;In my observation, this tool filters out about 30-40% of trivial comments (syntax, style, simple bugs).&lt;/strong&gt; This frees up senior engineers to focus purely on high-level architecture and business logic, rather than acting as a glorified spell-checker.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limitations &amp;amp; Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Human in the Loop:&lt;/strong&gt; Always remember that AI is an assistant, not a replacement (yet). Suggestions must still be reviewed by a human. Additionally, Unit/Integration tests and other dynamic/static tools in your CI pipeline remain mandatory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context Limits:&lt;/strong&gt; Be aware that very large files or massive PRs might hit context limits. I faced this often earlier in 2025, but since November 2025, I've noticed significant improvements and haven't hit the limit recently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are facing limitations or need troubleshooting, you can check the official guide &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/github-register-app-install.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;




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

&lt;p&gt;Amazon Q isn't just a chatbot; it's an active participant in your workflow. It feels like having a Full Stack Senior Engineer sitting right next to you (or inside your pipeline), providing instant feedback.&lt;/p&gt;

&lt;p&gt;I believe this type of automation will soon become the industry standard. With multiple AI agents aware of different pillars—Security, Quality, Performance, Cost, etc.—we can ensure our code is production-ready faster than ever.&lt;/p&gt;

&lt;p&gt;You guys can simply install the Amazon Q GitHub App today and let your first AI code review happen automatically.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I’d love to hear from you: How are you using AI tools to help your pipeline automation? Let me know in the comments!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>ai</category>
      <category>cicd</category>
      <category>amazonq</category>
    </item>
    <item>
      <title>Why Your AWS GuardDuty Data Isn't Showing Up in Microsoft Sentinel (And How to Fix It)</title>
      <dc:creator>Navapon</dc:creator>
      <pubDate>Fri, 16 Jan 2026 05:13:30 +0000</pubDate>
      <link>https://dev.to/aws-builders/why-your-aws-guardduty-data-isnt-showing-up-in-microsoft-sentinel-and-how-to-fix-it-2b0n</link>
      <guid>https://dev.to/aws-builders/why-your-aws-guardduty-data-isnt-showing-up-in-microsoft-sentinel-and-how-to-fix-it-2b0n</guid>
      <description>&lt;p&gt;&lt;em&gt;The silent killer: KMS encryption blocking your SIEM integration with zero error logs&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;If you're integrating AWS GuardDuty with Microsoft Sentinel and your findings are mysteriously disappearing into the void, you're not alone. I spent hours debugging this issue, only to discover it was a KMS encryption permission problem — with absolutely no error logs to point me in the right direction.&lt;/p&gt;

&lt;p&gt;Here's what happened and how I resolved the issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; GuardDuty findings not appearing in Microsoft Sentinel, no error logs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; GuardDuty exports are KMS-encrypted, and Sentinel's IAM role lacks &lt;code&gt;kms:Decrypt&lt;/code&gt; permission.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Add &lt;code&gt;kms:Decrypt&lt;/code&gt; permission for your KMS key(s) to your Sentinel OIDC role.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;I was setting up Microsoft Sentinel to ingest AWS GuardDuty findings for centralized security monitoring. The architecture looked like this:&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%2F0l0zck9rmw7ehvknmhyu.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%2F0l0zck9rmw7ehvknmhyu.jpg" alt="Simple Architect" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything seemed configured correctly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GuardDuty export to S3 was enabled&lt;/li&gt;
&lt;li&gt;S3 bucket permissions were set&lt;/li&gt;
&lt;li&gt;S3 Event notification sends a message to SQS&lt;/li&gt;
&lt;li&gt;Sentinel data connector was configured&lt;/li&gt;
&lt;li&gt;SQS permissions were set allow s3 event publish the message&lt;/li&gt;
&lt;li&gt;The SQS metric &lt;code&gt;Number Of Messages Received&lt;/code&gt; show message was consumed&lt;/li&gt;
&lt;li&gt;OIDC role for Sentinel had SQS consume permissions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But no data or table appeared in Sentinel. None. Zero. Zilch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Frustrating Part: No Errors
&lt;/h2&gt;

&lt;p&gt;Here's what made this particularly painful to debug — there were &lt;strong&gt;no error logs anywhere&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I checked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;AzureDiagnostics&lt;/code&gt; table in Log Analytics — nothing&lt;/li&gt;
&lt;li&gt;Sentinel data connector health — showed "connected"&lt;/li&gt;
&lt;li&gt;SQS — Sentinel was consume the message fine&lt;/li&gt;
&lt;li&gt;Request help from AWS Support confirm the message was consume specific role
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Operation=ReceiveMessage
LPRemoteIpAddress=XX.XX.XXX.XX
AwsUserPrincipal=AROAXXXXXXXXXXXX:MicrosoftSentinel_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
MessageIds=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
AWSQueryStatusCode=200
RequestId=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
VisibilityTimeout=300
Queue.names=sentinel-soc-guardduty
ReceiveWaitTime=3000
RequesterUserARN=arn:aws:sts::XXXXXXXXXXXX:assumed-role/OIDC_aws-sentinel-oidc-role-guardduty/MicrosoftSentinel_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
AwsUserArn=arn:aws:sts::XXXXXXXXXXXX:assumed-role/OIDC_aws-sentinel-oidc-role-guardduty/MicrosoftSentinel_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
AwsAccessKeyId=ASIAXXXXXXXXXXXX
EndTime=Wed, 14 Jan 2026 10:28:43 UTC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The data was just silently disappearing. It's like Sentinel was reading the message, shrugging, and moving on without telling anyone.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Root Cause: KMS Encryption
&lt;/h2&gt;

&lt;p&gt;After way too much troubleshooting, I finally figured it out.&lt;/p&gt;

&lt;p&gt;When you configure GuardDuty to export findings to S3, you can (and should) enable encryption. AWS lets you use a KMS key for this:&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%2Fz93qaok7m30ycjrguhr4.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%2Fz93qaok7m30ycjrguhr4.png" alt="GuardDuty Settings" width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The problem? &lt;strong&gt;The GuardDuty finding files are encrypted with KMS, and Sentinel couldn't decrypt them.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's what was happening:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GuardDuty writes findings to S3, encrypted with KMS&lt;/li&gt;
&lt;li&gt;S3 Event Notification sends a message to SQS&lt;/li&gt;
&lt;li&gt;The message in SQS was encrypted with KMS&lt;/li&gt;
&lt;li&gt;Sentinel's OIDC role consumes the message from SQS (this works fine)&lt;/li&gt;
&lt;li&gt;Sentinel tries to read the file contents — but they're encrypted&lt;/li&gt;
&lt;li&gt;Sentinel can't call &lt;code&gt;kms:Decrypt&lt;/code&gt; because it doesn't have permission&lt;/li&gt;
&lt;li&gt;Sentinel silently fails and moves on&lt;/li&gt;
&lt;li&gt;No error is logged anywhere&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The fact that there's no error logging for this scenario is... frustrating, to say the least.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix
&lt;/h2&gt;

&lt;p&gt;The solution is simple once you know the problem: &lt;strong&gt;add &lt;code&gt;kms:Decrypt&lt;/code&gt; permission to your Sentinel OIDC role&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Add this statement to your Sentinel IAM role's policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"kms:Decrypt"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:kms:YOUR-REGION:YOUR-ACCOUNT-ID:key/YOUR-KMS-KEY-ID"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, my configuration needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"kms:Decrypt"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:kms:ap-southeast-1:12345678:key/12345678"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step-by-Step
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Find your KMS key ARN&lt;/strong&gt; — Go to GuardDuty → Settings → Findings export options. The KMS key ARN is displayed there.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Find your Sentinel OIDC role&lt;/strong&gt; — This is the role you created when setting up the AWS data connector in Sentinel. Mine was named &lt;code&gt;OIDC_aws-sentinel-oidc-role-guardduty&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Update the IAM policy&lt;/strong&gt; — Go to IAM → Roles → Your Sentinel role → Edit the attached policy → Add the &lt;code&gt;kms:Decrypt&lt;/code&gt; permission for your KMS key(s).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test the integration&lt;/strong&gt; — Generate a sample finding in GuardDuty and wait 5-10 minutes. Check Sentinel with this KQL query:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AWSGuardDuty
| limit 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Things to Remember
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;KMS key must be in the same region as your S3 bucket.&lt;/strong&gt; AWS enforces this, so it shouldn't be an issue if your export is already working.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You might have multiple KMS keys.&lt;/strong&gt; If you've changed keys or have different configurations, make sure all relevant keys are included in the policy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The error won't show up in AzureDiagnostics.&lt;/strong&gt; I wish I could tell you to look for a specific error, but there isn't one. If your GuardDuty data isn't appearing and everything else looks correct, check KMS permissions.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Related:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_exportfindings.html" rel="noopener noreferrer"&gt;AWS GuardDuty Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/sentinel/connect-aws" rel="noopener noreferrer"&gt;Microsoft Sentinel AWS Connector&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>devsecops</category>
      <category>guardduty</category>
    </item>
    <item>
      <title>How to make AWS Infrastructure As Click to Code with AmazonQ</title>
      <dc:creator>Navapon</dc:creator>
      <pubDate>Tue, 10 Dec 2024 15:37:59 +0000</pubDate>
      <link>https://dev.to/navapon/how-to-make-aws-infrastructure-as-click-to-code-with-amazonq-57j1</link>
      <guid>https://dev.to/navapon/how-to-make-aws-infrastructure-as-click-to-code-with-amazonq-57j1</guid>
      <description>&lt;p&gt;We can't be denied due to some use cases, like the &lt;code&gt;poc phase&lt;/code&gt; or exploring how it works and what I could configure. After we understand and make things work, we would like to manage it as code properly for readability, trackability, and maintainability.&lt;/p&gt;

&lt;p&gt;This blog post will show you what AWS Services are supported to help you click and export from Console to Code.&lt;/p&gt;

&lt;p&gt;There are 2 Services I would like to talk about &lt;/p&gt;

&lt;h2&gt;
  
  
  Console-to-Code
&lt;/h2&gt;

&lt;p&gt;The Console-To-Code, powered by Amazon Q Developer, Thas has &lt;a href="https://aws.amazon.com/about-aws/whats-new/2024/10/general-availability-console-to-code-generate-code/" rel="noopener noreferrer"&gt;announcement&lt;/a&gt; that as of October 10, 2024, it is generally available for EC2, VPC, and RDS.&lt;/p&gt;

&lt;p&gt;Let's see how it works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get start
&lt;/h3&gt;

&lt;p&gt;First, you need to go to the AWS Console. In this case, I will give an example of Using the RDS service.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the RDS Console. Click on the right-top corner, and Click Start Recording&lt;/li&gt;
&lt;/ul&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%2Fg7ou68f7001v4oupabds.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%2Fg7ou68f7001v4oupabds.png" alt="Console to Code" width="800" height="1155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I will proceed to create an AuroraSQL Serverless instance. Let's see what the result of that&lt;/li&gt;
&lt;/ul&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%2Fguqf347ef9i2s1rjzabc.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%2Fguqf347ef9i2s1rjzabc.png" alt=" " width="800" height="549"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The console-to-code is recording my actual actions. The result turns into the &lt;code&gt;aws-cli&lt;/code&gt; command. Also, cloud formation and AWSCDK are powered by AmazonQ. But there is no Terraform. :( No problem; we will convert that thing to Terraform. Let's see how it is doing. Below is the cli command I got from there.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws rds create-db-cluster &lt;span class="nt"&gt;--engine&lt;/span&gt; &lt;span class="s2"&gt;"aurora-postgresql"&lt;/span&gt; &lt;span class="nt"&gt;--engine-version&lt;/span&gt; &lt;span class="s2"&gt;"15.4"&lt;/span&gt; &lt;span class="nt"&gt;--engine-lifecycle-support&lt;/span&gt; &lt;span class="s2"&gt;"open-source-rds-extended-support-disabled"&lt;/span&gt; &lt;span class="nt"&gt;--engine-mode&lt;/span&gt; &lt;span class="s2"&gt;"provisioned"&lt;/span&gt; &lt;span class="nt"&gt;--db-cluster-identifier&lt;/span&gt; &lt;span class="s2"&gt;"database-1"&lt;/span&gt; &lt;span class="nt"&gt;--vpc-security-group-ids&lt;/span&gt; &lt;span class="s2"&gt;"sg-xxxxxxxxx"&lt;/span&gt; &lt;span class="nt"&gt;--port&lt;/span&gt; &lt;span class="s2"&gt;"5432"&lt;/span&gt; &lt;span class="nt"&gt;--db-cluster-parameter-group-name&lt;/span&gt; &lt;span class="s2"&gt;"default.aurora-postgresql15"&lt;/span&gt; &lt;span class="nt"&gt;--database-name&lt;/span&gt; &lt;span class="s2"&gt;"rds_aurora_console_to_code"&lt;/span&gt; &lt;span class="nt"&gt;--master-username&lt;/span&gt; &lt;span class="s2"&gt;"postgres"&lt;/span&gt; &lt;span class="nt"&gt;--preferred-backup-window&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--preferred-maintenance-window&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--backup-retention-period&lt;/span&gt; &lt;span class="s2"&gt;"7"&lt;/span&gt; &lt;span class="nt"&gt;--kms-key-id&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--db-subnet-group-name&lt;/span&gt; &lt;span class="s2"&gt;"default-vpc-xxxxxxxxxxx"&lt;/span&gt; &lt;span class="nt"&gt;--availability-zones&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--enable-cloudwatch-logs-exports&lt;/span&gt; &lt;span class="s2"&gt;"postgresql"&lt;/span&gt; &lt;span class="nt"&gt;--pre-signed-url&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;--backtrack-window&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--scaling-configuration&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--domain&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--domain-iam-role-name&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--allocated-storage&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--iops&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--option-group-name&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--storage-throughput&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--storage-type&lt;/span&gt; &lt;span class="s2"&gt;"aurora"&lt;/span&gt; &lt;span class="nt"&gt;--db-cluster-instance-class&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--network-type&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--serverless-v2-scaling-configuration&lt;/span&gt; &lt;span class="s1"&gt;'{"MinCapacity":0.5,"MaxCapacity":1}'&lt;/span&gt; &lt;span class="nt"&gt;--performance-insights-kmskey-id&lt;/span&gt; &lt;span class="s1"&gt;'null'&lt;/span&gt; &lt;span class="nt"&gt;--performance-insights-retention-period&lt;/span&gt; &lt;span class="s2"&gt;"465"&lt;/span&gt; &lt;span class="nt"&gt;--monitoring-interval&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt; &lt;span class="nt"&gt;--database-insights-mode&lt;/span&gt; &lt;span class="s2"&gt;"advanced"&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sadly but understandable, we could not use the result generated by AmazonQ yet to make it work. What I have done is the following&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;remove all keys with a null value&lt;/li&gt;
&lt;li&gt;added missing parameters &lt;code&gt;--enable-performance-insight&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;added missing parameters &lt;code&gt;--manage-master-user-password&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the worked version that has been modified&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws rds create-db-cluster &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--engine&lt;/span&gt; &lt;span class="s2"&gt;"aurora-postgresql"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--engine-version&lt;/span&gt; &lt;span class="s2"&gt;"15.4"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--engine-lifecycle-support&lt;/span&gt; &lt;span class="s2"&gt;"open-source-rds-extended-support-disabled"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--engine-mode&lt;/span&gt; &lt;span class="s2"&gt;"provisioned"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--db-cluster-identifier&lt;/span&gt; &lt;span class="s2"&gt;"rds-aurora-console-to-code"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--vpc-security-group-ids&lt;/span&gt; &lt;span class="s2"&gt;"sg-xxxxxxxx"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--port&lt;/span&gt; &lt;span class="s2"&gt;"5432"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--db-cluster-parameter-group-name&lt;/span&gt; &lt;span class="s2"&gt;"default.aurora-postgresql15"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--database-name&lt;/span&gt; &lt;span class="s2"&gt;"rds_aurora_console_to_code"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--master-username&lt;/span&gt; &lt;span class="s2"&gt;"postgres"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--manage-master-user-password&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--backup-retention-period&lt;/span&gt; &lt;span class="s2"&gt;"7"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--db-subnet-group-name&lt;/span&gt; &lt;span class="s2"&gt;"default-vpc-xxxxxxxx"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--enable-cloudwatch-logs-exports&lt;/span&gt; &lt;span class="s2"&gt;"postgresql"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--pre-signed-url&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--storage-type&lt;/span&gt; &lt;span class="s2"&gt;"aurora"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--serverless-v2-scaling-configuration&lt;/span&gt; &lt;span class="s1"&gt;'{"MinCapacity":0.5,"MaxCapacity":1}'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--enable-performance-insights&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--performance-insights-retention-period&lt;/span&gt; &lt;span class="s2"&gt;"465"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--monitoring-interval&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--database-insights-mode&lt;/span&gt; &lt;span class="s2"&gt;"advanced"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's make it work with Terraform. I copied the above command asking my AmazonQ.&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%2Fqcpmo7oycfbiu9nr6lbi.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%2Fqcpmo7oycfbiu9nr6lbi.png" alt="qconvertterraform" width="800" height="1207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Q responded with very long instructions and told me what I had to do; for a demo, I just needed to make it quick, so I prompted AmazonQ &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please create what you told me via bash scripts below what I got&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c"&gt;# setup_aurora.sh&lt;/span&gt;

&lt;span class="c"&gt;# Create directory for the project&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; aurora_terraform
&lt;span class="nb"&gt;cd &lt;/span&gt;aurora_terraform

&lt;span class="c"&gt;# Create main.tf&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; main.tf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
provider "aws" {
  region  = var.aws_region
  version = "5.80"
}

resource "aws_rds_cluster" "aurora_cluster" {
  cluster_identifier        = var.cluster_identifier
  engine                   = "aurora-postgresql"
  engine_version           = "15.4"
  engine_mode              = "provisioned"
  database_name            = var.database_name
  master_username          = var.master_username
  manage_master_user_password = true

  vpc_security_group_ids   = [var.security_group_id]
  db_subnet_group_name     = var.db_subnet_group_name
  port                     = var.port

  db_cluster_parameter_group_name = var.db_cluster_parameter_group_name
  backup_retention_period  = var.backup_retention_period

  storage_type = "aurora"

  serverlessv2_scaling_configuration {
    min_capacity = 0.5
    max_capacity = 1.0
  }

  enable_cloudwatch_logs_exports = ["postgresql"]

  enable_performance_insights = true
  performance_insights_retention_period = 465

  monitoring_interval = 0
}

resource "aws_rds_cluster_instance" "aurora_instance" {
  cluster_identifier        = aws_rds_cluster.aurora_cluster.id
  instance_class           = "db.serverless"
  engine                   = aws_rds_cluster.aurora_cluster.engine
  engine_version           = aws_rds_cluster.aurora_cluster.engine_version
  performance_insights_enabled = true
}
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="c"&gt;# Create variables.tf&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; variables.tf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
variable "aws_region" {
  description = "AWS region"
  type        = string
  default     = "us-west-2"
}

variable "cluster_identifier" {
  description = "The identifier for the RDS cluster"
  type        = string
  default     = "rds-aurora-console-to-code"
}

variable "database_name" {
  description = "The name of the database to create"
  type        = string
  default     = "rds_aurora_console_to_code"
}

variable "master_username" {
  description = "Username for the master DB user"
  type        = string
  default     = "postgres"
}

variable "security_group_id" {
  description = "VPC Security Group ID"
  type        = string
  default     = "sg-09dfbfb45a551f09a"
}

variable "db_subnet_group_name" {
  description = "Name of DB subnet group"
  type        = string
  default     = "default-vpc-08b0f21ff827d6b88"
}

variable "port" {
  description = "The port on which the DB accepts connections"
  type        = number
  default     = 5432
}

variable "db_cluster_parameter_group_name" {
  description = "Name of the DB cluster parameter group"
  type        = string
  default     = "default.aurora-postgresql15"
}

variable "backup_retention_period" {
  description = "The days to retain backups for"
  type        = number
  default     = 7
}
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="c"&gt;# Create outputs.tf&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; outputs.tf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
output "cluster_endpoint" {
  description = "The cluster endpoint"
  value       = aws_rds_cluster.aurora_cluster.endpoint
}

output "cluster_reader_endpoint" {
  description = "The cluster reader endpoint"
  value       = aws_rds_cluster.aurora_cluster.reader_endpoint
}

output "cluster_identifier" {
  description = "The RDS cluster identifier"
  value       = aws_rds_cluster.aurora_cluster.cluster_identifier
}

output "database_name" {
  description = "The database name"
  value       = aws_rds_cluster.aurora_cluster.database_name
}

output "port" {
  description = "The database port"
  value       = aws_rds_cluster.aurora_cluster.port
}

output "master_username" {
  description = "The master username for the database"
  value       = aws_rds_cluster.aurora_cluster.master_username
}
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="c"&gt;# Create terraform.tfvars (optional - for custom values)&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; terraform.tfvars &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
aws_region = "us-west-2"
cluster_identifier = "rds-aurora-console-to-code"
database_name = "rds_aurora_console_to_code"
master_username = "postgres"
security_group_id = "sg-09dfbfb45a551f09a"
db_subnet_group_name = "default-vpc-08b0f21ff827d6b88"
port = 5432
db_cluster_parameter_group_name = "default.aurora-postgresql15"
backup_retention_period = 7
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="c"&gt;# Make the script executable&lt;/span&gt;
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x setup_aurora.sh

&lt;span class="c"&gt;# Initialize and apply Terraform (uncomment these lines if you want automatic execution)&lt;/span&gt;
&lt;span class="c"&gt;# terraform init&lt;/span&gt;
&lt;span class="c"&gt;# terraform plan&lt;/span&gt;
&lt;span class="c"&gt;# terraform apply -auto-approve&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Terraform configuration files have been created successfully!"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"To deploy the infrastructure:"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"1. Review and modify terraform.tfvars if needed"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"2. Run: terraform init"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"3. Run: terraform plan"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"4. Run: terraform apply"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have followed the created scripts and run them, and the result that I got and have to fix is&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;wrong regions&lt;/li&gt;
&lt;li&gt;missing provider version&lt;/li&gt;
&lt;li&gt;some parameters do not exist in terraform checked at &lt;a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster#db_subnet_group_name-1" rel="noopener noreferrer"&gt;document&lt;/a&gt; or using &lt;a href="https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform" rel="noopener noreferrer"&gt;VSCODE Terraform&lt;/a&gt; Plugins will show the error on line&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After that fixed things, run &lt;code&gt;terraform init&lt;/code&gt;, &lt;code&gt;terraform plan&lt;/code&gt;, &lt;code&gt;terraform apply&lt;/code&gt; it working !! &lt;/p&gt;

&lt;p&gt;We have three instances with three different approaches to operate with it. I will talk about the other service later. I don't need to blog for too long.&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%2Fu7wh9n1jgfzy5ywb293y.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%2Fu7wh9n1jgfzy5ywb293y.png" alt="terraform-apply" width="800" height="1216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;All resources that are generated are available &lt;a href="https://github.com/Navapon/console-to-code?tab=readme-ov-file" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Things to Know and Consider&lt;br&gt;
Here are a few things you should consider while using AWS Console-to-Code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Anyone can use AWS Console-to-Code to generate AWS CLI commands for their infrastructure workflows. The code generation feature for AWS CDK and CloudFormation formats has a free quota of 25 generations per month, after which you will need an Amazon Q Developer subscription.&lt;/li&gt;
&lt;li&gt;You should test and verify the generated IaC code code before deployment.&lt;/li&gt;
&lt;li&gt;At GA, AWS Console-to-Code only records actions in Amazon EC2, Amazon VPC, and Amazon RDS consoles.
The Recorded actions table in AWS Console-to-Code only displays actions taken during the current session within the specific browser tab. It does not retain actions from previous sessions or other tabs. Note that refreshing the browser tab will result in losing all recorded actions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;As you can see, the embedded service of &lt;code&gt;console-to-code&lt;/code&gt; helps us quickly get an idea and convert it to code for what you are good at. Even if it does not copy and paste 100%, there is much stuff that can help us reduce time and crafting based on the result generated to ensure it is ready for production grade and can work with your organization. Unfortunately, this thing is relatively new and only supports a few services. Let's see what AWS will implement in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reference
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/aws/convert-aws-console-actions-to-reusable-code-with-aws-console-to-code-now-generally-available/" rel="noopener noreferrer"&gt;AWS BlogPost&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>terraform</category>
    </item>
    <item>
      <title>Crafting a Custom SAM Template for Your AWS Lambda Function, Resource, and Operations</title>
      <dc:creator>Navapon</dc:creator>
      <pubDate>Tue, 10 Dec 2024 10:49:11 +0000</pubDate>
      <link>https://dev.to/navapon/crafting-a-custom-sam-template-for-your-aws-lambda-function-resource-and-operations-58md</link>
      <guid>https://dev.to/navapon/crafting-a-custom-sam-template-for-your-aws-lambda-function-resource-and-operations-58md</guid>
      <description>&lt;p&gt;Nowadays, Serverless is widely adopted. The AWS Lambda Helps your organization focus on just the &lt;code&gt;Code&lt;/code&gt; that needs to be done for business purposes.&lt;/p&gt;

&lt;p&gt;Boost up development speed and do not need to handle infrastructure and operations. &lt;/p&gt;

&lt;p&gt;On the first days of the development process, we might do it via &lt;code&gt;console,&lt;/code&gt; write your code, and trigger; oh, that's working, and my job is done.&lt;/p&gt;

&lt;p&gt;But as time passed, the System got more and more &lt;code&gt;complex&lt;/code&gt; to many resources, and there are many stuff to be concerned about like code quality, Deployment Operation, Security, and Dependency of your code. There is a variety of tools that help you develop and deploy lambda to AWS, like &lt;a href="https://www.serverless.com/framework/docs" rel="noopener noreferrer"&gt;serverless framework&lt;/a&gt; and &lt;a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function.html" rel="noopener noreferrer"&gt;terraform&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Today, I would like to introduce and recommend &lt;code&gt;AWS SAM&lt;/code&gt; to help you customize your organization lambda and resources standard embedded with &lt;code&gt;CICD.&lt;/code&gt; These valuable tools help you standardize.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS SAM
&lt;/h2&gt;

&lt;p&gt;AWS SAM is the native tools that help manage and handle serverless components and resources with &lt;a href="https://github.com/aws/aws-sam-cli-app-templates" rel="noopener noreferrer"&gt;predefined template&lt;/a&gt; powered by &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-overview.html" rel="noopener noreferrer"&gt;Cloudformation&lt;/a&gt; and &lt;a href="https://github.com/cookiecutter/cookiecutter" rel="noopener noreferrer"&gt;cookiecutter&lt;/a&gt; that allow you to quickstart project with templates base on different use-case Before going to craft with custom template on your own I will show you how to get start working with aws predefined template first&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requisites before getting start
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;aws-sam-cli
sam init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After using the init command, the prompt will respond by pressing &lt;code&gt;1&lt;/code&gt;. All templates will be displayed. You can select a suitable one by following the prompt instructions.&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%2F56orquq31mpemodjggg9.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%2F56orquq31mpemodjggg9.png" alt="sam-init" width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Crafting Custom SAM Template
&lt;/h2&gt;

&lt;p&gt;I would not like to explain how Sam works, just focusing on creating a custom template and working with &lt;code&gt;sam-cli.&lt;/code&gt; Feel free to learn more about &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html" rel="noopener noreferrer"&gt;SAM here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright, let's get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  Template Structure
&lt;/h3&gt;

&lt;p&gt;The Template structure itself looks like the one below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;├── LICENSE
├── README.md
├── cookiecutter.json
├── template1
|  ├── cookiecutter.json
|  ├── hooks
|  |  ├── post_gen_project.py
|  |  └── pre_gen_project.py
|  └── &lt;span class="o"&gt;{{&lt;/span&gt;cookiecutter.project_slug&lt;span class="o"&gt;}}&lt;/span&gt;
|     ├── src
|     └── template-local.yaml
└── template2
   ├── cookiecutter.json
   ├── hooks
   |  ├── post_gen_project.py
   |  └── pre_gen_project.py
   └── &lt;span class="o"&gt;{{&lt;/span&gt;cookiecutter.project_slug&lt;span class="o"&gt;}}&lt;/span&gt;
      ├── src
      └── template-local.yaml

directory: 8 file: 11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;cookiecutter.json at the top level&lt;/code&gt; will prompt the user to choose a template with the following configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"template"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Lambda Stand Alone (./template1)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Lambda with Scheduler (./template2"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;cookiecuuter.json at the second level&lt;/code&gt; will configure the prompt the user needs to follow and enter the appropriate value based on what you need to input.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"project_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Git Repository Name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"project_slug"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{ cookiecutter.project_name.lower().replace(' ', '_').replace('_','-') }}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"run_time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"nodejs22.x"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"python3.13"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"java21"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"go1.x"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"project"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"project1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"project2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"project3"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"project_description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Tell more about Project Description"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ownership_team"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"teamA"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"teamB"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"teamC"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"squad"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"squadA"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"squadB"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"squadC"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ownership_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"github_user"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"__prompts__"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"project_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Type your Github Repository Project Name."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"project_slug"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Auto converting name convention to be is that ok ?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"run_time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Lambda Runtime Language."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"project"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This Lambda is part of which project."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"project_description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"What is the primary purpose of this service."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ownership_team"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Select Projects Belong to which team."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ownership_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Name Please."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"squad"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This project belongs to which Squad."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"github_user"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your GitHub username see at github.com/yourprofilename"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above variables can be accessed by using &lt;code&gt;{{ cookiecutter.variables_name }}&lt;/code&gt; like &lt;code&gt;{{ cookiecutter.project_slug }}&lt;/code&gt; for get dynamic inputs from user to the templates&lt;/p&gt;

&lt;h3&gt;
  
  
  Template example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;AWSTemplateFormatVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2010-09-09"&lt;/span&gt;
&lt;span class="na"&gt;Transform&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Serverless-2016-10-31&lt;/span&gt;
&lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="s"&gt;Lambda {{ cookiecutter.project_slug }} Sandbox/SIT Environment stack belong to {{ cookiecutter.ownership_team }} Team own by {{ cookiecutter.ownership_name }}&lt;/span&gt;

&lt;span class="na"&gt;Parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;FunctionName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;cookiecutter.project_slug}}"&lt;/span&gt;
    &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;FunctionName inject params name conventions {repository-name}-{env} from workflows&lt;/span&gt;
  &lt;span class="na"&gt;FunctionDescription&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="s"&gt;{{ cookiecutter.project_description }}&lt;/span&gt;
      &lt;span class="s"&gt;This service created by team {{ cookiecutter.ownership_team }} [{{ cookiecutter.ownership_name }}]&lt;/span&gt;
    &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Function Description Show at lambda&lt;/span&gt;
  &lt;span class="na"&gt;Project&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;cookiecutter.project&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;Team&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;cookiecutter.ownership_team&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sandbox"&lt;/span&gt;
  &lt;span class="na"&gt;OwnershipName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;cookiecutter.ownership_name&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
  &lt;span class="na"&gt;DataClassification&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;confidential"&lt;/span&gt;
  &lt;span class="na"&gt;Squad&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;cookiecutter.squad&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;

&lt;span class="na"&gt;Globals&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Function&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15&lt;/span&gt;
    &lt;span class="na"&gt;Tracing&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Active&lt;/span&gt;
  &lt;span class="na"&gt;Api&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;TracingEnabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Function&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Serverless::Function&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;FunctionName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;FunctionName&lt;/span&gt;
      &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;FunctionDescription&lt;/span&gt;
      &lt;span class="na"&gt;CodeUri&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./src&lt;/span&gt;
      &lt;span class="na"&gt;Handler&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app.lambdaHandler&lt;/span&gt;
      &lt;span class="na"&gt;PackageType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Zip&lt;/span&gt;
      &lt;span class="na"&gt;Runtime&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;cookiecutter.run_time&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
      &lt;span class="na"&gt;MemorySize&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;256&lt;/span&gt;
      &lt;span class="na"&gt;Timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15&lt;/span&gt;
      &lt;span class="na"&gt;Architectures&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;arm64"&lt;/span&gt;
      &lt;span class="na"&gt;Role&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;arn:aws:iam::{{ cookiecutter.aws_account_id }}:role/lambda-role/{{ cookiecutter.project_slug }}-role&lt;/span&gt;
      &lt;span class="c1"&gt;# Also AWS Parameter and Secrets help you handle secrets value example here&lt;/span&gt;
      &lt;span class="c1"&gt;# https://aws.amazon.com/blogs/compute/using-the-aws-parameter-and-secrets-lambda-extension-to-cache-parameters-and-secrets/&lt;/span&gt;
      &lt;span class="na"&gt;Layers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension-Arm64:20"&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;arn:aws:lambda:${AWS::Region}:044395824272:layer:AWS-Parameters-and-Secrets-Lambda-Extension-Arm64:12"&lt;/span&gt;
      &lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;Variables&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;ENV_NAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ENV_VALUE"&lt;/span&gt;
      &lt;span class="na"&gt;Tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;FunctionName&lt;/span&gt;
        &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;FunctionDescription&lt;/span&gt;
        &lt;span class="na"&gt;Project&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;Project&lt;/span&gt;
        &lt;span class="na"&gt;Team&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;Team&lt;/span&gt;
        &lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;Environment&lt;/span&gt;
        &lt;span class="na"&gt;OwnershipName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;OwnershipName&lt;/span&gt;
        &lt;span class="na"&gt;DataClassification&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;DataClassification&lt;/span&gt;
        &lt;span class="na"&gt;Squad&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;Squad&lt;/span&gt;
      &lt;span class="c1"&gt;# VpcConfig:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above is a SAM template to configure binding value with cookiecutter. You can add more resources like &lt;code&gt;eventbridge-scheduler&lt;/code&gt;,&lt;code&gt;api-gateway&lt;/code&gt; and &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-eventsource.html" rel="noopener noreferrer"&gt;more&lt;/a&gt;  and customize the configuration that matches your purpose of the template&lt;/p&gt;

&lt;p&gt;More than that, the &lt;code&gt;cookiescutter&lt;/code&gt; template itself is supported by the hooks events. You can code with Python and manage whatever you need via hooks. Look more &lt;a href="https://cookiecutter.readthedocs.io/en/stable/advanced/hooks.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I have create the simple template feel free to look at it &lt;a href="https://github.com/Navapon/custom-sam-template" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  How to work with your crafted template
&lt;/h3&gt;

&lt;p&gt;It is very easy to access the custom template by following the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sam init &lt;span class="nt"&gt;-l&lt;/span&gt; your-folder &lt;span class="c"&gt;# Template location (git, mercurial, http(s), zip, path).&lt;/span&gt;
sam init &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="c"&gt;# for look more option&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;

sam init &lt;span class="nt"&gt;-l&lt;/span&gt; git@github.com:Navapon/custom-sam-template.git

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

&lt;/div&gt;



&lt;p&gt;The results Is below.&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%2Fhig7rnmoxywj7pnnnr7m.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%2Fhig7rnmoxywj7pnnnr7m.png" alt="sam-init" width="800" height="85"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Just give you an idea of how to implement a template for serverless in your organization; you can create multiple cases and embed the practice of your organization to the template like &lt;a href="https://pre-commit.com/" rel="noopener noreferrer"&gt;pre-commit&lt;/a&gt;, &lt;code&gt;cicd&lt;/code&gt;, &lt;a href="https://aws.amazon.com/blogs/compute/using-the-aws-parameter-and-secrets-lambda-extension-to-cache-parameters-and-secrets/" rel="noopener noreferrer"&gt;lambda-layer-secret&lt;/a&gt;, &lt;a href="https://github.com/aws-powertools/powertools-lambda-python" rel="noopener noreferrer"&gt;lambda-layer-powertools&lt;/a&gt; and more&lt;/p&gt;

&lt;p&gt;I hope this Blog will help you create your custom template to help the team focus on the code and get all the good practices that your organization followed the same standardization.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>lambda</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
