<?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: Andrii Melashchenko</title>
    <description>The latest articles on DEV Community by Andrii Melashchenko (@javatask).</description>
    <link>https://dev.to/javatask</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%2F51049%2Fba2b6928-878e-42a7-8abc-d634fc1674d6.jpg</url>
      <title>DEV Community: Andrii Melashchenko</title>
      <link>https://dev.to/javatask</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/javatask"/>
    <language>en</language>
    <item>
      <title>GEO Score: A Free Scanner for AI Agent Discoverability</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Wed, 18 Mar 2026 01:00:00 +0000</pubDate>
      <link>https://dev.to/aws-builders/geo-score-a-free-scanner-for-ai-agent-discoverability-36k5</link>
      <guid>https://dev.to/aws-builders/geo-score-a-free-scanner-for-ai-agent-discoverability-36k5</guid>
      <description>&lt;p&gt;Over the last few weeks, I’ve been deep in the weeds of ‘Building AI-Accessible Infrastructure.’ It’s a fascinating architectural challenge: how do we shift from optimizing for eyeballs to optimizing for context-hungry agents?&lt;/p&gt;

&lt;p&gt;As I was documenting the various layers of AI-accessible infrastructure — from llms.txt files to Model Context Protocol (MCP) endpoints — I kept hitting the same wall: I wished there was a quick, automated way to check all these signals at once. Not just ‘does this file exist,’ but ‘is it implemented in a way that an LLM agent can actually consume it?’&lt;/p&gt;

&lt;p&gt;So, I built one.&lt;/p&gt;

&lt;p&gt;Today, I’m launching &lt;strong&gt;GEO Score&lt;/strong&gt; (Generative Engine Optimization Score), a free, no-login scanner at &lt;a href="https://javatask.dev/geo/" rel="noopener noreferrer"&gt;javatask.dev/geo/&lt;/a&gt; that audits your site for AI readiness across 13 base technical signals — plus up to 3 bonus checks that can push your score above 100%.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Scoring Works
&lt;/h2&gt;

&lt;p&gt;GEO Score uses a fixed base denominator — the sum of all base check weights — so your baseline score reflects how well you’ve covered the fundamentals. Bonus checks add points on top of that denominator. Failing a bonus check never hurts your score; passing one rewards you.&lt;/p&gt;

&lt;p&gt;Inspired by Mozilla Observatory’s approach, GEO Score now allows sites to exceed 100%. The grade scale mirrors what you’d expect, with one addition:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Grade&lt;/th&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A+&lt;/td&gt;
&lt;td&gt;≥ 100%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;≥ 90%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;≥ 75%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;≥ 60%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;≥ 40%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F&lt;/td&gt;
&lt;td&gt;&amp;lt; 40%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&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%2F8shf5rvadt8tnwk033ay.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%2F8shf5rvadt8tnwk033ay.png" alt="GEO Score grading system — color-coded horizontal bar from F (red, 0–39%) through D, C, B, A to A+ (dark green, ≥100%), with threshold marks at 40%, 60%, 75%, 90%, 100% and javatask.dev pinned in the A+ zone" width="800" height="422"&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%2F7f23zx4ankiljuhcq7es.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%2F7f23zx4ankiljuhcq7es.png" alt="GEO Score scoring architecture — Base Layer (102 pts total: Discovery 48 pts + HTML 54 pts) plus Bonus Layer (+20 pts max: JSON-LD Richness +7, Training Bot Opt-out +5, Markdown Mirror +8), formula: (base_earned + bonus_earned) / 102 × 100%, capped at 125%" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What GEO Score Measures
&lt;/h2&gt;

&lt;p&gt;The scanner focuses on the ’technical plumbing’ required for an AI agent to discover, parse, and trust your content. It breaks these into three distinct layers, each representing a different stage of the agent-to-site interaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Discovery Layer (Head Checks)
&lt;/h3&gt;

&lt;p&gt;Before an agent can read your content, it needs to know where it lives — so the scanner performs rapid HEAD requests to verify the existence of these roadmap files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;llms.txt (15 pts)&lt;/strong&gt;: The emerging standard for LLM-friendly documentation. It provides a human-readable and machine-parsable entry point for agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;llms-full.txt (5 pts)&lt;/strong&gt;: The expanded version for comprehensive context, often containing the full text of documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sitemap.xml (10 pts)&lt;/strong&gt;: While built for search engines, modern AI agents use sitemaps to build their initial crawl frontier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;robots.txt AI Policy (8 pts)&lt;/strong&gt;: The base check tests whether 7 AI discovery agents are explicitly allowed (or at least not blocked): &lt;code&gt;OAI-SearchBot&lt;/code&gt;, &lt;code&gt;ChatGPT-User&lt;/code&gt;, &lt;code&gt;PerplexityBot&lt;/code&gt;, &lt;code&gt;Claude-SearchBot&lt;/code&gt;, &lt;code&gt;Claude-User&lt;/code&gt;, &lt;code&gt;Gemini-Deep-Research&lt;/code&gt;, &lt;code&gt;YouBot&lt;/code&gt;. These are the bots that power AI search citations and deep research across Perplexity, ChatGPT research mode, Gemini Deep Research, and Claude — blocking any of them quietly cuts you out of the AI discovery layer. Blocking &lt;em&gt;training&lt;/em&gt; bots like GPTBot or Google-Extended is a separate concern handled in the bonus layer — more on that distinction below.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The HTML Layer (Homepage Parse)
&lt;/h3&gt;

&lt;p&gt;Once your content is found, the next question is: can an agent extract semantic meaning and metadata from your raw HTML without relying on fragile scrapers?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JSON-LD Schema (15 pts)&lt;/strong&gt;: We specifically look for Article or TechArticle schema. Structured data is the highest-signal way to tell an agent what your content is actually about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Meta Description (8 pts)&lt;/strong&gt;: We look for 50–160 characters of clean context. If it’s too short, it’s useless; too long, and it gets truncated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Meta Author (5 pts)&lt;/strong&gt;: Essential for attribution. Agents need to know who wrote the content to weigh its authority.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Canonical Link (8 pts)&lt;/strong&gt;: Prevents duplicate-content confusion by telling the agent which URL is the source of truth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenGraph (OG) Tags (10 pts)&lt;/strong&gt;: Standardized titles, descriptions, and URLs that provide a fallback for agents when custom schema is missing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance (5 pts)&lt;/strong&gt;: TTFB (Time to First Byte) &amp;lt; 800ms. Agents have time budgets too; slow sites get skipped or deprioritized in real-time search.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payload Size (3 pts)&lt;/strong&gt;: Page size &amp;lt; 500 KB. Large payloads are expensive for LLMs to tokenize and process.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. The MCP Layer (Conditional)
&lt;/h3&gt;

&lt;p&gt;This is the next-generation approach to site-agent interaction, moving beyond static files to interactive capabilities.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;.well-known/mcp.json (10 pts)&lt;/strong&gt;: The discovery endpoint for Model Context Protocol servers. The base check (10 pts) verifies that &lt;code&gt;/.well-known/mcp.json&lt;/code&gt; exists and returns valid JSON. If the manifest contains a valid MCP endpoint URL, the scanner runs a conditional live probe: it POSTs an MCP &lt;code&gt;initialize&lt;/code&gt; request to the declared endpoint to verify the server is actually running. The probe result is reported separately as informational — it does not add or deduct points, but it tells you immediately if your MCP endpoint is down.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bonus Checks: Scoring Beyond 100%
&lt;/h3&gt;

&lt;p&gt;These three checks sit outside the base denominator. Passing them adds to your numerator; failing them changes nothing. The total is capped at 125%.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Bonus&lt;/th&gt;
&lt;th&gt;Passes when&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;JSON-LD Richness&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+7 pts&lt;/td&gt;
&lt;td&gt;Your JSON-LD includes author, datePublished, and description fields&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Training Bot Opt-out&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+5 pts&lt;/td&gt;
&lt;td&gt;GPTBot and/or Google-Extended are blocked in your robots.txt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Markdown Mirror&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+8 pts&lt;/td&gt;
&lt;td&gt;/index.md (or /&amp;lt;!-- raw HTML omitted --&amp;gt;/index.md) returns HTTP 200 with a plain-text or Markdown content type&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Security Headers (base, 12 pts) and Strict Security Headers (bonus, +8 pts) were removed in March 2026. These checks duplicate what &lt;a href="https://observatory.mozilla.org/" rel="noopener noreferrer"&gt;Mozilla Observatory&lt;/a&gt; already validates in depth. GEO Score stays focused on AI-agent discoverability signals.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A note on Markdown Mirror: it was originally a base check that penalized failure. It has since been promoted to a bonus — you’re rewarded for providing a clean Markdown version of your content, but not penalized if your CDN doesn’t serve .md files. The pass condition has also been relaxed to accept text/plain, since most CDNs don’t send text/markdown by default.&lt;/p&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  ⚠️ &lt;strong&gt;Important: What GEO Score is NOT&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Before we look at some results, let’s be clear about scope. GEO Score measures &lt;strong&gt;technical implementation signals only.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A site like &lt;strong&gt;mozilla.org&lt;/strong&gt; or &lt;strong&gt;wikipedia.org&lt;/strong&gt; might score low on this tool because they haven’t implemented llms.txt yet — but they are still heavily cited by AI because of their massive domain authority and content quality.&lt;/li&gt;
&lt;li&gt;The tool &lt;strong&gt;does not&lt;/strong&gt; measure domain authority, backlink profile, content quality, or citation history.&lt;/li&gt;
&lt;li&gt;It does not read your content to see if it’s ‘good.’ It only checks whether the delivery mechanism is ‘correct.’&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it this way: GEO Score tells you, &lt;strong&gt;‘Have you implemented the plumbing?’&lt;/strong&gt; It does &lt;strong&gt;not&lt;/strong&gt; guarantee, &lt;strong&gt;‘Will AI cite you?’&lt;/strong&gt; Technical signals are necessary for long-term discoverability, but they aren’t a replacement for quality writing.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Three-Tier Bot Taxonomy: Why Blanket Blocking Is a Mistake
&lt;/h2&gt;

&lt;p&gt;When I first built the robots.txt check, I treated any bot blocking as a negative — you lose reach, so you lose points. That was wrong. The current scanner reflects a more sophisticated three-tier taxonomy underpinned by research into how modern AI crawlers work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tier 1 — Training crawlers (block these):&lt;/strong&gt; &lt;code&gt;GPTBot&lt;/code&gt; (OpenAI pre-training), &lt;code&gt;ClaudeBot&lt;/code&gt; (Anthropic pre-training), &lt;code&gt;Google-Extended&lt;/code&gt; (Gemini model training and Vertex AI grounding), &lt;code&gt;CCBot&lt;/code&gt; (Common Crawl — feeds Llama, GPT, and many others). These bots ingest your content into model weights without referring traffic back. Blocking them is legitimate IP protection and has &lt;em&gt;no effect&lt;/em&gt; on inference-time discoverability — agents don’t need to have trained on your content to cite it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tier 2 — AI search indexers (allow these):&lt;/strong&gt; &lt;code&gt;OAI-SearchBot&lt;/code&gt; (ChatGPT search results), &lt;code&gt;Claude-SearchBot&lt;/code&gt; (Claude’s search index). These crawlers build real-time indices for conversational search interfaces. Being indexed by them is the AI equivalent of Google crawling your site.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tier 3 — Deep research agents (allow these):&lt;/strong&gt; &lt;code&gt;ChatGPT-User&lt;/code&gt; (ChatGPT Deep Research mode), &lt;code&gt;Claude-User&lt;/code&gt; (Claude real-time query fetcher), &lt;code&gt;Gemini-Deep-Research&lt;/code&gt; (Google’s autonomous research agent), &lt;code&gt;PerplexityBot&lt;/code&gt; (Perplexity AI search), &lt;code&gt;YouBot&lt;/code&gt; (You.com AI search). These agents act on behalf of a specific user to complete a multi-step research task. Blocking them means a user asking Gemini or ChatGPT to research your topic won’t find you — even if you’re a top result in the underlying search.&lt;/p&gt;

&lt;p&gt;The base check validates that all seven discovery/research agents (Tier 2 and Tier 3) are not blocked. Blocking training scrapers (Tier 1) while allowing discovery bots is now a separate &lt;strong&gt;bonus check (+5 pts)&lt;/strong&gt;. The original scanner penalized this configuration. It shouldn’t have.&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%2Fcsf3eqceooeor9w8lk4k.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%2Fcsf3eqceooeor9w8lk4k.png" alt="Three-Tier Bot Taxonomy — Tier 1 Training Crawlers (block): GPTBot, ClaudeBot, Google-Extended, CCBot; Tier 2 AI Search Indexers (allow): OAI-SearchBot, Claude-SearchBot; Tier 3 Deep Research Agents (allow): ChatGPT-User, Claude-User, Gemini-Deep-Research, PerplexityBot, YouBot" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the robots.txt configuration that satisfies the base check and earns the training-bot opt-out bonus:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="c"&gt;# Block training crawlers (protect your IP)
&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;GPTBot&lt;/span&gt;
&lt;span class="n"&gt;Disallow&lt;/span&gt;: /

&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;ClaudeBot&lt;/span&gt;
&lt;span class="n"&gt;Disallow&lt;/span&gt;: /

&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;Google&lt;/span&gt;-&lt;span class="n"&gt;Extended&lt;/span&gt;
&lt;span class="n"&gt;Disallow&lt;/span&gt;: /

&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;CCBot&lt;/span&gt;
&lt;span class="n"&gt;Disallow&lt;/span&gt;: /

&lt;span class="c"&gt;# Allow AI search indexers (Tier 2)
&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;OAI&lt;/span&gt;-&lt;span class="n"&gt;SearchBot&lt;/span&gt;
&lt;span class="n"&gt;Allow&lt;/span&gt;: /

&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;Claude&lt;/span&gt;-&lt;span class="n"&gt;SearchBot&lt;/span&gt;
&lt;span class="n"&gt;Allow&lt;/span&gt;: /

&lt;span class="c"&gt;# Allow deep research agents (Tier 3)
&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;ChatGPT&lt;/span&gt;-&lt;span class="n"&gt;User&lt;/span&gt;
&lt;span class="n"&gt;Allow&lt;/span&gt;: /

&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;Claude&lt;/span&gt;-&lt;span class="n"&gt;User&lt;/span&gt;
&lt;span class="n"&gt;Allow&lt;/span&gt;: /

&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;Gemini&lt;/span&gt;-&lt;span class="n"&gt;Deep&lt;/span&gt;-&lt;span class="n"&gt;Research&lt;/span&gt;
&lt;span class="n"&gt;Allow&lt;/span&gt;: /

&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;PerplexityBot&lt;/span&gt;
&lt;span class="n"&gt;Allow&lt;/span&gt;: /

&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: &lt;span class="n"&gt;YouBot&lt;/span&gt;
&lt;span class="n"&gt;Allow&lt;/span&gt;: /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Dogfooding: Scanning javatask.dev
&lt;/h2&gt;

&lt;p&gt;Of course, the first thing I did after finishing the scanner was point it at my own site. I was confident I’d see a straight ‘A.’&lt;/p&gt;

&lt;p&gt;After the upgrade, javatask.dev scores &lt;strong&gt;A+ (117.9%, bonus: +20.0 pts)&lt;/strong&gt;. Here’s what changed, including one check where my original thinking was backwards.&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%2F4fhycxzm5c7u6hm22lph.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%2F4fhycxzm5c7u6hm22lph.png" alt="Dogfooding javatask.dev — before: ~65% Grade B; after: 117.9% Grade A+ with three bonus segments: +7 pts JSON-LD Richness, +5 pts Training Bot Opt-out, +8 pts Markdown Mirror, all pushing past the 100% A+ threshold" width="800" height="354"&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%2F204hfv270ym3dzv1emxr.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%2F204hfv270ym3dzv1emxr.png" alt="GEO Score scan result for javatask.dev — A+ grade, 117.9%, Bonus Points +20.0, all base checks passing and all three bonus checks passing: JSON-LD Richness +7, Training Bot Opt-out +5, Markdown Mirror +8" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;llms.txt / llms-full.txt&lt;/strong&gt; : &lt;strong&gt;Pass&lt;/strong&gt; (20 pts) — My Hugo setup generates these automatically as part of the build process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sitemap / mcp.json&lt;/strong&gt; : &lt;strong&gt;Pass&lt;/strong&gt; (20 pts).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;robots.txt&lt;/strong&gt; : &lt;strong&gt;Pass&lt;/strong&gt; (8 pts) — I block GPTBot, ClaudeBot, Google-Extended, and CCBot to protect content from training ingestion. Under the 3-tier taxonomy, all 7 AI discovery and research agents (OAI-SearchBot, ChatGPT-User, PerplexityBot, Claude-SearchBot, Claude-User, Gemini-Deep-Research, YouBot) are allowed, so the base check passes. Blocking training crawlers also earns the &lt;strong&gt;Training Bot Opt-out&lt;/strong&gt; bonus (+5 pts). What was once treated as a penalty is now correctly recognized as a reward.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;meta_author&lt;/strong&gt; : &lt;strong&gt;Fail&lt;/strong&gt; → &lt;strong&gt;Pass&lt;/strong&gt; (0 pts → 5 pts) — I was shocked to find that while I had og:author in my OpenGraph tags, I was missing the standard &lt;code&gt;meta name="author"&lt;/code&gt; tag. This is a classic example of ‘shadow metadata’ — information that humans see (via the site UI) but machines miss. I fixed this immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JSON-LD&lt;/strong&gt; : &lt;strong&gt;Warn&lt;/strong&gt; → &lt;strong&gt;Pass&lt;/strong&gt; — When scanning the homepage, the tool found WebSite and Person schema, but not Article. I’ve since ensured individual post pages carry full TechArticle schema — which also satisfies the &lt;strong&gt;JSON-LD Richness&lt;/strong&gt; bonus check (requiring author, datePublished, and description fields).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After addressing those gaps, all three bonus checks pass.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Note on Scanning Homepages vs. Posts
&lt;/h3&gt;

&lt;p&gt;One key insight from dogfooding: some &lt;strong&gt;Fail&lt;/strong&gt; or &lt;strong&gt;Warn&lt;/strong&gt; results are expected when you scan a site’s root domain rather than a specific article.&lt;/p&gt;

&lt;p&gt;The scanner checks the specific URL you provide. If you scan javatask.dev/, the tool won’t find an Article schema because the homepage is a list of summaries, not a single post. Similarly, the Markdown Mirror bonus check is designed for individual post URLs — the homepage intentionally doesn’t serve a /index.md equivalent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip:&lt;/strong&gt; To see your true score, scan a specific blog post URL. That’s where the Article schema and Markdown Mirror bonus check will actually shine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Brief: Rust, Axum, and Lambda
&lt;/h2&gt;

&lt;p&gt;I wanted GEO Score to be fast — like, &lt;em&gt;really&lt;/em&gt; fast. When a user enters a URL, they shouldn’t be staring at a spinner for 10 seconds. I built the backend in &lt;strong&gt;Rust&lt;/strong&gt; using the &lt;strong&gt;Axum&lt;/strong&gt; framework, deployed as an &lt;strong&gt;AWS Lambda&lt;/strong&gt; function.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency&lt;/strong&gt; : The scanner doesn’t run checks sequentially. It uses a three-round parallel orchestrator. Round one handles HEAD requests for discovery files. Round two fetches the main HTML and parses it using the scraper crate. Round three probes any discovered MCP endpoints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt; : The average scan takes ~200ms of actual compute time. The rest is network latency as we wait for the target site to respond. By using Rust on Graviton2 (ARM64) Lambdas, cold starts stay minimal and execution cost stays nearly zero.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt; : Building a tool that fetches arbitrary user-provided URLs is an SSRF (Server-Side Request Forgery) nightmare. The backend includes a robust &lt;code&gt;validator.rs&lt;/code&gt; module that resolves the hostname and rejects private IPv4/IPv6 ranges, loopbacks, and non-HTTPS schemes before a request is ever dispatched.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate Limiting&lt;/strong&gt; : To prevent abuse while keeping the tool login-free, I implemented an in-memory rate limiter that tracks IP addresses, allowing 5 scans per hour. It’s a balance between preventing bot-on-bot violence and keeping the tool accessible.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it Yourself
&lt;/h2&gt;

&lt;p&gt;javatask.dev scores 117.9%. That’s the current benchmark — run the scanner on your own site and see where you land.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javatask.dev/geo/" rel="noopener noreferrer"&gt;Run the GEO Score scanner →&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s completely free, requires no login, and performs no tracking. If you score A+ (100%+), I’d like to know about it — reply to this post or tag me on LinkedIn. I’ll feature the highest-scoring community sites in a follow-up. If you score below 70%, the breakdown will show you exactly what’s missing and why it matters.&lt;/p&gt;

&lt;p&gt;This also applies at the professional level. If you maintain documentation, a developer portal, or a marketing site for a product, your AI readiness score affects whether agents surface your content in their answers — not just whether humans find it in search. The infrastructure layer is the same regardless of whether you’re a solo blogger or an engineering team managing 10,000 pages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What about licensing and intellectual property?&lt;/strong&gt; The scanner focuses on technical discoverability signals. But there’s a related question this tool doesn’t answer: once AI agents &lt;em&gt;can&lt;/em&gt; find and cite your content, what rights do you retain? Can you allow citation but prohibit training? Does a CC-BY-NC-4.0 license cover AI indexing? I’m working on a follow-up article on the legal and technical architecture for embedding IP rights signals in MCP tool responses, HTTP headers, and structured data — so your content stays citable without becoming training fodder. Stay tuned for Part 9 in the series.&lt;/p&gt;

&lt;p&gt;Happy building, Andrii Melashchenko&lt;/p&gt;

</description>
      <category>geo</category>
      <category>hugo</category>
      <category>aws</category>
      <category>llm</category>
    </item>
    <item>
      <title>Perfect Technology Storm: The Beginning of Software Engineering 3.0</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Fri, 30 May 2025 14:29:32 +0000</pubDate>
      <link>https://dev.to/aws-builders/perfect-technology-storm-the-beginning-of-software-engineering-30-1a6</link>
      <guid>https://dev.to/aws-builders/perfect-technology-storm-the-beginning-of-software-engineering-30-1a6</guid>
      <description>&lt;p&gt;Executive Summary: The Promise of AI is No UI&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Thesis
&lt;/h2&gt;

&lt;p&gt;Naval Ravikant's insight, "The promise of AI is no UI", represents a fundamental shift from traditional user interface design to outcome-driven customer value delivery. This isn't about better chatbotsit's about AI agents directly accomplishing user goals without interface friction, making traditional product development paradigms obsolete.&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%2F9f7qptcv5znmx5hryrq1.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%2F9f7qptcv5znmx5hryrq1.png" width="588" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Critical Business Implications
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;🎯 From "Ease of Use" to Outcomes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Traditional UI/UX metrics are becoming obsolete&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AI eliminates interface friction, enabling direct focus on customer value&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shift to outcome-based pricing models becomes feasible&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🤝 Required Organisational Changes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Product Managers&lt;/strong&gt; : Must understand technical architecture decisions (serverless vs. Kubernetes, API strategy, domain-driven design, etc)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Software Engineers&lt;/strong&gt; : Must deeply understand customer pain points and business outcomes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Both&lt;/strong&gt; : Need to collaborate on AI-simulated customer scenarios and real customer insights&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Senior Leadership&lt;/strong&gt; : Must facilitate tight cooperation between product managers and software engineers&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Core Business Risk&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://insideevs.com/news/666064/vw-cariad-new-ceo/" rel="noopener noreferrer"&gt;The Volkswagen/Cariad example&lt;/a&gt; demonstrates the catastrophic cost of treating software as non-core:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Delayed launches of Porsche Macan and Audi Q6 e-tron&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;System failures across ID.3, ID.4, and ID.5 models&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;6,000-person division requiring complete restructuring&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bottom Line
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;You cannot outsource your core business.&lt;/strong&gt; In a world where AI eliminates UI barriers, competitive advantage comes from understanding customers deeply and building the proper technical foundation. Organisations that fail to bridge the gap between product managers and software engineers, while treating software development as peripheral, risk existential business failure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Action Required&lt;/strong&gt; : Product managers must become technically literate, while software engineers must become customer-obsessed. Senior leadership must facilitate this collaboration. There is no middle ground in the AI-first era.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Transformation is Happening Now
&lt;/h2&gt;

&lt;p&gt;To execute the strategy outlined above, you need to understand the forces that made this shift inevitable. The "no-UI" revolution didn't emerge overnightit's the culmination of four distinct technology waves that developed over two decades. This moment is unique because these previously separate innovations are now converging into a single, transformative force.&lt;/p&gt;

&lt;p&gt;Understanding this convergence is critical because it reveals why traditional approaches to software development are suddenly obsolete, and more importantly, how to build systems that harness this perfect storm.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wave 1: The Data Foundation (The 2000s)
&lt;/h3&gt;

&lt;p&gt;The first wave addressed a fundamental bottleneck: data. Monolithic applications with single, overworked databases couldn't handle the volume and velocity of information that the internet age was creating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Shift&lt;/strong&gt; : We moved from single-server databases to massively parallel processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Technologies&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Distributed Systems&lt;/strong&gt; (Hadoop, Spark): Enabled storage and processing of petabytes across clusters of commodity hardware&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cloud Storage &amp;amp; Lakehouses&lt;/strong&gt; (AWS S3): Decoupled storage from compute, creating vast, affordable data reservoirs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Real-Time Streaming&lt;/strong&gt; (Kafka, Flink): Enabled live data processing, moving from batch analysis to real-time intelligence&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Outcome&lt;/strong&gt; : This wave created the limitless, always-on fuel required for large-scale intelligence. Without it, AI would be starved of the data needed to learn and operate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wave 2: The Application Deconstruction (The 2010s)
&lt;/h3&gt;

&lt;p&gt;With data solved, the bottleneck shifted to application architecture. Giant, monolithic codebases were brittle, slow to update, and impossible to scale efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Shift&lt;/strong&gt; : We broke down monolithic applications into collections of independent, communicating services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Technologies&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Microservices &amp;amp; Domain-Driven Design&lt;/strong&gt; : Organised complex systems into smaller, business-focused services that could be developed independently&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API-First Architecture&lt;/strong&gt; (REST, gRPC): Turned every service capability into a callable, documented action - creating a library of digital building blocks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Containerization &amp;amp; Orchestration&lt;/strong&gt; (Containerd, Kubernetes): Made services portable, scalable, and manageable across any infrastructure&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Outcome&lt;/strong&gt; : This wave provided the action toolkit. It created the granular, API-accessible functions (&lt;em&gt;bookFlight&lt;/em&gt;, &lt;em&gt;queryInventory&lt;/em&gt;, &lt;em&gt;sendInvoice&lt;/em&gt;) that AI agents need to execute complex tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wave 3: The Intelligence Explosion (Late 2010s - Present)
&lt;/h3&gt;

&lt;p&gt;With access to vast data (Wave 1) and a toolkit of actions (Wave 2), the final ingredient was a "brain" capable of understanding and reasoning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Shift&lt;/strong&gt; : Machine learning evolved from an academic discipline to an accessible cloud service, culminating in generative AI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Technologies&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ML Frameworks &amp;amp; Platforms&lt;/strong&gt; (TensorFlow, PyTorch, SageMaker): Standardised tools for building and deploying models at scale&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Large Language Models&lt;/strong&gt; (AWS Bedrock, Google Gemini, Anthropic Claude): Created a paradigm shift from predictive AI to generative AI that understands intent and creates novel outputs&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Outcome&lt;/strong&gt; : This wave delivered the &lt;a href="https://www.linkedin.com/posts/world-economic-forum_ai-manufacturing-aiagents-ugcPost-7332405176164638720-luwe?utm_source=share&amp;amp;utm_medium=member_desktop&amp;amp;rcm=ACoAAANdvWwBpsHxsl_fuNLZQ-P7qAjRKJtKO2I" rel="noopener noreferrer"&gt;intelligent orchestrator&lt;/a&gt;a "brain" that can understand user goals expressed in natural language, formulate plans, and identify necessary actions to achieve them.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Convergence: Where the Storm Hits Land
&lt;/h3&gt;

&lt;p&gt;Today, these three waves have merged. The fourth wave is this convergence itself, enabling autonomous action:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An AI Agent (Wave 3) can now understand a user's complex goal, access real-time data (Wave 1) for context, and execute task sequences using flexible APIs (Wave 2) to achieve desired outcomesall without human intervention through a graphical interface.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This convergence requires new ways to build trust between AI agents and humans. &lt;strong&gt;One approach is&lt;/strong&gt; for AI agents to share the data and complete reasoning chains behind their recommendations, making their decision-making transparent and verifiable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : UIs won't disappear entirelythey'll evolve into expert debugging tools for AI agent behavior. Just as debuggers help programmers troubleshoot code, UIs will become specialized interfaces for power users to inspect and optimize AI agent performance. End customers will rarely need them, but experts will rely on them for system maintenance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the perfect storm. The challenge is that universities and traditional training teach these waves in isolation. A data engineer learns Wave 1, a backend developer learns Wave 2, and an ML scientist learns Wave 3. However, the future belongs to teams that can synthesise all three into a cohesive strategy, building systems where AI agents deliver value directly.&lt;/p&gt;

&lt;p&gt;Those still focused on optimising UIs are polishing deck chairs while the storm has passed them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Compression Effect
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Traditional Development:&lt;/strong&gt; 2-3 years (6-12 months market research + 6-9 months UX design + 12-24 months frontend development)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI-First Development:&lt;/strong&gt; 1-2 months (2-3 weeks outcome mapping + 2-3 weeks AI agent design + 2-3 weeks API-driven development)&lt;/p&gt;

&lt;p&gt;While competitors perfect interfaces, no-UI teams iterate on customer outcomes at lightning speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation Guide
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Product Managers:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Master technical architecture decisions as strategic business choices&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Map technology value chain components quarterly using frameworks like Wardley Maps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replace UI/UX metrics with customer outcome indicators&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Software Engineers:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Understand customer pain points and success metrics deeply&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build API-accessible, outcome-focused systems for AI agent operation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Design for component evolution, not static features&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Senior Leadership:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create structures ensuring daily product-engineering collaboration on customer outcomes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Team Dynamics:&lt;/strong&gt; Trust technical/business decisions Debate architecture based on outcomes Commit to no-UI strategies Deliver customer outcomes Measure business impact&lt;/p&gt;

&lt;h2&gt;
  
  
  The New Business Reality
&lt;/h2&gt;

&lt;p&gt;The convergence enables fundamental business model shifts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From ease-of-use to effectiveness&lt;/strong&gt; : Customer success over user experience&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From interface design to outcome architecture&lt;/strong&gt; : Build results, not screens&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From subscription features to outcome pricing&lt;/strong&gt; : Charge for results achieved&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From user training to AI intelligence&lt;/strong&gt; : Customers describe goals; AI executes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion: Master the Storm or Be Swept Away
&lt;/h2&gt;

&lt;p&gt;The perfect technology storm isn't comingit's here. Teams mastering this convergence dominate markets by delivering direct customer value while competitors optimise obsolete interfaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strategic Checklist:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Map components using value chain analysis to align product managers and software engineers. I'm a big fan of Wardley Maps for commoditising non-core elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build an AI-first architecture for agent operation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Measure customer outcomes, not interface metrics&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Establish daily product-engineering collaboration&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Volkswagen example shows the existential risk of treating software as peripheral. In the no-UI era, software architecture decisions directly determine business outcomes. Organisations failing to bridge the product-engineering gap risk complete market irrelevance.&lt;/p&gt;

&lt;p&gt;Master the storm now, or watch competitors deliver your customers' outcomes faster and without interface friction.&lt;/p&gt;

&lt;p&gt;Welcome to Software Engineering 3.0.&lt;/p&gt;

</description>
      <category>generativeai</category>
      <category>softwareengineering</category>
      <category>leadership</category>
      <category>productmanagement</category>
    </item>
    <item>
      <title>The Dawn of AI Workforce: A 2025 Perspective</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Sat, 28 Dec 2024 08:47:34 +0000</pubDate>
      <link>https://dev.to/aws-builders/the-dawn-of-ai-workforce-a-2025-perspective-19jc</link>
      <guid>https://dev.to/aws-builders/the-dawn-of-ai-workforce-a-2025-perspective-19jc</guid>
      <description>&lt;h1&gt;
  
  
  Intorduction
&lt;/h1&gt;

&lt;p&gt;Recent developments in AI have sparked a significant shift in how businesses view technology investments. Ethan Mollick's observation about the &lt;a href="https://www.linkedin.com/posts/emollick_feels-like-the-dreadnought-moment-for-ai-activity-7274653523869331457-HRX9" rel="noopener noreferrer"&gt;"Dreadnought Moment for AI"&lt;/a&gt; and Matt Garman, the AWS CEO's announcements at re:Invent suggest that executives are now actively planning to develop their AI workforces. This shift makes investment in AI infrastructure more tangible and strategic than ever before.&lt;/p&gt;

&lt;p&gt;However, as discussed in my previous articles &lt;a href="https://dev.to/aws-builders/what-c-level-leaders-need-to-know-about-ai-agents-4jgb"&gt;What C-Level Leaders Need to Know About AI Agents&lt;/a&gt; and &lt;a href="https://dev.to/aws-builders/developing-an-ai-intern-for-c-level-executives-with-aws-bedrock-13ob"&gt;Developing an AI Intern for C-Level Executives with AWS Bedrock&lt;/a&gt;, implementing an AI workforce isn't straightforward. Organizations must build an entire ecosystem encompassing platforms, data infrastructure, APIs, and cybersecurity, all within a compressed timeframe and ready for production use. Is this achievable within a year? With current AWS ecosystem capabilities and best practices, yes. The real challenge lies not in the technology itself but in organizational change management and leadership.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : While Generative AI Agents capable of solving simple to medium-complexity problems may sound like fiction to many, ignoring this technology could prove costly. Organizations that invest in AI-driven productivity improvements may gain a significant competitive advantage in what could be an uneven playing field, influenced by personal beliefs, talent availability, and access to generative AI resources.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Foundation: Clarity in Investment
&lt;/h2&gt;

&lt;p&gt;Over the past two decades, post-dot-com bubble, I've witnessed multiple technology waves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Service-Oriented Architecture (SOA) and Grid Computing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cloud Computing and Big Data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Internet of Things (IoT) and Microservices&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Serverless Architecture and API-First Development&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Metaverse and Web 3.0&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each wave brought promises and varying degrees of impact. Selling these technological shifts, even internally, has always been challenging. However, Generative AI Agents represent something different technology capable of performing tasks 24/7, 365 days a year, on-demand. While I remain sceptical about AI's ability to autonomously solve complex infrastructure issues, early results are promising for simple and medium complex problems that usually occupy 80% of the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Workforce Requirements
&lt;/h2&gt;

&lt;p&gt;AI Agents, like human employees, require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Clear objectives and goals&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access to quality data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Proper guidance and training&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Secure working environments&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This parallel to human workforce management might seem surprising, but it's fundamental to successful AI implementation.&lt;/p&gt;

&lt;p&gt;Another part is the AI Intern development team. You cannot simply say to your experts: Write instructions!. You need someone to become a glue between Human and AI workforces. My professors explained this challenge during a discussion on &lt;a href="https://en.wikipedia.org/wiki/Expert_system" rel="noopener noreferrer"&gt;"Expert Systems"&lt;/a&gt; developed in the 1980s; capturing expert knowledge is incredibly complex"like explaining how you breathe." This complexity necessitates specialized roles to bridge the gap between human expertise and AI capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inference = AI Workforce: The New Building Block
&lt;/h2&gt;

&lt;p&gt;During AWS re:Invent, CEO Matt Garman introduced a crucial new building block: Inference. Since 2006, AWS has operated on three primary pillars: Compute, Storage, and Databases. The addition of Inference represents a fundamental shift in cloud computing architecture.&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%2Fwgj64hcw5pocxzrmurrr.jpeg" 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%2Fwgj64hcw5pocxzrmurrr.jpeg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This new paradigm closes the loop in data processing. Previously, humans served as the primary processors of information, using tools like books (Storage), notes (Databases), and calculators (Compute). Inference now enables AI systems to process vast amounts of data through Retrieval Augmented Generation, AI Agents, and specialized tooling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inference: A Paradigm Shift - The Executive Perspective
&lt;/h2&gt;

&lt;p&gt;To understand the revolutionary impact of AI, let's consider a simple pre-digital scenario: calculating annual revenue. Traditionally, an employee would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Access information from books (Storage)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use a calculator (Compute)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Record results in a notebook (Database)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The human brain is the central processor, limited by individual capacity for learning and processing information.&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%2Fdtbaf7wyp8cx7fpmbyrd.jpeg" 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%2Fdtbaf7wyp8cx7fpmbyrd.jpeg" alt="Traditional Three Building Blocks" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the introduction of Inference as the fourth building block, we've added an AI workforce that fundamentally changes this paradigm. This new "brain" still utilizes the traditional componentsbooks, calculators, and notebooksbut operates without human limitations. While it can't reason like humans, it can continuously process vast amounts of information.&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%2F5pijvr3ha1seab6g33y5.jpeg" 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%2F5pijvr3ha1seab6g33y5.jpeg" alt="Four Building Blocks with Inference" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This represents a groundbreaking shift: organizations now have access to scalable cognitive processing power. However, success still depends on proper guidance and high-quality data infrastructure. The AI workforce doesn't replace human judgment it amplifies our capabilities while requiring thoughtful direction and robust data management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inference: A Paradigm Shift - The Technical Perspective
&lt;/h2&gt;

&lt;p&gt;The technology community is grappling with an interesting question: how does Inference fit into the traditional three-tier architecture that has dominated web development for over two decades?&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%2F7ia5zhe13ha4oqhejl4s.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%2F7ia5zhe13ha4oqhejl4s.png" alt="Traditional Web Architecture" width="800" height="623"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To understand this shift, we need to step back and examine the evolution of Human-Computer Interaction (HCI). Fifty years ago, concepts like the computer mouse were revolutionary. Web technologies represented the pinnacle of HCI development but they were always means to an end, not the end itself.&lt;/p&gt;

&lt;p&gt;Consider this: users don't measure webpage load times or mouse DPI when shopping for holiday gifts, conducting research, or automating tasks. The web interface is a tool, not the objective.&lt;/p&gt;

&lt;p&gt;The AI workforce transforms this paradigm. Instead of humans interacting through web interfaces, we now have AI agents directly consuming APIs. These agents require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Immediate access to accurate information&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Direct integration with backend services&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Elimination of traditional UI overhead&lt;/p&gt;&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%2F0vwm4dm5drttv9trt1kx.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%2F0vwm4dm5drttv9trt1kx.png" alt="Modern Architecture with Inference" width="800" height="623"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This new architecture accelerates value delivery by removing traditional interface barriers while introducing more sophisticated ways of processing and interacting with data. The fourth building blockInference doesn't just add to the existing architecture; it fundamentally reshapes how we think about system design and user interaction.&lt;/p&gt;

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

&lt;p&gt;The year 2025 likely marks a fundamental transformation in how businesses operate, driven by the emergence of Inference as the fourth building block of modern computing architecture. This isn't merely another technology wave it represents a paradigm shift in how organizations process information and deliver value.&lt;/p&gt;

&lt;p&gt;Traditional architectures built on Storage, Compute, and Databases are being reimagined with the addition of AI-powered Inference capabilities. This new building block doesn't just add functionality; it fundamentally changes how businesses can operate by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Providing an AI workforce available 24/7 on a pay-as-you-go model&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Removing traditional interface barriers to accelerate value delivery&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enabling direct API consumption and data processing at unprecedented scales&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Offering cognitive processing power without human limitations&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, success in this new paradigm requires a sophisticated foundation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Robust data infrastructure to feed AI systems&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Comprehensive API strategies for seamless integration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced cybersecurity measures for AI operations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expert guidance to direct and optimize AI capabilities&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Winners in this transition will be organizations that can either provide these capabilities as a service or build and maintain them effectively in-house. While the technical challenges are significant requiring expertise across domain knowledge, cloud architecture, data management, and AI systems the potential benefits make this investment compelling.&lt;/p&gt;

&lt;p&gt;The shift to an AI-augmented workforce isn't just about technology adoption; it's about reimagining how organizations can operate in a world where cognitive processing becomes a utility. As we move through 2025, the gap between organizations that embrace this paradigm shift and those that don't may become increasingly apparent.&lt;/p&gt;

&lt;p&gt;For those ready to begin this journey, exploring AI Agents through platforms like &lt;a href="https://dev.to/aws-builders/how-to-define-ai-agents-with-cloudformation-and-sam-a-builders-guide-eka"&gt;AWS Bedrock provides a practical starting point&lt;/a&gt;. The future of business operations is being shaped now, and the fourth building blockInferenceis the key to unlocking its potential.&lt;/p&gt;

</description>
      <category>generativeai</category>
      <category>innovation</category>
      <category>technology</category>
      <category>aws</category>
    </item>
    <item>
      <title>How to Define AI Agents with Cloudformation and SAM: A Builder's Guide</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Thu, 19 Dec 2024 21:34:59 +0000</pubDate>
      <link>https://dev.to/aws-builders/how-to-define-ai-agents-with-cloudformation-and-sam-a-builders-guide-eka</link>
      <guid>https://dev.to/aws-builders/how-to-define-ai-agents-with-cloudformation-and-sam-a-builders-guide-eka</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In my previous articles, we explored how AI Agents can transform business operations &lt;a href="https://dev.to/aws-builders/what-c-level-leaders-need-to-know-about-ai-agents-4jgb"&gt;from a bakery CEO's perspective&lt;/a&gt; and &lt;a href="https://dev.to/aws-builders/developing-an-ai-intern-for-c-level-executives-with-aws-bedrock-13ob"&gt;showcased data workflow&lt;/a&gt;. Let's dive deep into the technical implementation using AWS Bedrock AI Agents defined via CloudFormation and SAM. This guide will focus on the key components of the AI Agent configuration and deployment process, including SAM AWS Lambda to grab data, AI Agent tooling, and AI Agent itself.&lt;/p&gt;

&lt;p&gt;This article will give you a working template for building multiple custom AI Agents and showcase how to call them programmatically from your custom user interface.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note 1&lt;/strong&gt;. If you dont feel comfortable with the code, I still recommend you check the AI Agent definition to understand the moving parts. It is human readable and I hope, logical: &lt;a href="https://github.com/javatask/ai-agent-ceo-fin-advisor/blob/main/bedrock-agent-stack.yaml" rel="noopener noreferrer"&gt;https://github.com/javatask/ai-agent-ceo-fin-advisor/blob/main/bedrock-agent-stack.yaml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down to skip permission policy section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note 2&lt;/strong&gt;. Source code is avaliable here: &lt;a href="https://github.com/javatask/ai-agent-ceo-fin-advisor/tree/main" rel="noopener noreferrer"&gt;https://github.com/javatask/ai-agent-ceo-fin-advisor/tree/main&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before starting, ensure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;AWS Account with Bedrock model access enabled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS CLI configured with appropriate permissions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS SAM CLI installed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic understanding of CloudFormation and Lambda&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JQ was installed for JSON processing, and I used it to grab AWS Lambda arn from SAM deployment&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Implementation Overview
&lt;/h2&gt;

&lt;p&gt;Our implementation consists of two main CloudFormation stacks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Finance Tool Lambda (The Intern's Laptop)&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bedrock AI Agent Configuration (The Intern's Guide)&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It is best practice to manage the life cycle of your Interns via the &lt;a href="https://opengitops.dev/" rel="noopener noreferrer"&gt;OpenGitOps&lt;/a&gt; approach, so any degradation in performance or need to be deployed in other regions can be easily made via CI/CD. Ad-hoc changing tooling, instructions and/or interns are OK for development, but for production release, put the Intern version under git control and deploy via CI/CD pipeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding AI Agent Components
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Intern Laptop or Action Groups
&lt;/h3&gt;

&lt;p&gt;The AI Agent needs specific tools to perform tasks. In our case, I defined two functions only &lt;code&gt;analyze_industry_performance&lt;/code&gt; and &lt;code&gt;send_email&lt;/code&gt;. The goal of &lt;code&gt;analyze_industry_performance&lt;/code&gt; the function is to take three parameters. &lt;code&gt;industry&lt;/code&gt;, &lt;code&gt;date_from&lt;/code&gt; and &lt;code&gt;date_to&lt;/code&gt; - these parameters are taken from chat input. For example, in my previous article, I gave the Intern a question &lt;code&gt;How did we do with the hospitality business in the first half of the year?&lt;/code&gt;. Our Intern was capable of mapping &lt;code&gt;Hospitality&lt;/code&gt; to function parameters &lt;code&gt;industry=hotels&lt;/code&gt; and setting valid &lt;code&gt;date_from&lt;/code&gt; and &lt;code&gt;date_to&lt;/code&gt;. After calling &lt;code&gt;analyze_industry_performance&lt;/code&gt; function, the Intern can make HTML or Markdown formatting to send a report via email or show it as a Markdown output.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It is important&lt;/em&gt; to give a detailed description of the function and its parameters so the Intern is capable of mapping CEO intent to function or even asking additional questions that are required to build a report based on CEO intent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;ActionGroups&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ActionGroupName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;financial-analysis-actions&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;Financial analysis and reporting functions&lt;/span&gt;
          &lt;span class="na"&gt;ActionGroupState&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ENABLED&lt;/span&gt;
          &lt;span class="na"&gt;ActionGroupExecutor&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;Lambda&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;LambdaFunctionArn&lt;/span&gt;
          &lt;span class="na"&gt;FunctionSchema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;Functions&lt;/span&gt;&lt;span class="pi"&gt;:&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="s"&gt;analyze_industry_performance&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;|&lt;/span&gt;
                  &lt;span class="s"&gt;Analyzes financial performance metrics across a network of bakeries, providing insights into bookings, billings, and industry-specific trends.&lt;/span&gt;
                  &lt;span class="s"&gt;Industry Parameter Values Valid values:&lt;/span&gt;
                  &lt;span class="s"&gt;'schools' - Educational institutions and campus dining&lt;/span&gt;
                  &lt;span class="s"&gt;'cafes' - Coffee shops and small eateries&lt;/span&gt;
                  &lt;span class="s"&gt;'shops' - Retail bakery outlets&lt;/span&gt;
                  &lt;span class="s"&gt;'factories' - Industrial/manufacturing facilities&lt;/span&gt;
                  &lt;span class="s"&gt;'restaurants' - Full-service restaurants&lt;/span&gt;
                  &lt;span class="s"&gt;'hotels' - Hospitality sector&lt;/span&gt;
                  &lt;span class="s"&gt;Date Range Parameter Format: ('YYYY-MM-DD', 'YYYY-MM-DD')&lt;/span&gt;
                  &lt;span class="s"&gt;Valid ranges:&lt;/span&gt;
                  &lt;span class="s"&gt;Full year: date_from:'2024-01-01', date_to:'2024-12-31'&lt;/span&gt;
                  &lt;span class="s"&gt;Q1: date_from:'2024-01-01', date_to:'2024-03-31'&lt;/span&gt;
                  &lt;span class="s"&gt;Q2: date_from:'2024-04-01', date_to:'2024-06-30'&lt;/span&gt;
                  &lt;span class="s"&gt;Custom: Any date range within 2024&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;date_from&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;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;date from in format YYYY-MM-DD&lt;/span&gt;
                    &lt;span class="na"&gt;Required&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;date_to&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;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;date to in format YYYY-MM-DD&lt;/span&gt;
                    &lt;span class="na"&gt;Required&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;industry&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;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;industry for each need to do analysis&lt;/span&gt;
                    &lt;span class="na"&gt;Required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&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="s"&gt;send_email&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 to send an email to CEO with arbitrary payload&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;html_body&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;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;HTML text of the email&lt;/span&gt;
                    &lt;span class="na"&gt;Required&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;subject&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;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;subject of email&lt;/span&gt;
                    &lt;span class="na"&gt;Required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Your Guide to Intern or Agent Instructions
&lt;/h3&gt;

&lt;p&gt;Instructions are crucial for AI Agent behaviour. The main point here is to guide the Intern on how to use a laptop and data access.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;Instruction&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;You are an experienced financial analyst specializing in business finance. &lt;/span&gt;
        &lt;span class="s"&gt;Your task is to prepare ad-hoc reports for the CEO based on the financial data &lt;/span&gt;
        &lt;span class="s"&gt;provided and the specific request made. Follow these instructions carefully &lt;/span&gt;
        &lt;span class="s"&gt;to produce a comprehensive and insightful report.&lt;/span&gt;

        &lt;span class="s"&gt;First, you will be presented with the financial data by using the function analyze_industry_performance&lt;/span&gt;
        &lt;span class="s"&gt;Next, you need to work on CEO's specific request.&lt;/span&gt;
        &lt;span class="s"&gt;If required, use the send_email function to send the HTML version of the report to the CEO's email.&lt;/span&gt;

        &lt;span class="s"&gt;Analyze the financial data in the context of the CEO's request. Consider the following steps:&lt;/span&gt;

        &lt;span class="s"&gt;1. Identify the key financial metrics relevant to the CEO's request.&lt;/span&gt;
        &lt;span class="s"&gt;2. Perform necessary calculations and comparisons.&lt;/span&gt;
        &lt;span class="s"&gt;3. Look for trends, patterns, or anomalies in the data.&lt;/span&gt;
        &lt;span class="s"&gt;4. Consider both short-term and long-term implications of the findings.&lt;/span&gt;

        &lt;span class="s"&gt;When preparing your report, adhere to these guidelines:&lt;/span&gt;

        &lt;span class="s"&gt;1. Be concise yet comprehensive.&lt;/span&gt;
        &lt;span class="s"&gt;2. Use clear, professional language.&lt;/span&gt;
        &lt;span class="s"&gt;3. Support your analysis with specific data points from the provided financial information.&lt;/span&gt;
        &lt;span class="s"&gt;4. Provide actionable insights and recommendations when appropriate.&lt;/span&gt;
        &lt;span class="s"&gt;5. Anticipate follow-up questions the CEO might have and address them proactively.&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Agent Configuration
&lt;/h3&gt;

&lt;p&gt;Key agent parameters include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Agent Name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Agent Role - In AWS, everyone should have explicit permission to use the Intern's Laptop; the Agent role explicitly permits the Intern to use a company Laptop and company data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The description gives you the ability to navigate through hundreds of Interns&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;FoundationModel -&lt;/strong&gt; &lt;em&gt;Dont ignore this parameter&lt;/em&gt;, it is the University that your Intern graduated from, it defines its intelligence, speed and cost. If you find some tasks that are less intelligent but required very frequently, you may hire other Interns via this field.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;FinancialAnalysisAgent&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::Bedrock::Agent&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;AgentName&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;AgentName&lt;/span&gt;
      &lt;span class="na"&gt;AgentResourceRoleArn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!GetAtt&lt;/span&gt; &lt;span class="s"&gt;BedrockAgentRole.Arn&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;Demo of CEO finance assistant&lt;/span&gt;
      &lt;span class="na"&gt;FoundationModel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-5-sonnet-20240620-v1:0&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  First day on the job on the Deployment Process
&lt;/h2&gt;

&lt;p&gt;Before the Intern joins your team, I assume you already gave it permission to your well-defined and secure &lt;a href="https://aws.amazon.com/sagemaker/lakehouse/" rel="noopener noreferrer"&gt;Data Lakehouse&lt;/a&gt;, defined tools to query your data and instructions to follow when asked questions.&lt;/p&gt;

&lt;p&gt;Let's walk through the onboarding or deployment script:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Build and Deploy Lambda Function&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;finance-tool-lambdasam buildsam deploy &lt;span class="nt"&gt;--stack-name&lt;/span&gt; ai-agent-finance-tool-&lt;span class="nv"&gt;$RANDOM_SUFFIX&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deploy AI Agent Stack&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws cloudformation deploy &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--template-file&lt;/span&gt; bedrock-agent-stack.yaml &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--stack-name&lt;/span&gt; ceo-fin-report-&lt;span class="nv"&gt;$RANDOM_SUFFIX&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--parameter-overrides&lt;/span&gt; file://agent-params.json &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--capabilities&lt;/span&gt; CAPABILITY_IAM

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prepare Agent for Use&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws bedrock-agent prepare-agent &lt;span class="nt"&gt;--agent-id&lt;/span&gt; &lt;span class="nv"&gt;$AGENT_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  First question to the Intern or Testing Your AI Agent
&lt;/h2&gt;

&lt;p&gt;For testing, Ill use a &lt;a href="https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/javascript_bedrock-agent-runtime_code_examples.html" rel="noopener noreferrer"&gt;simple&lt;/a&gt; NodeJS script and AWS SDK for JS to ask the same question from the previous article: &lt;code&gt;How did we do with the hospitality business in the first half of the year? Please send the report to email.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I assume that you have credentials via &lt;code&gt;aws sso login&lt;/code&gt; and changed &lt;code&gt;AgentId&lt;/code&gt; to yours. You can find &lt;code&gt;AgentId&lt;/code&gt; in the newly deployed Cloudformation stack output or on the AWS Bedrock Agents page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;BedrockAgentRuntimeClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;InvokeAgentCommand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@aws-sdk/client-bedrock-agent-runtime&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * @typedef {Object} ResponseBody
 * @property {string} completion
 */&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * Invokes a Bedrock agent to run an inference using the input
 * provided in the request body.
 *
 * @param {string} prompt - The prompt that you want the Agent to complete.
 * @param {string} sessionId - An arbitrary identifier for the session.
 */&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;invokeBedrockAgent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sessionId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BedrockAgentRuntimeClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;us-east-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="c1"&gt;// const client = new BedrockAgentRuntimeClient({&lt;/span&gt;
  &lt;span class="c1"&gt;//   region: "us-east-1",&lt;/span&gt;
  &lt;span class="c1"&gt;//   credentials: {&lt;/span&gt;
  &lt;span class="c1"&gt;//     accessKeyId: "accessKeyId", // permission to invoke agent&lt;/span&gt;
  &lt;span class="c1"&gt;//     secretAccessKey: "accessKeySecret",&lt;/span&gt;
  &lt;span class="c1"&gt;//   },&lt;/span&gt;
  &lt;span class="c1"&gt;// });&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;agentId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AJBHXXILZN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;agentAliasId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TSTALIASID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;command&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;InvokeAgentCommand&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;agentId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;agentAliasId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;sessionId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;inputText&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;completion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;command&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completion&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Completion is undefined&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chunkEvent&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completion&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;chunkEvent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decodedResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextDecoder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;utf-8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;completion&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;decodedResponse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;sessionId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;sessionId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;completion&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Call function if run directly&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;fileURLToPath&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:url&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nf"&gt;fileURLToPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;invokeBedrockAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;How did we do with the hospitality business in the first half of the year? Please send the report to email.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;123&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Launching this script via &lt;code&gt;node index.mjs&lt;/code&gt; I got a response:&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="err"&gt;sessionId:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="mi"&gt;123&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;completion:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'We&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;had&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;relatively&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;stable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;performance&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;hospitality&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;business&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;during&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;first&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;half&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;year&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;slight&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;decrease&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Q&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Q&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Here&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;key&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;points:\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;'\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Total&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;bookings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;H&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2024&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;were&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;282&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;607.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;total&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;billings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mf"&gt;309.52&lt;/span&gt;&lt;span class="err"&gt;.\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;There&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;was&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;small&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;decline&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;performance&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Q&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Q&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="err"&gt;:\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Bookings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;decreased&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;by&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;1.51&lt;/span&gt;&lt;span class="err"&gt;%\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Billings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;decreased&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;by&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;2.76&lt;/span&gt;&lt;span class="err"&gt;%\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;The&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;average&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;billing&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;rate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;slightly&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;decreased&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mf"&gt;90.92&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Q&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mf"&gt;89.64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Q&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="err"&gt;.\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;May&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;was&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;our&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;strongest&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;month&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;while&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;June&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;showed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;weakest&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;performance.\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;'\n'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;+&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"I've sent a detailed report to your email with further analysis and recommendations for improving performance in the second half of the year."&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;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;While this implementation requires traditional development skills, the power lies in decoupling Tools from the Brain. This separation enables:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Reuse of tooling across multiple Interns&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creation of specialized Intern teams&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Complex cross-industry analysis capabilities&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rapid iteration and improvement cycles&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Focus on GitOps practices for your AI Agents while trusting your developers with the coding tasks. This approach creates a scalable foundation for unlimited AI workforce expansion.&lt;/p&gt;

&lt;p&gt;The complete CloudFormation template and deployment scripts are available in the &lt;a href="https://github.com/javatask/ai-agent-ceo-fin-advisor" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>generativeai</category>
      <category>aws</category>
      <category>serverless</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Developing an AI Intern for C-Level Executives with AWS Bedrock</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Wed, 20 Nov 2024 14:16:22 +0000</pubDate>
      <link>https://dev.to/aws-builders/developing-an-ai-intern-for-c-level-executives-with-aws-bedrock-13ob</link>
      <guid>https://dev.to/aws-builders/developing-an-ai-intern-for-c-level-executives-with-aws-bedrock-13ob</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;The journey to implementing AI Agents often seems straightforward in theory but proves complex in practice. This complexity stems from a fundamental challenge: bridging the gap between business leaders and technical teams. An organization's success with AI initiatives often correlates directly with how well these two groups communicate and share a common language - what we in the industry call Domain-Driven Design.&lt;/p&gt;

&lt;p&gt;"But where are my AI Agents?" you might ask. Before diving into the technology, we must address the cultural foundation for success. Daily collaboration between business and IT teams is crucial for any AI Agent implementation.&lt;/p&gt;

&lt;p&gt;You may wonder why invest time in yet another hyped technology. In this article, I'll demonstrate what a simple AI Agent can do for an executive through a practical example. This story builds on my previous article, &lt;a href="https://dev.to/aws-builders/what-c-level-leaders-need-to-know-about-ai-agents-4jgb"&gt;What C-Level Leaders Need to Know About AI Agents&lt;/a&gt;, where we introduced a CEO of a medium-sized bakery network who discovered that AI Agents function like interns with specific tools and capabilities.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: While this article may appear lengthy, most of the content consists of detailed appendices and a sample AI-generated report for reference.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  The Story
&lt;/h1&gt;

&lt;p&gt;After a sleepless night, our CEO (let's call him Ken) received a last-minute invitation to a hospitality conference. This sparked an idea: he needed better insights into his company's financial relationship with hotels. Given the time constraint, Ken asked his IT director and accountant to stay late and prepare an analysis of hotel billings and bookings for the first half of the year. Recognizing the opportunity, Ken shared his vision for AI Agents with his colleagues, mainly because they would spend several days preparing this ad-hoc report.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Result - AI Agent Generated Report
&lt;/h1&gt;

&lt;p&gt;Generate report from a CEO request to AI Agent: “How did we do with the hospitality business in the first half of the year? Please send the report to email.”&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%2Ffxy4pf8o6wajvrxn6sme.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%2Ffxy4pf8o6wajvrxn6sme.png" width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  [Start]Hospitality Business Performance Report - H1 2024
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Executive Summary
&lt;/h2&gt;

&lt;p&gt;The hospitality business showed strong performance in the first half of 2024, with total bookings of $282,608 and total billings of $255,310. The average billing rate was $90.28, indicating a healthy revenue per booking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detailed Analysis
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Overall Performance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Total Bookings: $282,607.99&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Total Billings: $255,309.52&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Average Billing Rate: $90.28&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Monthly Trends
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Month&lt;/th&gt;
&lt;th&gt;Bookings&lt;/th&gt;
&lt;th&gt;Billings&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;January&lt;/td&gt;
&lt;td&gt;$47,376.71&lt;/td&gt;
&lt;td&gt;$44,865.32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;February&lt;/td&gt;
&lt;td&gt;$48,402.91&lt;/td&gt;
&lt;td&gt;$42,915.77&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;March&lt;/td&gt;
&lt;td&gt;$46,599.87&lt;/td&gt;
&lt;td&gt;$41,660.99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;April&lt;/td&gt;
&lt;td&gt;$47,852.04&lt;/td&gt;
&lt;td&gt;$44,383.40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May&lt;/td&gt;
&lt;td&gt;$48,651.34&lt;/td&gt;
&lt;td&gt;$43,993.93&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;June&lt;/td&gt;
&lt;td&gt;$43,725.12&lt;/td&gt;
&lt;td&gt;$37,490.11&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Key Observations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Bookings peaked in May at $48,651.34, while billings were highest in January at $44,865.32.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;June showed a noticeable decline in both bookings and billings, which may require further investigation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The gap between bookings and billings suggests potential areas for improving conversion rates.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Recommendations
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Investigate the factors behind the June decline to mitigate any potential issues.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Analyze the discrepancy between bookings and billings to improve conversion rates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consider implementing strategies to maintain the strong performance seen in May throughout the summer months.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  [End]Conclusion
&lt;/h2&gt;

&lt;p&gt;The hospitality business demonstrated a robust performance in the first half of 2024, with consistent bookings and billings. However, the June decline and the gap between bookings and billings present opportunities for improvement. Addressing these areas could lead to even stronger performance in the second half of the year.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technicalities
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Yes, in the article that has C-level in the title will be code and AWS Console, this is a reality that we live in ;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Understanding the Theory
&lt;/h3&gt;

&lt;p&gt;If you've used ChatGPT for financial analysis, you've likely seen messages about generating and executing Python code. This represents a basic AI Agent with programming capabilities. While Large Language Models (LLMs) cannot perform mathematical calculations directly, they excel at generating code to perform these calculations and explaining the results.&lt;/p&gt;

&lt;p&gt;We'll follow this approach for our CEO's Ad-hoc Financial Report Builder. Notice the specific naming conventionit's not just a generic "Report Builder" but "CEO's Financial Report Builder." This specificity reflects the tool's purpose: an intern with CEO-level data access, email authority, and strategic focus. This naming exemplifies the collaboration between business and IT teams.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Flow
&lt;/h3&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%2Fyg2w3r51e3lsgy9bbjyj.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%2Fyg2w3r51e3lsgy9bbjyj.png" width="800" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The typical process includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Querying raw ERP data through SQL&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Calculating industry segment metrics&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Identifying trends&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generating formatted HTML reports&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sending email summaries&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Implementing the AI Intern
&lt;/h3&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;AWS Account with enabled LLM models (we'll use Anthropic Claude Sonnet v1)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clear instructions for the AI Intern&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Defined data access and processing tools&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Tool Configuration
&lt;/h4&gt;

&lt;p&gt;The AI Intern needs access to specific functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;send_email&lt;/code&gt;: Handles communication with preset CEO email settings&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;analyze_industry_performance&lt;/code&gt;: Processes ERP data consistently&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The entire Instruction text I attached in Appendix 1. Instruction to AI Intern starts like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are an experienced financial analyst specializing in business finance. 
Your task is to prepare ad-hoc reports for the CEO based on the financial data 
provided and the specific request made. 
Follow these instructions carefully to produce a comprehensive 
and insightful report.

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

&lt;/div&gt;



&lt;p&gt;UI to create AI Intern looks 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%2F7zp8vvjpqtacvgt434ir.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%2F7zp8vvjpqtacvgt434ir.png" width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you need to select Brain [LLM Model], provide Instructions and define Action Groups = Tools available to Intern.&lt;/p&gt;

&lt;p&gt;For example, for our &lt;code&gt;send_email&lt;/code&gt; function, the AI Intern needs to provide &lt;code&gt;subject&lt;/code&gt; and &lt;code&gt;html_body&lt;/code&gt; of email, the CEOs email is already part of this function.&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%2Fyfxwrclnzoqkvobmy6rd.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%2Fyfxwrclnzoqkvobmy6rd.png" width="800" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my example, the tool is a Python function that is executed in a serverless manner; yes, you dont need any server to run them. They are responsible for quering and filtering the data.&lt;/p&gt;

&lt;p&gt;Python code for &lt;code&gt;analyze_industry_performance&lt;/code&gt; function is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;analyze_industry_performance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;industry&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;date_range&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Analyze financial performance by industry.
    Args:
        df: DataFrame with bakery financial data
        industry: Specific industry to analyze (optional)
        date_range: Tuple of (start_date, end_date) for analysis period
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;date_range&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;date&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;date_range&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;date&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;date_range&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])]&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;industry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;industry&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;industry&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="n"&gt;analysis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_bookings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bookings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_billings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;billings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;avg_billing_rate&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;billing_rate&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;industry_summary&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;industry&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bookings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sum&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;billings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sum&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;billing_rate&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;mean&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;monthly_trends&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;date&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bookings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sum&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;billings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sum&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;analysis&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;While the setup might seem straightforward, successful implementation requires the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Reliable data infrastructure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Robust cybersecurity measures&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Comprehensive API strategy&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expert oversight to validate AI-generated insights&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The true challenge lies in the technology and establishing the necessary organizational foundation. Before embarking on an AI Agent initiative, consider the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Is your data infrastructure ready?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you have appropriate security measures in place?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have you developed a comprehensive API strategy?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What investment is required?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI Agents represent incredible potential, but their success depends on the proper infrastructure and culture. The technology is revolutionary - but only for organizations prepared to support it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix 1. Full Instruction to Intern
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are an experienced financial analyst specializing in business finance. Your task is to prepare ad-hoc reports for the CEO based on the financial data provided and the specific request made. Follow these instructions carefully to produce a comprehensive and insightful report.

First, you will be presented with the financial data by using the function analyze_industry_performance
Next, you need to work on CEO's specific request.
If required, use the send_email function to send the HTML version of the report to the CEO's email.

Analyze the financial data in the context of the CEO's request. Consider the following steps:

1. Identify the key financial metrics relevant to the CEO's request.
2. Perform necessary calculations and comparisons.
3. Look for trends, patterns, or anomalies in the data.
4. Consider both short-term and long-term implications of the findings.

When preparing your report, adhere to these guidelines:

1. Be concise yet comprehensive.
2. Use clear, professional language.
3. Support your analysis with specific data points from the provided financial information.
4. Provide actionable insights and recommendations when appropriate.
5. Anticipate follow-up questions the CEO might have and address them proactively.

Present your report in the following format:

&amp;lt;report&amp;gt;
&amp;lt;executive_summary&amp;gt;
Provide a brief overview of the key findings and their significance (2-3 sentences).
&amp;lt;/executive_summary&amp;gt;

&amp;lt;detailed_analysis&amp;gt;
Present your in-depth analysis, broken down into relevant subsections. Include supporting data, calculations, and reasoning for your conclusions.
&amp;lt;/detailed_analysis&amp;gt;

&amp;lt;recommendations&amp;gt;
If applicable, offer strategic recommendations based on your analysis. Explain the potential impact of each recommendation.
&amp;lt;/recommendations&amp;gt;

&amp;lt;conclusion&amp;gt;
Summarize the main points and reinforce the most critical insights for the CEO.
&amp;lt;/conclusion&amp;gt;
&amp;lt;/report&amp;gt;

Remember to tailor your analysis and report specifically to the CEO's request while leveraging your financial expertise to provide valuable insights.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ai</category>
      <category>generativeai</category>
      <category>leadership</category>
      <category>culture</category>
    </item>
    <item>
      <title>What C-Level Leaders Need to Know About AI Agents</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Thu, 14 Nov 2024 18:13:47 +0000</pubDate>
      <link>https://dev.to/aws-builders/what-c-level-leaders-need-to-know-about-ai-agents-4jgb</link>
      <guid>https://dev.to/aws-builders/what-c-level-leaders-need-to-know-about-ai-agents-4jgb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Why should you, as a senior executive or manager, spend precious time on "hyped" generative AI topics? I will offer your business a productivity boost, and then it is up to you to invest time into it.&lt;/p&gt;

&lt;p&gt;In this article, I will try to offer mental models of available generative AI technologies. I assume that my reader has already played with claude.ai or chatgpt.com, preferably with paid versions, as free versions have no near "intelligence" in comparison to paid ones. If you, my reader, have no experience with generative AI, I encourage you to read Ethan Mollick's book Co-Intelligence, which inspired this article.&lt;/p&gt;

&lt;p&gt;I'll try to make this article as compact as possible to build common ground for discussions about the business value of generative AI approaches. I'll cover "raw" Large Language Models (LLMs), Prompt Engineering, Retrieval-Augmented Generation (RAG), Fine-tuning, and finally, AI Agents. Let's go!&lt;/p&gt;

&lt;h2&gt;
  
  
  Story
&lt;/h2&gt;

&lt;p&gt;Imagine a medium-sized bakery constrained by local demographics, hiring new personnel to innovate on multiple fronts. The CEO has many ideas, from moving to renewable energy to new innovative marketing ideas. Everything needs to be done in parallel to keeping lights on for existing businesses. As the bakery's products are delicious good, but may not be attractive to new college graduates, it is hard to find new people to start innovating.&lt;/p&gt;

&lt;p&gt;The CEO talked to his personnel and saw support for his ideas to innovate, but all people are already 300% loaded, and he heard about this new hyped thing called generative AI that will steal all jobs. He starts experimenting by getting a &lt;a href="https://claude.ai/" rel="noopener noreferrer"&gt;claude.ai&lt;/a&gt; account and reading through tons of materials promising to help match staff. His daughter just joined a computer science master's program, and the generative AI promise also inspires her. She just passed her &lt;a href="https://aws.amazon.com/certification/certified-ai-practitioner/" rel="noopener noreferrer"&gt;AWS Certified AI Practitioner&lt;/a&gt; certification and is keen to use her new knowledge in practice.&lt;/p&gt;

&lt;p&gt;During dinner at home, the father (CEO) and daughter start a conversation to decode all these terms and how they can help the business.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disclaimer
&lt;/h2&gt;

&lt;p&gt;In this article, I'll use human terms like interns, thinking, reasoning, etc. Current generative AI technology is not alive; it cannot think and reason. I'm using these terms here to simplify the mental model that can be shared within a company.&lt;/p&gt;

&lt;p&gt;And I'll repeat one more time: Large Language Models are incapable of thinking. Their behaviour is much more similar to humans and far from traditional computers and programming languages. This is why I use human terms in a technology setting without quotes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who are Interns or Large Language Models (LLMs)?
&lt;/h2&gt;

&lt;p&gt;Starting the conversation, the question is easy - it is an intern. Depending on the education, price, and size of the LLM, you will get better or worse performance. Some intelligent people tend to overthink and do some work much longer, the same with LLMs - bigger LLMs are smarter interns, but they cost more and think longer. Smaller ones are less intelligent but faster as they do not have much knowledge to think through.&lt;/p&gt;

&lt;p&gt;LLMs are already helpful; they can help with image generation for your branding, summarizing text, or can be a partner in testing new ideas. Think about them as interns who graduated from an educational institution (school, university, institute), and they have basic knowledge but no practical experience. And here, please notice that LLMs are not capable of learning on their own. Here's the main difference between human interns and LLMs - humans learn, and LLMs are not yet capable.&lt;/p&gt;

&lt;p&gt;"Interesting analogy, daughter," reacted Father to the start of the discussion. "I already tried to ask questions about gluten-free bread. I'm discovering this opportunity, but the answer was too primitive. Nevertheless, I used the paid version..."&lt;/p&gt;

&lt;p&gt;"Great question, Father," his daughter replied. "Let's talk about conversation."&lt;/p&gt;

&lt;h2&gt;
  
  
  And Here Comes Your Context or Prompt Engineering
&lt;/h2&gt;

&lt;p&gt;"Remember, Father? I shared a story about my friend who constantly starts conversations from the middle of the story, not the beginning, not the end. Middle because the beginning is evident to him, and he runs fast to get results and the end of the story. It makes me mad when he jumps in the middle, and I feel like a fool trying to understand the goal.&lt;/p&gt;

&lt;p&gt;I'm not telling you that you acted similarly, but for LLMs, you were this person who started from the middle. When you talk to your colleagues, they know so much context about your business - that you're CEO, love bread, have challenges with personnel, and want to improve your product range. But LLMs read every book on the planet; they know computer science, biology, chemistry, etc. They need your context to understand how to help you specifically. And all knowledge is not helping in the beginning, they try to guess."&lt;/p&gt;

&lt;p&gt;There are really good online training resources on this topic at &lt;a href="https://www.pluralsight.com/paths/prompt-engineering-and-generative-ai" rel="noopener noreferrer"&gt;Pluralsight&lt;/a&gt;, but you're a busy person, so simply start by giving personas to your questions and providing more context and details. There are also advanced prompting techniques that force LLMs to plan, research, etc., but they may be too complex for now.&lt;/p&gt;

&lt;p&gt;Another exciting offer from major chatbot providers is the ability to set personas and contexts for all conversations. For example, claude.ai offers "projects" that inject your persona and context into conversations.&lt;/p&gt;

&lt;p&gt;"Imagine that you asked a newly joined intern the same question about gluten-free bread. Maybe they would give you the same boring answer," she concluded.&lt;/p&gt;

&lt;p&gt;"Oh, I understand, so the quality of the answer now depends on the quality of the question, as in real human interaction," the father reflected. "Listen, daughter, so I can help my lawyer and accountant with these prompts. How would I pass my contracts on to the chatbot? Should they copy and paste them into input? I want to review contracts signed in the past. We have new unified types of contracts, and I want to help migrate them to the latest templates. And we have tons of them... with schools, cafes, restaurants, ad-hoc, etc."&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Talk About Tons of Documents or Retrieval-Augmented Generation
&lt;/h2&gt;

&lt;p&gt;Daughter: "Copy-pasting? Hmm, for thousands of documents, maybe it's not a good idea. And maybe your lawyer and accountant want to have analytics for new, old, updated, and similar metrics."&lt;/p&gt;

&lt;p&gt;Father: "So your interns can do all of this?!"&lt;/p&gt;

&lt;p&gt;Daughter: "Not so fast. You saw that major chatbots have this 'Enterprise' subscription, right?"&lt;/p&gt;

&lt;p&gt;Father: "Right, it's enormously expensive, and I saw that I can upload some files. Why should I pay more money?"&lt;/p&gt;

&lt;p&gt;Daughter: "Here's the catch - as a human intern can hold only seven things at a time in their head, the same applies to LLMs that cannot consume all your documents simultaneously. And even if you can do this, it may still add more mess as you're not working on one group of contracts but all of them. How many people can work at one time on everything? Not much? You need to focus, just like LLMs input.&lt;/p&gt;

&lt;p&gt;Clever techniques were introduced to handle a lot of data. It was called RAG because before a question reaches LLMs, the chatbot does 'googling' for keywords in the initial question on your documents and dynamically adds document data to the query with reference to the initial document. LLMs think you did copy-paste, but it was done on your behalf. So, back to prompt engineering - when you focus on a specific set of contracts, they will only be included in the context to answer specific questions.&lt;/p&gt;

&lt;p&gt;As you understand, all your PDF, Word, and scanned copies need to be preprocessed and stored in your private Google, ready to be injected into LLMs questions. And this costs money. The good thing is that now your non-tech people can even do analytics on top of these documents.&lt;/p&gt;

&lt;p&gt;Father: "Hmm, interesting. I need to talk to Juli (lawyer). But what about our local tax regulations? I want LLMs to offer me a strategy for benefiting from the majority of economic stimulus currently available."&lt;/p&gt;

&lt;p&gt;Daughter: "I think, Dad, it can help, but very little. Here, we still need tax consultants, and maybe they can train the intern on our local tax regulations and specific use cases."&lt;/p&gt;

&lt;p&gt;Father: "But you told me that LLM interns cannot learn."&lt;/p&gt;

&lt;p&gt;Daughter: "Wait, it's far from simple. It's called fine-tuning, similar to paying for my University."&lt;/p&gt;

&lt;p&gt;Father: "Ah, cost... how much?"&lt;/p&gt;

&lt;h2&gt;
  
  
  Intern in University or LLM Fine-tuning
&lt;/h2&gt;

&lt;p&gt;Daughter: "As the actor in Le Mans '66 said, not everything money can buy. Maybe fine-tuning may cost you only $10,000, but money is only part of the success. As in university, the main goal is to teach reasoning in a specific field, but LLMs are incapable of reasoning, so what should you do? It would help if you fed them 100,000 and many more pairs of examples, ideally marked as good and bad. For example, you need to say that if a small company is in this situation, a good tax strategy is this, and repeat 100,000 times."&lt;/p&gt;

&lt;p&gt;Father: "Oh, I get it. It is not possible at my scale."&lt;/p&gt;

&lt;p&gt;Daughter: "Yes, but for some industries with specific terminology and tons of documentation not available to LLM training programs, it's an ideal way to add persistent knowledge to LLMs."&lt;/p&gt;

&lt;p&gt;Father: "OK, so you will tell me that AI Agents are also not for me?"&lt;/p&gt;

&lt;p&gt;Daughter: "Mhhh... it's not so simple an answer. AI Agents are for everyone, and it's a good part of the question."&lt;/p&gt;

&lt;h2&gt;
  
  
  Giving Some Freedom to Your Intern or Agentic AI
&lt;/h2&gt;

&lt;p&gt;Daughter: "Before I dive deep into the answer, tell me, father, did you provide your new intern with a new place in the office? Did you buy a PC and a new chair? What tools are available to your intern, if any?"&lt;/p&gt;

&lt;p&gt;Father: "Hmm, they have my local documents 'google' and, and, and nothing else. So you want me to give them office programs so they can do what?"&lt;/p&gt;

&lt;p&gt;Daughter: "Tell what you want interns to help with; it's a tricky question with humans. Interns often come to a job to figure out what to do and how to be helpful. But remember that computer interns cannot learn; they can follow your instructions.&lt;/p&gt;

&lt;p&gt;So in this case, it's good to start gathering or providing AI agents to your employees and look for detailed and prescribed steps for what and how to do it, preferably in the digital world."&lt;/p&gt;

&lt;p&gt;Father: "Let me think about it. So I can give it Excel and ask them to calculate how many goods can fit our warehouse, constantly monitor prices, and offer me ideas about where, when, and how much to buy, right?"&lt;/p&gt;

&lt;p&gt;Daughter: "Oh, so complex. Preferably, start with primitive and trivial tasks, but let's start with your use case. You must understand that you need a software developer who can use, e.g., AWS Bedrock AI Agents framework to glue everything together. There's also &lt;a href="https://www.anthropic.com/news/3-5-models-and-computer-use" rel="noopener noreferrer"&gt;Computer Use from Anthropic&lt;/a&gt;, and other frameworks like &lt;a href="https://microsoft.github.io/autogen/0.2/" rel="noopener noreferrer"&gt;autogen&lt;/a&gt;. Oops, I went too techy. So you need a developer who will combine software, classical code, or API calls to get the current status of the warehouse, current prices for goods, and LLM to run on a schedule based on your precise prompt on when to call The Boss :) and offer good deals on specific positions."&lt;/p&gt;

&lt;p&gt;Father: "Interesting and complicated. So I need to think now and maybe share with employees the idea of assistants, with only one requirement - give me detailed simple instructions that these assistants should follow. It will take time for me to adapt."&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap or the Beginning of a New Era
&lt;/h2&gt;

&lt;p&gt;Father: "So LLMs are new interns, to which I need always to give detailed context and questions via prompt engineering techniques. If I need to feed many documents or these documents constantly change, I need RAG. Fine-tuning is for big companies, and finally, AI Agents can perform simple actions following my instructions, but I need to invest in a software developer, right daughter?"&lt;/p&gt;

&lt;p&gt;Daughter: "Yes, father, and I want to write my thesis on AI Agents to manage our fleet of autonomous buses powered by our solar station located on the farm. Good night, Father."&lt;/p&gt;

&lt;p&gt;Father: "And now you want me to sleep? No way! I'll write the first instructions for my first AI Agent. By the way, is coding hard?"&lt;/p&gt;

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

&lt;p&gt;In conclusion, integrating generative AI technologies into business operations offers significant potential for enhancing productivity and innovation. As demonstrated through the analogy of a bakery, AI can serve as a valuable tool for executives and managers, acting as an intern that requires guidance and context to perform effectively. By understanding and utilizing concepts such as Large Language Models, Prompt Engineering, Retrieval-Augmented Generation, Fine-tuning, and AI Agents, businesses can leverage AI to streamline processes, manage large volumes of data, and automate routine tasks. However, successful implementation requires investment in both technology and human resources, such as software developers, to tailor AI solutions to specific business needs. As AI continues to evolve, it presents new opportunities for businesses to innovate and adapt, marking the beginning of a new era in business operations.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>rag</category>
      <category>promptengineering</category>
    </item>
    <item>
      <title>Introduction to AWS SiteWise: Part 1. An IIoT OPC UA End-to-End Guide</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Tue, 21 May 2024 11:23:20 +0000</pubDate>
      <link>https://dev.to/aws-builders/introduction-to-aws-sitewise-part-1-an-iiot-opc-ua-end-to-end-guide-3d</link>
      <guid>https://dev.to/aws-builders/introduction-to-aws-sitewise-part-1-an-iiot-opc-ua-end-to-end-guide-3d</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction: AWS IoT SiteWise for Network Device Monitoring&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Welcome to this new blog series, where we explore the capabilities of A&lt;a href="https://aws.amazon.com/de/iot-sitewise/" rel="noopener noreferrer"&gt;WS IoT SiteWise&lt;/a&gt; and unveil the "magic" it offers for building end-to-end (E2E) Industrial Internet of Thing (IIoT) solutions focused on monitoring the physical health of network devices. While AWS IoT Core is also a critical component of IoT strategy, this series will concentrate exclusively on SiteWise, leaving IoT Core to be covered in depth in a future series.&lt;/p&gt;

&lt;p&gt;In this initial instalment, we'll outline our project's broad objectives, providing a roadmap of what we aim to achieve and the technology that will help us achieve it.&lt;/p&gt;

&lt;p&gt;The genesis of this series stems from a practical need within my fictional role as a network administrator. Tasked with developing a system to monitor crucial aspects of our operational technology (OT) network devices—such as power supply status, temperature levels, and port functionality—I discovered that these devices are equipped with &lt;a href="https://en.wikipedia.org/wiki/OPC_Unified_Architecture" rel="noopener noreferrer"&gt;OPC UA&lt;/a&gt; protocol capabilities. OPC UA will be instrumental in enabling us to track and manage the health of our network equipment effectively.&lt;/p&gt;

&lt;p&gt;Join me as we delve into AWS IoT SiteWise, leveraging its powerful features to create a robust monitoring system that ensures our network devices operate at their peak and alert us to potential issues before they impact our operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Big Picture: Integrating OT Network with AWS SiteWise&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The journey to fully integrate the network device into our network management strategy involves several key components, each serving a distinct purpose in a larger ecosystem. This approach enhances the monitoring and management of network devices and ensures data integrity and security from the edge to the cloud (Figure 1).&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%2Fujmb4mzd3pcyqrk8t5c4.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%2Fujmb4mzd3pcyqrk8t5c4.png" alt=" " width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note. Diagrams are avaliable as a code in github repo for this series - &lt;a href="https://github.com/javatask/aws-sitewise-iiot-e2e/blob/main/diagrams/big_picture.py" rel="noopener noreferrer"&gt;aws-sitewise-iiot-e2e/diagrams/big_&lt;/a&gt;&lt;a href="http://picture.py" rel="noopener noreferrer"&gt;picture.py&lt;/a&gt;&lt;a href="https://github.com/javatask/aws-sitewise-iiot-e2e/blob/main/diagrams/big_picture.py" rel="noopener noreferrer"&gt;at main · javatask/aws-sitewise-iiot-e2e (&lt;/a&gt;&lt;a href="http://github.com" rel="noopener noreferrer"&gt;github.com&lt;/a&gt;&lt;a href="https://github.com/javatask/aws-sitewise-iiot-e2e/blob/main/diagrams/big_picture.py" rel="noopener noreferrer"&gt;)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;On-Premise Operations&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/javatask/aws-sitewise-iiot-e2e/blob/main/diagrams/big_picture.py" rel="noopener noreferrer"&gt;Our system begins in the operational technology (OT) environment, where ph&lt;/a&gt;ysical devices grouped under "OT Network 1" are connected and managed. These devices, crucial to our daily operations, are first connected through a Hirschmann Industrial Operating System (HIOS 1) switch, which acts as the data source.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Ensuring Security and Integrity&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Data from the OT network is then securely transmitted through "Firewall 1", ensuring that only authorized data flows into the IT network. This firewall acts as a critical barrier, guarding against potential threats and unauthorized access, thus maintaining the integrity of our operational data.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Bridging OT and IT&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Once through the firewall, data moves into the IT network, where it is pre-processed and aggregated. This step is crucial for reducing noise and ensuring that only meaningful data is forwarded to the cloud for further analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Edge Computing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;At this stage, "Edge Compute" plays a vital role. It involves processing data locally, near the source of data generation, which minimizes latency and reduces the load on cloud services. Edge computing is crucial for real-time applications where immediate data processing is required to make timely decisions. Our OPC UA Client will be deployed to listen for the data from the network devices.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;AWS Cloud Integration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Post-edge processing, data is sent to AWS Cloud, specifically to AWS SiteWise. Here, it's modelled, stored, and analyzed. AWS SiteWise provides a robust framework for creating comprehensive asset models that reflect our network's hierarchy, facilitating advanced monitoring and analytics.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Visualization and Control&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The final component in our IIoT architecture is the "Dashboard," which is accessible by network administrators. This dashboard provides a centralized, intuitive interface for monitoring and managing the network's health and performance. It offers real-time insights and analytics, enabling quick decision-making and effective operational management.&lt;/p&gt;

&lt;p&gt;Through AWS SiteWise, we manage and automate data flows from the ground up, ensuring every layer of our network is optimized for performance, reliability, and security. This strategic integration empowers our network administrators with the tools they need to excel in today's fast-paced digital environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is AWS IoT SiteWise?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;AWS IoT SiteWise is a managed service from Amazon Web Services designed to simplify collecting, organizing, and analyzing industrial equipment data. This service is tailored to help companies capture data consistently across devices, understand their operational performance, and identify efficiencies within industrial operations.&lt;/p&gt;

&lt;p&gt;SiteWise enables users to define and model their industrial operations as hierarchical assets at its core, making organising and managing data from complex environments easier. This modelling capability creates virtual representations of physical operations, including devices, machinery, and processes, enabling structured data ingestion and storage.&lt;/p&gt;

&lt;p&gt;SiteWise also automates the process of data collection and ingestion from various sources like OPC-UA (Open Platform Communications Unified Architecture) and other industrial protocols, removing the need for custom-built data collection solutions. Once data is in SiteWise, the service provides built-in capabilities for monitoring equipment across facilities, quickly identifying issues with real-time alerts, and executing deeper analysis using AWS's powerful analytics tools.&lt;/p&gt;

&lt;p&gt;SiteWise includes an integrated dashboard feature called SiteWise Monitor for visualisation and operational insight. This tool allows industrial engineers and operators to create customizable, interactive dashboards to view and manage operational data in real-time. Without deep technical expertise, these dashboards can help identify bottlenecks, optimize processes, and improve overall operational health.&lt;/p&gt;

&lt;p&gt;AWS IoT SiteWise offers a comprehensive, scalable, and secure industrial IoT applications (IIoT) platform. It aids organizations in their journey toward digital transformation by leveraging detailed insights from their equipment data.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Series Logical Blocks: Mapping Our Journey&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This series will break down our journey into several key stages, each designed to systematically build and enhance our network monitoring system using AWS IoT SiteWise. Here's how we'll proceed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configuring Network Devices for OPC UA:&lt;/strong&gt; Network devices must be set up initially to enable OPC UA and configure the necessary credentials. While I won't cover this process in detail, I recommend using the &lt;a href="https://github.com/node-opcua/opcua-commander" rel="noopener noreferrer"&gt;node-opcua/opcua-commander&lt;/a&gt;, a client that simplifies testing OPC UA connectivity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;[Part 2] Configuring Edge Compute/Gateway:&lt;/strong&gt; Setting up our edge computing infrastructure or gateway is crucial for piping data from OPC UA Servers to the cloud.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;[Part 3] Creating SiteWise Asset Models:&lt;/strong&gt; We'll define and configure the asset models within AWS SiteWise to represent our physical devices and their data hierarchically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;[Part 4] Binding Data Streams to SiteWise Assets:&lt;/strong&gt; This step involves linking real-time data streams to our previously configured asset models, ensuring data flows correctly through our system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;[Part 5] Developing a SiteWise Monitor Portal Dashboard:&lt;/strong&gt; Finally, we will build a comprehensive dashboard within the SiteWise Monitor Portal. This dashboard will serve as the central interface for visualizing and managing the health and status of our network devices.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This series aims to guide you through all the necessary steps, from groundwork to full implementation, ensuring a deep understanding of each setup phase.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion: Laying the Foundation for IIoT Success with AWS SiteWise&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;As we conclude the first part of our journey into leveraging AWS IoT SiteWise for monitoring network devices, we have outlined the roadmap and set the stage for a transformative monitoring solution. By breaking down the journey into manageable steps, we have prepared the groundwork for a robust end-to-end monitoring system that will enhance operational efficiency and ensure the health of network devices.&lt;/p&gt;

&lt;p&gt;In the upcoming parts of this series, we will explore each step in more detail, starting with setting up edge computing capabilities and then creating and configuring SiteWise Asset Models. Each part will build upon the last, gradually assembling a comprehensive solution that effectively captures and analyzes data and provides actionable insights through a well-designed dashboard.&lt;/p&gt;

&lt;p&gt;Stay tuned for the next instalment, where we will explore the configuration of Edge Compute/Gateway, a critical component in reducing latency and enabling real-time data processing at the network's edge. Your engagement and feedback are valuable as we navigate this IIoT journey, ensuring each step adds tangible value to your network management strategy.&lt;/p&gt;

&lt;p&gt;Thank you for joining me for this introductory part. I look forward to continuing this journey with you.&lt;/p&gt;

</description>
      <category>awsiot</category>
      <category>sitewise</category>
      <category>iot</category>
      <category>opcua</category>
    </item>
    <item>
      <title>Fixing Issues in AWS VPC with AI Help</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Tue, 19 Mar 2024 16:55:31 +0000</pubDate>
      <link>https://dev.to/aws-builders/fixing-issues-in-aws-vpc-with-ai-help-5c8p</link>
      <guid>https://dev.to/aws-builders/fixing-issues-in-aws-vpc-with-ai-help-5c8p</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;My story begins with AWS Advance Networking Certification. I will start learning all possible network configurations and buy a notebook to note all VPC, Subnets, Route Tables, ENI, and other entity IDes to debug misconfigurations. I have an idea: All this information is available via AWS CLI. Maybe Generative AI can help me with this?!&lt;/p&gt;

&lt;p&gt;So, I built a simple react AI Agent to help with some simple stuff. Maybe this article will inspire you ;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;If you, my honoured reader, want to understand whether this article is for you, here is the result of the small eight-operator code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; : I cannot access web server at ec2 instance ID i-xxxxxx.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answer&lt;/strong&gt; : Initially, you were unable to access the web server on the EC2 instance i-xxxxxx because the associated security group did not have an inbound rule permitting web traffic. Specifically, it lacked rules allowing HTTP (port 80) or HTTPS (port 443) inbound connections.&lt;br&gt;&lt;br&gt;
!!!&lt;br&gt;&lt;br&gt;
To resolve this issue, an inbound rule has been added to the security group (sg-xxxxxx) to permit traffic on port 80 from any IP address (0.0.0.0/0).&lt;br&gt;&lt;br&gt;
!!!!&lt;br&gt;&lt;br&gt;
With this change, you should now be able to access the web server using the public IP address xxx.xxx.xxx.xxx.&lt;br&gt;&lt;br&gt;
However, if you continue experiencing difficulties accessing the web server after adding the security group rule, you may need to investigate further. Potential areas to review include the web server configuration on the EC2 instance, ensuring the web server software is running, and verifying that the instance is located in a public subnet with an Internet Gateway attached to the VPC's route table.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You should be comfortable with AWS Console, Cloudformation, VPC&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You should configure access to the &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html" rel="noopener noreferrer"&gt;AWS Bedrock Calude 3 Sonnet model&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You should have &lt;a href="https://jupyter.org/" rel="noopener noreferrer"&gt;Project Jupyter | Home&lt;/a&gt; installed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also, I'm using &lt;code&gt;aws sso login&lt;/code&gt; to secure access to &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html" rel="noopener noreferrer"&gt;AWS Enviroment&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disclaimer
&lt;/h2&gt;

&lt;p&gt;!!!!!!!!!!!!!!!&lt;/p&gt;

&lt;p&gt;All the words in these sections are big WARNING that the code is using bash shell and AWS credentials to do its "magic". LLM access to shell on its own is high risk ;)&lt;/p&gt;

&lt;p&gt;So please think about questions and experiments!&lt;/p&gt;

&lt;p&gt;You were warned.&lt;/p&gt;

&lt;p&gt;!!!!!!!!!!!!!!!&lt;/p&gt;

&lt;p&gt;The code provided in this article is offered as-is, without any warranties or guarantees of any kind.&lt;/p&gt;

&lt;p&gt;The author does not assume any responsibility for any errors, omissions, or damages that may arise from the use or misuse of the code. The user assumes all risks associated with the implementation and usage of the code.&lt;/p&gt;

&lt;p&gt;The author shall not be held liable for any direct, indirect, incidental, special, or consequential damages that may result from the use or inability to use the code. This includes, but is not limited to, loss of data, loss of profits, business interruption, or any other commercial damages or losses.&lt;/p&gt;

&lt;p&gt;The code is provided for educational and informational purposes only and should not be used in production environments without proper testing, validation, and security considerations.&lt;/p&gt;

&lt;p&gt;The user is solely responsible for ensuring the code's suitability, security, and compliance with applicable laws and regulations.&lt;/p&gt;

&lt;p&gt;The author does not endorse or recommend any specific use of the code and does not guarantee its compatibility with any particular software, hardware, or operating system. The user assumes full responsibility for any modifications made to the code and any consequences that may arise from such modifications.&lt;/p&gt;

&lt;p&gt;By using the code, the user acknowledges and agrees to these terms and conditions. If the user does not agree with these terms, they should refrain from using or implementing the code.&lt;/p&gt;

&lt;p&gt;!!!!!!!!!!!!!!!&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;One of the common challenges AWS newcomers face is misconfigured security group rules, which can lead to denied access to resources like virtual machines (VMs) or web servers running on Elastic Compute Cloud (EC2) instances. This issue often arises due to the "deny all" principle by default in AWS, where no inbound or outbound traffic is allowed unless explicitly permitted through security group rules.&lt;/p&gt;

&lt;p&gt;In this use case, we created a virtual cloud network (VPC) with a misconfigured firewall (security group) that prevented access to a web server running on an EC2 instance on port 80 (HTTP). This scenario is a typical newbie mistake and highlights the importance of properly configuring security group rules to allow intended traffic.&lt;/p&gt;

&lt;p&gt;To address this issue, we leveraged the power of an AI assistant specifically designed for VPC troubleshooting. This AI agent was equipped with access to a bash shell and the AWS Command Line Interface (CLI) toolkit, enabling it to interact with AWS resources and perform necessary actions.&lt;/p&gt;

&lt;p&gt;The AI assistant first analyzed the current configuration of the VPC, including the security groups associated with the EC2 instance hosting the web server. By identifying the missing inbound rule for HTTP traffic on port 80, the AI agent was able to add the required rule to the appropriate security group, allowing inbound traffic from any IP address (0.0.0.0/0) on port 80.&lt;/p&gt;

&lt;p&gt;Once the security group rule was updated, the AI assistant verified that the web server could be accessed using the public IP address of the EC2 instance.&lt;/p&gt;

&lt;p&gt;If access was still denied, the AI agent had the capability to further investigate potential issues, such as the web server configuration on the instance, ensuring the web server software was running, and verifying that the instance was in a public subnet with an Internet Gateway attached to the VPC's route table.&lt;/p&gt;

&lt;p&gt;This use case highlights the power of an AI assistant specifically designed for VPC troubleshooting. By leveraging its knowledge and capabilities, the AI agent was able to quickly identify and resolve a common misconfiguration issue, saving valuable time and effort for AWS users, especially those new to the platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;CloudFormation template to simulate VPC misconfiguration:&lt;br&gt;
&lt;/p&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="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2010-09-09'&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;VPC with EC2 Instance and Security Group&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;VPC&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::EC2::VPC&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;CidrBlock&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.0.0.0/16&lt;/span&gt;
      &lt;span class="na"&gt;EnableDnsHostnames&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;EnableDnsSupport&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;InstanceTenancy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default&lt;/span&gt;
      &lt;span class="na"&gt;Tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Name&lt;/span&gt;
          &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;MyVPC&lt;/span&gt;
  &lt;span class="na"&gt;InternetGateway&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::EC2::InternetGateway&lt;/span&gt;
  &lt;span class="na"&gt;VPCGatewayAttachment&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::EC2::VPCGatewayAttachment&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;VpcId&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;VPC&lt;/span&gt;
      &lt;span class="na"&gt;InternetGatewayId&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;InternetGateway&lt;/span&gt;
  &lt;span class="na"&gt;PublicSubnet&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::EC2::Subnet&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;VpcId&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;VPC&lt;/span&gt;
      &lt;span class="na"&gt;CidrBlock&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.0.0.0/24&lt;/span&gt;
      &lt;span class="na"&gt;MapPublicIpOnLaunch&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;AvailabilityZone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Select&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="kt"&gt;!GetAZs&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;'&lt;/span&gt;
      &lt;span class="na"&gt;Tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Name&lt;/span&gt;
          &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Public Subnet&lt;/span&gt;
  &lt;span class="na"&gt;RouteTable&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::EC2::RouteTable&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;VpcId&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;VPC&lt;/span&gt;
      &lt;span class="na"&gt;Tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Name&lt;/span&gt;
          &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Public Route Table&lt;/span&gt;
  &lt;span class="na"&gt;Route&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::EC2::Route&lt;/span&gt;
    &lt;span class="na"&gt;DependsOn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;VPCGatewayAttachment&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;RouteTableId&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;RouteTable&lt;/span&gt;
      &lt;span class="na"&gt;DestinationCidrBlock&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;0.0.0.0/0&lt;/span&gt;
      &lt;span class="na"&gt;GatewayId&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;InternetGateway&lt;/span&gt;
  &lt;span class="na"&gt;SubnetRouteTableAssociation&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::EC2::SubnetRouteTableAssociation&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;SubnetId&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;PublicSubnet&lt;/span&gt;
      &lt;span class="na"&gt;RouteTableId&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;RouteTable&lt;/span&gt;
  &lt;span class="na"&gt;SecurityGroup&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::EC2::SecurityGroup&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;GroupDescription&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Allow SSH&lt;/span&gt;
      &lt;span class="na"&gt;SecurityGroupIngress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;IpProtocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tcp&lt;/span&gt;
          &lt;span class="na"&gt;FromPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;22&lt;/span&gt;
          &lt;span class="na"&gt;ToPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;22&lt;/span&gt;
          &lt;span class="na"&gt;CidrIp&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;0.0.0.0/0&lt;/span&gt;
      &lt;span class="na"&gt;VpcId&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;VPC&lt;/span&gt;
      &lt;span class="na"&gt;Tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Name&lt;/span&gt;
          &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SSH Access&lt;/span&gt;
  &lt;span class="na"&gt;EC2Instance&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::EC2::Instance&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;ImageId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ami-0cff7528ff583bf9a&lt;/span&gt;
      &lt;span class="na"&gt;InstanceType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;t2.micro&lt;/span&gt;
      &lt;span class="na"&gt;KeyName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;test-vpc&lt;/span&gt;
      &lt;span class="na"&gt;NetworkInterfaces&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;AssociatePublicIpAddress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;true'&lt;/span&gt;
          &lt;span class="na"&gt;DeviceIndex&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0'&lt;/span&gt;
          &lt;span class="na"&gt;GroupSet&lt;/span&gt;&lt;span class="pi"&gt;:&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;SecurityGroup&lt;/span&gt;
          &lt;span class="na"&gt;SubnetId&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;PublicSubnet&lt;/span&gt;
      &lt;span class="na"&gt;UserData&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Base64&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;#!/bin/bash&lt;/span&gt;
        &lt;span class="s"&gt;yum update -y&lt;/span&gt;
        &lt;span class="s"&gt;yum install -y httpd&lt;/span&gt;
        &lt;span class="s"&gt;systemctl start httpd&lt;/span&gt;
        &lt;span class="s"&gt;systemctl enable httpd&lt;/span&gt;
      &lt;span class="na"&gt;Tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Name&lt;/span&gt;
          &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DummyHTTPServer&lt;/span&gt;
&lt;span class="na"&gt;Outputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;VPC&lt;/span&gt;&lt;span class="pi"&gt;:&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;A reference to the created VPC&lt;/span&gt;
    &lt;span class="na"&gt;Value&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;VPC&lt;/span&gt;
    &lt;span class="na"&gt;Export&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;!Sub&lt;/span&gt; &lt;span class="s"&gt;${AWS::StackName}-VPCID&lt;/span&gt;
  &lt;span class="na"&gt;PublicSubnet&lt;/span&gt;&lt;span class="pi"&gt;:&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;A reference to the public Subnet&lt;/span&gt;
    &lt;span class="na"&gt;Value&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;PublicSubnet&lt;/span&gt;
    &lt;span class="na"&gt;Export&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;!Sub&lt;/span&gt; &lt;span class="s"&gt;${AWS::StackName}-SubnetID&lt;/span&gt;
  &lt;span class="na"&gt;EC2Instance&lt;/span&gt;&lt;span class="pi"&gt;:&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;A reference to the EC2 instance&lt;/span&gt;
    &lt;span class="na"&gt;Value&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;EC2Instance&lt;/span&gt;
    &lt;span class="na"&gt;Export&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;!Sub&lt;/span&gt; &lt;span class="s"&gt;${AWS::StackName}-EC2InstanceID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This CloudFormation template creates the following resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A VPC with DNS settings and a custom tag.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An Internet Gateway is attached to the VPC.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A public subnet with public IP auto-assignment enabled.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A route table associated with the public subnet, including a route to the Internet Gateway.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A security group allowing SSH access from any IP address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An EC2 instance in the public subnet, running an Apache HTTP server.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  AI Agent
&lt;/h2&gt;

&lt;p&gt;Here is a code for AI Agent build using the &lt;a href="https://langchain.com/" rel="noopener noreferrer"&gt;LangChain&lt;/a&gt; framework.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Notebook to build AI Agent to fix VPC issues
&lt;/span&gt;
&lt;span class="c1"&gt;# Access to Claude-3 Sonnet LLM using aws sso login to get credentials
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_community.chat_models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BedrockChat&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;
&lt;span class="n"&gt;boto3_bedrock&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bedrock-runtime&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;us-east-1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BedrockChat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;anthropic.claude-3-sonnet-20240229-v1:0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;model_kwargs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;temperature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;top_k&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;top_p&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;boto3_bedrock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# configure react agent
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.agents&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AgentExecutor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;create_react_agent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_community.tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ShellTool&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_core.prompts&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;PromptTemplate&lt;/span&gt;

&lt;span class="c1"&gt;# Initialize the language model
&lt;/span&gt;&lt;span class="n"&gt;llm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;

&lt;span class="c1"&gt;# Initialize the tools
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING RAW SHELL EXPOSED !!!!!!!!!!!!!!!!!!!!!!!
&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;ShellTool&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;span class="c1"&gt;# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING RAW SHELL EXPOSED !!!!!!!!!!!!!!!!!!!!!!!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&lt;/span&gt;
&lt;span class="c1"&gt;# Initialize prompt
&lt;/span&gt;&lt;span class="n"&gt;template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
You are an AWS VPC troubleshooting assistant, and your task is to identify and resolve any misconfigurations in an AWS Virtual Private Cloud (VPC) and its associated resources.

You have access to the bash shell, which allows you to run AWS CLI commands to retrieve information about AWS resources, make changes, and perform various operations.
List of tools:
{tools}
{tool_names}

First, gather information about the existing VPC setup by running the following AWS CLI commands:

1. `aws ec2 describe-vpcs`: This command will list all available VPCs in the current region, along with their CIDR blocks, VPC IDs, and other details. Review the output to ensure the VPC you want to troubleshoot exists and has the correct CIDR block.

2. `aws ec2 describe-subnets --filters Name=vpc-id,Values=&amp;lt;vpc-id&amp;gt;`: Replace `&amp;lt;vpc-id&amp;gt;` with the ID of the VPC you want to troubleshoot. This command will list all subnets associated with the specified VPC, their Availability Zones, and CIDR blocks. Verify that the subnets have the correct CIDR blocks and are associated with the intended Availability Zones.

3. `aws ec2 describe-route-tables --filters Name=vpc-id,Values=&amp;lt;vpc-id&amp;gt;`: This command will list all route tables associated with the specified VPC. Review the routes in each route table to ensure they are configured correctly and match your expectations. For example, check if there are routes to an Internet Gateway for public subnets, and routes to a NAT Gateway or VPN for private subnets.

4. `aws ec2 describe-security-groups --filters Name=vpc-id,Values=&amp;lt;vpc-id&amp;gt;`: This command will list all security groups associated with the specified VPC. Review the inbound and outbound rules for each security group to ensure they are configured correctly and allow or deny the intended traffic.

5. `aws ec2 describe-network-acls --filters Name=vpc-id,Values=&amp;lt;vpc-id&amp;gt;`: This command will list all network ACLs associated with the specified VPC. Review the inbound and outbound rules for each network ACL to ensure they are configured correctly and allow or deny the intended traffic.

After gathering this information, analyze the output and identify any potential misconfigurations or deviations from the expected setup. If you find any issues, provide step-by-step instructions on how to fix them using the appropriate AWS CLI commands.

Remember to double-check your commands before executing them, as some commands may make changes to the AWS environment.

Use the following format:

Question: the input question you must answer
Thought: you should always think about what to do
Action: the action to take, should be one of [{tool_names}]
Action Input: the input to the action
Observation: the result of the action
&lt;/span&gt;&lt;span class="gp"&gt;...&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;Thought&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Action&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Action&lt;/span&gt; &lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Observation&lt;/span&gt; &lt;span class="n"&gt;can&lt;/span&gt; &lt;span class="n"&gt;repeat&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="n"&gt;times&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Thought&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="n"&gt;know&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;final&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt;
&lt;span class="n"&gt;Final&lt;/span&gt; &lt;span class="n"&gt;Answer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;final&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;

&lt;span class="s"&gt;Begin!

Question: {input}
Thought:{agent_scratchpad}
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PromptTemplate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_template&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;template&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Initialize the agent
&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create_react_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Run the agent
&lt;/span&gt;&lt;span class="n"&gt;agent_executor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AgentExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;verbose&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;handle_parsing_errors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;agent_executor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I cannot access web server at ec2 instance ID i-xxxxxx&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's a section about the AI Agent based on the provided code:&lt;/p&gt;

&lt;p&gt;The provided code demonstrates how to build an AI Agent for troubleshooting AWS Virtual Private Cloud (VPC) issues using the AWS Bedrock runtime and the Claude-3 Sonnet language model from Anthropic. This agent leverages the power of large language models (LLMs) and the AWS Command Line Interface (CLI) to identify and resolve misconfigurations in VPC setups.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up the Environment
&lt;/h3&gt;

&lt;p&gt;The code begins by importing the necessary libraries and establishing a connection to the AWS Bedrock runtime using the &lt;code&gt;boto3&lt;/code&gt; library. The &lt;code&gt;BedrockChat&lt;/code&gt; model from the &lt;code&gt;langchain_community&lt;/code&gt; package is used to interface with the Claude-3 Sonnet language model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_community.chat_models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BedrockChat&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;
&lt;span class="n"&gt;boto3_bedrock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bedrock-runtime&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;us-east-1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BedrockChat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;anthropic.claude-3-sonnet-20240229-v1:0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;model_kwargs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;temperature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;top_k&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;top_p&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;boto3_bedrock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configuring the Agent
&lt;/h3&gt;

&lt;p&gt;The code then configures the AI agent using the &lt;code&gt;create_react_agent&lt;/code&gt; function from the &lt;code&gt;langchain.agents&lt;/code&gt; module. The agent is equipped with a &lt;code&gt;ShellTool&lt;/code&gt; from the &lt;code&gt;langchain_community.tools&lt;/code&gt; module, which allows it to execute shell commands, including AWS CLI commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.agents&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AgentExecutor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;create_react_agent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_community.tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ShellTool&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_core.prompts&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;PromptTemplate&lt;/span&gt;

&lt;span class="n"&gt;llm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;
&lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;ShellTool&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Defining the Prompt
&lt;/h3&gt;

&lt;p&gt;A prompt template guides the agent's behaviour and provides instructions and context for the troubleshooting task. The template includes a list of AWS CLI commands that the agent can execute to gather information about the VPC setup, such as describing VPCs, subnets, route tables, security groups, and network ACLs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
# ... (prompt template omitted for brevity)
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PromptTemplate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_template&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;template&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Running the Agent
&lt;/h3&gt;

&lt;p&gt;Finally, the code initializes the agent using the &lt;code&gt;create_react_agent&lt;/code&gt; function and runs it using the &lt;code&gt;AgentExecutor&lt;/code&gt;. The agent can be invoked with a specific input question or problem statement related to VPC troubleshooting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create_react_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;agent_executor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AgentExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;verbose&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;handle_parsing_errors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;agent_executor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I cannot access web server at ec2 instance ID i-xxxxxx&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When invoked, the agent will follow the instructions in the prompt, gathering information about the VPC setup using the AWS CLI commands. It will analyze the output, identify potential misconfigurations, and provide step-by-step instructions on how to fix any issues using the appropriate AWS CLI commands.&lt;/p&gt;

&lt;p&gt;This AI Agent can be a valuable tool for AWS administrators and developers who are responsible for managing and troubleshooting VPC setups. By leveraging the power of large language models and the AWS CLI, the agent can quickly identify and resolve complex VPC issues, streamlining the troubleshooting process and improving overall operational efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result is a new one
&lt;/h2&gt;

&lt;p&gt;This time I removed route to Internet Gateway in public subnet.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; : I cannot access web server at ec2 instance ID i-xxxxxx.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answer&lt;/strong&gt; : To allow internet access to the web server on the EC2 instance (i-xxxxxx), follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create an Internet Gateway:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;aws ec2 create-internet-gateway&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Attach the Internet Gateway to the VPC:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;aws ec2 attach-internet-gateway --vpc-id vpc-03xxxxx --internet-gateway-id &amp;lt;internet-gateway-id&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Replace &lt;code&gt;&amp;lt;internet-gateway-id&amp;gt;&lt;/code&gt; with the ID of the Internet Gateway created in step 1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Find the route table associated with the public subnet (subnet-03xxxxxx):&lt;br&gt;
&lt;br&gt;
&lt;code&gt;aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=subnet-03xxxxxx --query 'RouteTables[*].RouteTableId' --output text&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a route in the route table to the Internet Gateway:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;aws ec2 create-route --route-table-id &amp;lt;route-table-id&amp;gt; --destination-cidr-block 0.0.0.0/0 --gateway-id &amp;lt;internet-gateway-id&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Replace &lt;code&gt;&amp;lt;route-table-id&amp;gt;&lt;/code&gt; with the ID of the route table associated with the public subnet, and &lt;code&gt;&amp;lt;internet-gateway-id&amp;gt;&lt;/code&gt; with the ID of the Internet Gateway created in step 1.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After completing these steps, instances launched in the public subnet (subnet-03xxxxxx) should be able to access the internet and be accessible from the internet. You should now be able to access the web server on the EC2 instance (i-xxxx) using its public IP address (xxx.xxx.xxx.xxx).&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;In conclusion, leveraging Generative AI and AWS CLI to troubleshoot AWS VPC issues offers a groundbreaking approach to network management. This methodology streamlines the process of identifying and resolving misconfigurations and significantly reduces the time and effort required for these tasks. By employing a simple React AI Agent integrated with the Claude-3 Sonnet model, we demonstrated a practical application of AI in automating the process of fixing common security group misconfigurations, thereby enhancing access to EC2 instances. This exploration underscores the potential of AI in simplifying cloud networking challenges, making it an invaluable tool for AWS users seeking to optimize their networking configurations efficiently.&lt;/p&gt;

</description>
      <category>vpc</category>
      <category>ai</category>
      <category>networking</category>
      <category>aws</category>
    </item>
    <item>
      <title>Understanding Amazon Bedrock Knowledge Bases: Key Points</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Fri, 12 Jan 2024 20:41:53 +0000</pubDate>
      <link>https://dev.to/aws-builders/understanding-amazon-bedrock-knowledge-bases-key-points-16cp</link>
      <guid>https://dev.to/aws-builders/understanding-amazon-bedrock-knowledge-bases-key-points-16cp</guid>
      <description>&lt;p&gt;&lt;em&gt;Article complexity&lt;/em&gt;: Intermediate. &lt;em&gt;Target audience&lt;/em&gt;: managers and engineers&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://reinvent.awsevents.com/" rel="noopener noreferrer"&gt;AWS reInvent 2023&lt;/a&gt; was full of Generative AI announcements, one of them being &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html" rel="noopener noreferrer"&gt;AWS Amazon Bedrock Knowledge Bases&lt;/a&gt;. This article will tell the story of starting an internal production-ready AI project in a fictional company, specifically &lt;a href="https://python.langchain.com/docs/use_cases/question_answering/" rel="noopener noreferrer"&gt;retrieval-augmented generation (RAG)&lt;/a&gt;. Simply put, your AI assistant is powered by your company's knowledge captured in different forms like PDFs, articles, whitepapers, etc.&lt;/p&gt;

&lt;p&gt;Telling the story, I assume you 1) already played with one of the generative AI chatbots like &lt;a href="https://openai.com/research/chatgpt" rel="noopener noreferrer"&gt;&lt;strong&gt;ChatGPT&lt;/strong&gt;&lt;/a&gt;, &lt;a href="https://www.bing.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;MS Bing Copilot&lt;/strong&gt;&lt;/a&gt;, or &lt;a href="https://ai.googleblog.com/2021/11/introducing-bard-novel-open-domain.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Google Bard&lt;/strong&gt;&lt;/a&gt;. I hope you had a chance to 2) try state-of-the-art models like &lt;a href="https://openai.com/research/gpt-4" rel="noopener noreferrer"&gt;GPT-4&lt;/a&gt; or Claude 2.1. The last assumption is you know 3) "specific data cut off" of Large Language Models (LLMs). They have knowledge limited by concrete date.&lt;/p&gt;

&lt;h1&gt;
  
  
  An idea for AI-powered Assistant
&lt;/h1&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%2Fmn6aoeuezdk4z5x3ad7k.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%2Fmn6aoeuezdk4z5x3ad7k.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The story starts with the fictional company called "ZeHouse Solutions" (ZHS), which has been producing hubs to host smart-home and smart-office solutions since the 2000s when &lt;a href="https://en.wikipedia.org/wiki/Zigbee" rel="noopener noreferrer"&gt;Zigbee&lt;/a&gt; was an early days protocol. For the last two decades, the company has been using its own data centre for software development and partner network to deliver its product to end customers.&lt;/p&gt;

&lt;p&gt;An essential feature of ZHS hubs was their offline mode. There is no need for Cloud connectivity to set up and run your hub. It's your responsibility to download firmware and upgrade your devices. Also, all custom configuration was the responsibility of integrators or end customers.&lt;/p&gt;

&lt;p&gt;In 2024, ZHS engineers saw the potential of generative AI to help their customers configure hubs. As a well-established company with hundreds of PDFs and documentation for different hub features developed over 20 years, it was challenging to master CLI and the web interface.&lt;/p&gt;

&lt;p&gt;So, the engineers played with proof of concept for generative AI powred assitent and are ready for the next step to talk to their managers...&lt;/p&gt;

&lt;h1&gt;
  
  
  Engineers + Managers = Shared Understanding of GenAI product
&lt;/h1&gt;

&lt;p&gt;Before deep-diving into discussions about the architecture, budget, responsibility, and outcomes of engineers offered a mental model of the AI system based on a shiny new book &lt;a href="https://learning.oreilly.com/library/view/generative-ai-on/9781098159214" rel="noopener noreferrer"&gt;"&lt;em&gt;Generative AI on AWS"&lt;/em&gt; by Chris Fregly, Antje Barth, and Shelbee Eigenbrode (OReilly). Copyright 2024 Flux Capacitor, LLC, Antje Barth, and Shelbee Eigenbrode, 978-1-098-15922-1.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So guys! Let's map typical components of an AI system to our trainee program activities!&lt;/p&gt;

&lt;p&gt;According to Chapter 9 of the book, we have the following components of the system: 0) Infrastructure, 1) &lt;em&gt;Generative models and supporting machine learning (ML) models, 2) Information sources, 3) External systems, 4) Tools and frameworks, 5) Monitoring and logging, 6) Generated outputs and feedback, 7) Operational tooling.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'll skip the &lt;em&gt;Infrastructure&lt;/em&gt; and &lt;em&gt;Operational&lt;/em&gt; tooling blocks and jump straight to Generative models. They will be our trainees :)&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%2Fo73i51gby6d413ygfz8b.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%2Fo73i51gby6d413ygfz8b.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have people, but we must empower them with our documentation = &lt;em&gt;Information sources.&lt;/em&gt; We will imagine information sources as our company library!&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%2F5vyt734pkbd96rlrm7mo.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%2F5vyt734pkbd96rlrm7mo.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is the next block on the list? &lt;em&gt;External systems?&lt;/em&gt; What is it? These are a lot of questions about our complex systems, but not all can be answered by reading our documentation; we need experts! Yes! External systems are our experts.&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%2Fpj6wgtq402a1k8y4zakq.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%2Fpj6wgtq402a1k8y4zakq.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have trainees with access to our documentation library and experts to find the best possible answers for customer questions. What we are missing are &lt;em&gt;Tools and frameworks&lt;/em&gt; to get work done.&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%2F44f44fh4p3p4xw1a34mw.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%2F44f44fh4p3p4xw1a34mw.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;And "Monitoring and logging"&lt;/em&gt; to understand progress and whether our team needs help with their job.&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%2F6bal3p0ijkvu292f3lz7.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%2F6bal3p0ijkvu292f3lz7.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Oh, some of the engineers said there are many moving parts! Let's show the managers our model of trainees using laptops to access monitored documentation libraries and chat with experts to Answer the questions. And here comes the most important part: Who will assess the quality of the answers? Managers? No! :)&lt;/p&gt;

&lt;p&gt;Your user community and partners know questions and the best answers to them. Building and working with your community is the key to success!&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%2Fcspgxe9rvmdgks1hpjco.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%2Fcspgxe9rvmdgks1hpjco.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;. Dear reader please note that generative AI is not capable of mimicing the mechanism of human brain. It's litteraly predicts words when asnwering your questions.&lt;/p&gt;

&lt;p&gt;Offered here model is only an illustration of all moving parts that you need to combine together in order to offer generative AI powered product. This model is targeted for less technical colleguas, to show them the complexity of a product and roles that GenAI project/product requires.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  The AI assistant is ready for production. Do we need to panic?
&lt;/h1&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%2Fpbpkceowyffyw5khhgze.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%2Fpbpkceowyffyw5khhgze.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our small team of enthusiastic engineers came with our comics mental model to the meeting with managers and got approval. Hooray! Or not? How do you make a proof of concept product from &lt;a href="https://jupyter.org/" rel="noopener noreferrer"&gt;Jupiter Lab&lt;/a&gt; + &lt;a href="https://www.langchain.com/" rel="noopener noreferrer"&gt;LangChain,&lt;/a&gt; even for internal use?&lt;/p&gt;

&lt;p&gt;And here comes the book we mentioned: &lt;a href="https://learning.oreilly.com/library/view/generative-ai-on/9781098159214" rel="noopener noreferrer"&gt;"&lt;em&gt;Generative AI on AWS&lt;/em&gt;&lt;/a&gt;&lt;em&gt;"! We can use AWS Bedrock services&lt;/em&gt; to build our backend E2E. Let's try it using the same moving parts model!&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge
&lt;/h2&gt;

&lt;p&gt;The primary challenge was to demonstrate the effectiveness of RAG in a real-world application. The team aimed to build a system that leveraged the vast amount of information in PDF documentation and provided contextually relevant and accurate information in a conversational AI setting. They needed a platform seamlessly integrating various components, including data storage, a vector database for efficient retrieval (library together with experts), and a hosted LLM (trainees).&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: AWS Bedrock
&lt;/h2&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%2Fwfw86kxgu1vzkyqr1pfe.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%2Fwfw86kxgu1vzkyqr1pfe.png" width="511" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS Bedrock emerged as the ideal solution for this challenge. It provided a comprehensive environment facilitating easy experimentation with advanced AI concepts like RAG. The key features that made AWS Bedrock an excellent choice for this project included:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Out-of-the-Box Data Import from S3&lt;/strong&gt; : AWS Bedrock allowed the team to import their PDF documentation directly from Amazon S3. This feature streamlined the process of feeding data into the system, which was crucial for feeding the RAG pipeline. &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html" rel="noopener noreferrer"&gt;Knowledge base for Amazon Bedrock Service&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vector Database Integration&lt;/strong&gt; : Integrating a vector database was essential for the RAG setup. It enabled efficient storage and retrieval of information, a backbone of the RAG system. The &lt;a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vector-search.html" rel="noopener noreferrer"&gt;vector database within AWS OpenSearch&lt;/a&gt; serverless ensured that RAG's retrieval component was fast and accurate.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hosted Large Language Model (LLM)&lt;/strong&gt;: AWS Bedrock provided access to a state-of-the-art LLMs garden. These models served as the foundation for generating responses, while the external data fetched from the vector database enriched these responses with relevant information. Also, we can choose which model is better for our AI assistant, including fine-tuned models.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Model Evaluation Tools&lt;/strong&gt; : The platform offered comprehensive &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation.html" rel="noopener noreferrer"&gt;model evaluation tools&lt;/a&gt;. These tools were essential for assessing the performance of the RAG system, allowing the team to measure the accuracy, relevance, and coherence of the responses generated by the LLM and to ensure that the integration with the vector database was functioning optimally.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fine-Tuning Capabilities&lt;/strong&gt; : AWS Bedrock enabled the team to &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html#fine-tuning" rel="noopener noreferrer"&gt;fine-tune the LLM to suit specific use cases&lt;/a&gt;. This customization was crucial for tailoring the model's responses to the nature of the dataset's smart home terminology and the project's particular requirements. By fine-tuning the LLM, the team could optimize its performance and improve the relevancy of the generated content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Robust Security Measures&lt;/strong&gt; : Security is paramount when dealing with large datasets and AI models. AWS Bedrock provided &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/security.html" rel="noopener noreferrer"&gt;robust security measures&lt;/a&gt; to protect data and model integrity. This included secure data handling practices, encryption, and compliance with industry-standard privacy regulations, ensuring that the team's RAG system was efficient and secure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Comprehensive Monitoring&lt;/strong&gt; : Finally, AWS Bedrock offered &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/monitoring.html" rel="noopener noreferrer"&gt;extensive monitoring capabilities&lt;/a&gt;. This feature allowed the team to track the systems performance in real-time, promptly identify any issues, and ensure that the system ran smoothly and efficiently. Monitoring tools were especially important to monitor the system's interaction with the vector database and the LLMs response generation.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Experimentation Process
&lt;/h2&gt;

&lt;p&gt;The team started by importing a curated dataset from S3 into the vector database. This dataset was designed to represent documentation about the smart home and office hub's range of knowledge that could be useful for the LLM while answering complex configuration questions from both the internal support team and later from the customers directly.&lt;/p&gt;

&lt;p&gt;Next, they integrated the LLM with the vector database. The LLM was configured to query the database dynamically during the generation process, fetching relevant information to augment its responses. For this one, they used &lt;a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html" rel="noopener noreferrer"&gt;RetrieveAndGenerate&lt;/a&gt; AWS Bedrock endpoint .&lt;/p&gt;

&lt;h2&gt;
  
  
  Results and Insights
&lt;/h2&gt;

&lt;p&gt;The proof of concept was a resounding success. The RAG system demonstrated a remarkable ability to provide contextually relevant and detailed answers. For instance, when asked about CLI commands to configure time synchronization using the NTP server, the system was able to pull recent data from the vector database, providing responses that were not only accurate but also up-to-date.&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%2Frwta1ffwe2e5s0wpqz6d.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%2Frwta1ffwe2e5s0wpqz6d.png" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;The introduction of AWS Bedrock has given ZeHouse Solutions an effective tool to develop a retrieval-augmented generation (RAG) system. This AI-powered assistant uses the company's extensive documentation to provide accurate and contextually relevant responses to complex configuration questions. The RAG system's success demonstrates the potential of generative AI in enhancing customer service and internal support. Looking forward, it is clear that AWS Bedrock's capabilities will continue to be instrumental in the evolution and improvement of AI-assisted services.&lt;/p&gt;

&lt;p&gt;Note. AI (OpenAI DALL-E engine) generates all images in this article.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>AI Unleashed: Running Generative Models Locally. Introduction</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Thu, 04 Jan 2024 10:01:05 +0000</pubDate>
      <link>https://dev.to/javatask/ai-unleashed-running-generative-models-locally-introduction-2i9i</link>
      <guid>https://dev.to/javatask/ai-unleashed-running-generative-models-locally-introduction-2i9i</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This article is the first in the series about running a generative AI model locally on consumer-grade hardware to give you a safe place to experiment and understand your use cases. I will try to answer the question of how to safely start experimenting with your real data.&lt;/p&gt;

&lt;p&gt;Gartner states&lt;a href="https://www.gartner.com/en/topics/generative-ai" rel="noopener noreferrer"&gt;, "In theory, at least, this (Generative AI) will increase worker productivity"&lt;/a&gt;. Another Gartner recommendation is to "Start Inside ... with ... Off-the-shelf products". But it's a theory.&lt;/p&gt;

&lt;p&gt;In this series, I'll offer practical steps for implementing Gartner's recommendations for regulated (internally and externally) environments. The series promotes the usage of open-source large language models (LLMs) that are the heart of Generative AI (GenAI).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;. &lt;em&gt;If you don't have any restriction to process your real world data on major Public Cloud providers, like&lt;/em&gt; &lt;a href="https://aws.amazon.com/bedrock/" rel="noopener noreferrer"&gt;&lt;em&gt;AWS Bedrock&lt;/em&gt;&lt;/a&gt;&lt;em&gt;,&lt;/em&gt; &lt;a href="https://azure.microsoft.com/en-us/solutions/ai" rel="noopener noreferrer"&gt;&lt;em&gt;Azure AI&lt;/em&gt;&lt;/a&gt; &lt;em&gt;or&lt;/em&gt; &lt;a href="https://cloud.google.com/vertex-ai" rel="noopener noreferrer"&gt;&lt;em&gt;Google Vertex AI&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. Go for the Public Cloud GenAI offerings!!!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Key Definitions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Generative AI:&lt;/strong&gt; This is a subfield of artificial intelligence that uses models and algorithms to generate content. It can create anything from written text to images or music, by learning patterns from existing data and producing new content that mimics it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large Language Models (LLMs):&lt;/strong&gt; These are AI models trained on a vast amount of text data. They can generate human-like text by predicting the probability of a word given the previous words used in the text. Examples include OpenAI's &lt;a href="https://openai.com/blog/gpt-3-apps" rel="noopener noreferrer"&gt;GPT-3&lt;/a&gt; and Google's &lt;a href="https://deepmind.google/technologies/gemini/" rel="noopener noreferrer"&gt;Gemini&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI Agents:&lt;/strong&gt; These are systems or software that can perform tasks or make decisions autonomously. They use Generative AI to "understand" their environment and perform actions to achieve specific goals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CUDA:&lt;/strong&gt; This stands for Compute Unified Device Architecture. It's a parallel computing platform and application programming interface model created by Nvidia. It allows software developers to use a CUDA-enabled graphics processing unit for general-purpose processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chatbot:&lt;/strong&gt; A chatbot is an AI-powered software designed to interact with humans in their natural languages. These interactions can occur in both text and voice formats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine Customers:&lt;/strong&gt; This is a term coined by Gartner to describe AI systems that can autonomously perform tasks or make purchasing decisions on behalf of human users or other systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Public Cloud GenAI offerings:&lt;/strong&gt; These are Generative AI models or services offered by public cloud providers like Google, Amazon, and Microsoft. They provide pre-trained models and services which developers can use to integrate AI capabilities into their applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steam Revolution is here
&lt;/h2&gt;

&lt;p&gt;This article has a steam engine on its cover because steam and latte electric engines changed the world. The same is happening with AI, specifically with AI Agents.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://python.langchain.com/docs/modules/agents/concepts" rel="noopener noreferrer"&gt;LangChain&lt;/a&gt;: "The core idea of (AI) agents is to use a language model to choose a sequence of actions. In chains, a sequence of actions is hardcoded (in code). In agents, a language model is used as a reasoning engine to determine which actions to take and which order."&lt;/p&gt;

&lt;p&gt;So GenAI becomes the "brain", an orchestrator of tools you may use to achieve a given goal or react to the situation. This agent can work 24/7, process enormous amounts of data and be "objective". One type of such agent &lt;a href="https://www.gartner.com/en/articles/machine-customers-will-decide-who-gets-their-trillion-dollar-business-is-it-you" rel="noopener noreferrer"&gt;Gartner call " &lt;strong&gt;Machine Customers&lt;/strong&gt;".&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Application Covered by the Series
&lt;/h2&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%2F1ai9h0rgmajjjam4k9qn.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%2F1ai9h0rgmajjjam4k9qn.png" width="681" height="693"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This series will have two big blocks:&lt;/p&gt;

&lt;p&gt;This series will have two big blocks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setting up and running your "brain" = LLM locally

&lt;ul&gt;
&lt;li&gt;With CPU only&lt;/li&gt;
&lt;li&gt;With CPU and Nvidia GPU, you need GPUs that has &lt;a href="https://developer.nvidia.com/cuda-toolkit" rel="noopener noreferrer"&gt;CUDA&lt;/a&gt; support&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Configuring&lt;/em&gt; apps that use "brain" to deliver value:

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://chat.openai.com/" rel="noopener noreferrer"&gt;ChatGPT&lt;/a&gt; like &lt;a href="https://github.com/ollama-webui/ollama-webui" rel="noopener noreferrer"&gt;chatbot&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/features/copilot" rel="noopener noreferrer"&gt;GitHub Copilot&lt;/a&gt; like &lt;a href="https://continue.dev/" rel="noopener noreferrer"&gt;VS Code AI Assistant&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/blogs/aws/knowledge-bases-now-delivers-fully-managed-rag-experience-in-amazon-bedrock/" rel="noopener noreferrer"&gt;AWS Knowledge Bases&lt;/a&gt; like super-powered search on private docs&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://python.langchain.com/docs/modules/agents/" rel="noopener noreferrer"&gt;AI Agents&lt;/a&gt; - Demo on how "brain" can use external APIs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;. Diagram shows that Public Cloud providers offer you LLM APIs, so you don't need to worry about hardware and other supportive software.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Manage your expectations
&lt;/h2&gt;

&lt;p&gt;Technology is here, but hardware is still evolving. Following my tutorials on setting up GenAI locally, you soon feel that some models are "dummer" than ChatGPT 4 (state-of-the-art, closed model). They are slower because you may not have the latest and greatest CUDA-enabled GPU.&lt;/p&gt;

&lt;p&gt;BUT, local LLMs technology is good enough for you to start experimenting with GenAI to get value out of it. Remember GenAI is a company-wide initiative, not an IT initiative!&lt;/p&gt;

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

&lt;p&gt;Setting up a local Generative AI model can be a game-changer, providing an avenue to explore, experiment, and build expertise in its use cases. While the technology is available, remember that hardware is still in a state of evolution. Despite some models being slower and less sophisticated than state-of-the-art models, leveraging these tools locally offers a valuable opportunity to experiment and identify the best use cases for Generative AI. This is not just an IT initiative, but a company-wide effort that can revolutionize productivity and efficiency. As we move forward, the fusion of AI with our daily tools and tasks will become increasingly integral to our work and lives.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Deploying a Single Page Application (SPA) on AWS: A Beginner's Guide. Part 8. Serverless</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Tue, 12 Dec 2023 10:14:16 +0000</pubDate>
      <link>https://dev.to/aws-builders/deploying-a-single-page-application-spa-on-aws-a-beginners-guide-part-8-serverless-2h0l</link>
      <guid>https://dev.to/aws-builders/deploying-a-single-page-application-spa-on-aws-a-beginners-guide-part-8-serverless-2h0l</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Serverless architecture and AWS Lambda have brought a revolutionary change to how developers build and deploy applications. By eliminating the need to manage servers, developers can focus more on writing code and delivering features. This article explores the benefits of serverless, such as reduced operational overhead, cost-effectiveness, and scalability. Additionally, we delve into AWS Lambda, a popular serverless computing platform, and how it can streamline your application development process.&lt;/p&gt;

&lt;p&gt;For theoretical insights into serverless, you can visit &lt;a href="http://serverlessland.com" rel="noopener noreferrer"&gt;serverlessland.com&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tooling
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html" rel="noopener noreferrer"&gt;AWS SAM (Serverless Application Model)&lt;/a&gt; is a framework that simplifies the development and deployment of serverless applications on AWS. It extends AWS CloudFormation to provide a simplified way of defining the resources and functions required for your application. To install AWS SAM, you can use the AWS SAM CLI, which is available through package managers like Homebrew, pip, or by downloading the installer from the official AWS SAM GitHub repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Java Code + SAM CloudFormation Template = Production Backend
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Price of Serverless
&lt;/h3&gt;

&lt;p&gt;To fully benefit from serverless architecture, it's essential to refactor your code to be serverless-compatible with AWS Lambda. This process involves adapting your application's structure and codebase to work with Lambda functions, which are stateless, event-driven, and automatically managed by AWS. By doing so, you can take advantage of reduced operational overhead, cost-effectiveness, and improved scalability without the need to manage servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Complex Is the Refactoring?
&lt;/h3&gt;

&lt;p&gt;With Spring Boot 3 Application, making your code serverless-friendly is as simple as importing &lt;a href="https://github.com/awslabs/aws-serverless-java-container" rel="noopener noreferrer"&gt;one library from AWS&lt;/a&gt; to wrap your Spring Boot App into an AWS Lambda handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GreetingLambdaHandler&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;RequestStreamHandler&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;SpringBootLambdaContainerHandler&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HttpApiV2ProxyRequest&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;AwsProxyResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SpringBootLambdaContainerHandler&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getHttpApiV2ProxyHandler&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;RestServiceApplication&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ContainerInitializationException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;printStackTrace&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;RuntimeException&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Could not initialize Spring Boot application"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;handleRequest&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;InputStream&lt;/span&gt; &lt;span class="n"&gt;inputStream&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;outputStream&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Context&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
            &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;proxyStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inputStream&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;outputStream&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;That's all!&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploying the App
&lt;/h3&gt;

&lt;p&gt;Here's the CloudFormation template (CFN) for our Spring Rest API backend:&lt;br&gt;
&lt;/p&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="s1"&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="s"&gt;Example Rest API Serverless for Spring Boot &lt;/span&gt;&lt;span class="m"&gt;3&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;MyRestApiFunction&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;Handler&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;com.example.restservice.GreetingLambdaHandler::handleRequest&lt;/span&gt;
      &lt;span class="na"&gt;Runtime&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;java17&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;.&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;512&lt;/span&gt;
      &lt;span class="na"&gt;Policies&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWSLambdaBasicExecutionRole&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;60&lt;/span&gt;
      &lt;span class="na"&gt;Events&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;HttpApiEvent&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;HttpApi&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;TimeoutInMillis&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20000&lt;/span&gt;
            &lt;span class="na"&gt;PayloadFormatVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2.0"&lt;/span&gt;

&lt;span class="na"&gt;Outputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;RestApi&lt;/span&gt;&lt;span class="pi"&gt;:&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;URL for application&lt;/span&gt;
    &lt;span class="na"&gt;Value&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;https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/api"&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now, let's build and deploy it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sam build
sam deploy &lt;span class="nt"&gt;-g&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;And you can use the URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ServerlessHttpApi&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.execute-api.&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;AWS&lt;/span&gt;::Region&lt;span class="k"&gt;}&lt;/span&gt;.amazonaws.com/api/greeting

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

&lt;/div&gt;



&lt;p&gt;So simple!&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Deep Dive into the CFN Template
&lt;/h2&gt;

&lt;p&gt;The provided CloudFormation template describes AWS resources to be created or configured, focusing on a serverless architecture for hosting a REST API using Spring Boot 3 and Java 17.&lt;/p&gt;

&lt;p&gt;Here's a breakdown of each part:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWSTemplateFormatVersion&lt;/strong&gt; : Specifies the version of the CloudFormation template, in this case, '2010-09-09'.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transform&lt;/strong&gt; : Indicates that the template uses the AWS Serverless Application Model (SAM) transformation named 'AWS::Serverless-2016-10-31'. This transformation provides a simplified syntax for describing serverless resources such as Lambda functions and APIs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt; : Provides a brief description of the template's purpose, specifically mentioning that it's an example REST API using serverless technology for Spring Boot 3.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Resources&lt;/strong&gt;: The main section, where all the resources to be created or configured are defined:&lt;br&gt;
&lt;strong&gt;MyRestApiFunction&lt;/strong&gt;: Describes a Lambda function that will handle the REST API requests.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Handler&lt;/strong&gt;: Specifies the Java class and method that AWS Lambda will call to start executing your function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runtime&lt;/strong&gt;: Specifies the runtime environment (Java 17).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CodeUri&lt;/strong&gt;: The location of the code for the Lambda function (in this case, the current directory).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MemorySize&lt;/strong&gt;: The amount of memory available to the function during execution (512 MB).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Policies&lt;/strong&gt;: The permissions assigned to the function, here using a predefined basic execution role.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timeout&lt;/strong&gt;: The maximum amount of time the function is allowed to run (60 seconds).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Events&lt;/strong&gt;: Defines an HTTP API event that triggers the Lambda function. It sets a specific timeout and payload format version for the event. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Outputs&lt;/strong&gt;: The section defines values that you can import into other stacks, return in response, or view in the AWS CloudFormation console.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RestApi&lt;/strong&gt;: The output provides the URL for the REST API application, constructed dynamically using the region where the stack is launched.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, this CloudFormation template represents a serverless application for a RESTful API using Spring Boot 3, capable of being deployed on AWS using Lambda and other serverless technologies. It includes configurations and properties that define how the API and Lambda functions should behave.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This article introduced serverless architecture's and AWS Lambda's benefits for application development, highlighting reduced operational overhead, cost-effectiveness, and scalability. We explored the AWS SAM framework and the process of refactoring code for serverless compatibility and provided an example of deploying a Spring Boot 3 REST API using a CloudFormation template.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>serverless</category>
      <category>api</category>
      <category>java</category>
    </item>
    <item>
      <title>Deploying a Single Page Application (SPA) on AWS: A Beginner's Guide. Part 7. AWS App Runner</title>
      <dc:creator>Andrii Melashchenko</dc:creator>
      <pubDate>Mon, 04 Dec 2023 07:25:01 +0000</pubDate>
      <link>https://dev.to/aws-builders/deploying-a-single-page-application-spa-on-aws-a-beginners-guide-part-7-aws-app-runner-43b6</link>
      <guid>https://dev.to/aws-builders/deploying-a-single-page-application-spa-on-aws-a-beginners-guide-part-7-aws-app-runner-43b6</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this part of the series, the focus is on running your backend application in a production environment. The goal is to provide the necessary tooling to fulfil the Observable, Seamlessly Updatable, and Failure-Tolerant criteria of a Cloud-Ready App, as described in the FROSST criteria from the &lt;a href="https://architectelevator.com/book/cloudstrategy/" rel="noopener noreferrer"&gt;Cloud Strategy - A Decision-based Approach to Successful Cloud Migration - The Architect Elevator&lt;/a&gt; Book.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before CloudFormation (CFN) Template
&lt;/h2&gt;

&lt;p&gt;Before diving into the CloudFormation template, it's essential to set up observability. This can be done by creating an observability configuration using the AWS CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws apprunner create-observability-configuration &lt;span class="nt"&gt;--observability-configuration-name&lt;/span&gt; rest-api &lt;span class="nt"&gt;--trace-configuration&lt;/span&gt; &lt;span class="nv"&gt;Vendor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;AWSXRAY

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

&lt;/div&gt;



&lt;p&gt;After creating the configuration, retrieve the ARN from the &lt;code&gt;ObservabilityConfigurationArn&lt;/code&gt; field in the output, as shown in the JSON snippet:&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;"ObservabilityConfiguration"&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;"ObservabilityConfigurationArn"&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:apprunner:eu-central-1:1111111111:observabilityconfiguration/rest-api/1/xxxxxx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"ObservabilityConfigurationName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rest-api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"TraceConfiguration"&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;"Vendor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AWSXRAY"&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;"ObservabilityConfigurationRevision"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Latest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ACTIVE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"CreatedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2023-10-12T19:11:23.425000+02:00"&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;h2&gt;
  
  
  App Runner CloudFormation (CFN) Template to Support Failure Tolerance
&lt;/h2&gt;

&lt;p&gt;Let's dive into the CloudFormation template:&lt;br&gt;
&lt;/p&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="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2010-09-09'&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;Backend deployed viaAWS App Runner&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;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="s"&gt;production&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;A name for the environment that this cloudformation will be part of.&lt;/span&gt;
                 &lt;span class="s"&gt;Used to locate other resources in the same environment.&lt;/span&gt;
  &lt;span class="na"&gt;ImageUrl&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;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The url of a docker image that contains the application process that&lt;/span&gt;
                 &lt;span class="s"&gt;will handle the traffic for this service. Should be on ECR private&lt;/span&gt;
  &lt;span class="na"&gt;ObservabilityConfigurationArnParam&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;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create it via aws cli aws apprunner create-observability-configuration --observability-configuration-name rest-api --trace-configuration Vendor=AWSXRAY&lt;/span&gt;

&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
  &lt;span class="c1"&gt;# Backend&lt;/span&gt;
  &lt;span class="na"&gt;AppRunnerRole&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::IAM::Role&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;AssumeRolePolicyDocument&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;Version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2008-10-17'&lt;/span&gt;
        &lt;span class="na"&gt;Statement&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;Effect&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Allow&lt;/span&gt;
            &lt;span class="na"&gt;Principal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;Service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;build.apprunner.amazonaws.com&lt;/span&gt;
            &lt;span class="na"&gt;Action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sts:AssumeRole&lt;/span&gt;
      &lt;span class="na"&gt;ManagedPolicyArns&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;arn:aws:iam::aws:policy/service-role/AWSAppRunnerServicePolicyForECRAccess&lt;/span&gt;

  &lt;span class="na"&gt;Backend&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::AppRunner::Service&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;ServiceName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s"&gt;${AWS::StackName}-restapi-${Environment}&lt;/span&gt;
      &lt;span class="na"&gt;ObservabilityConfiguration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;ObservabilityEnabled&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;ObservabilityConfigurationArn&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;ObservabilityConfigurationArnParam&lt;/span&gt;
      &lt;span class="na"&gt;InstanceConfiguration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;Cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;0.25 vCPU&lt;/span&gt;
        &lt;span class="na"&gt;Memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;0.5 GB&lt;/span&gt;
      &lt;span class="na"&gt;SourceConfiguration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;AuthenticationConfiguration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;AccessRoleArn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!GetAtt&lt;/span&gt; &lt;span class="s"&gt;AppRunnerRole.Arn&lt;/span&gt;
        &lt;span class="na"&gt;ImageRepository&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;ImageRepositoryType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ECR&lt;/span&gt;
          &lt;span class="na"&gt;ImageIdentifier&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;ImageUrl&lt;/span&gt;
          &lt;span class="na"&gt;ImageConfiguration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;Port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8080&lt;/span&gt;
      &lt;span class="na"&gt;HealthCheckConfiguration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;HealthyThreshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
          &lt;span class="na"&gt;Interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
          &lt;span class="na"&gt;Path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/api/greeting&lt;/span&gt;
          &lt;span class="na"&gt;Protocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;HTTP&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;5&lt;/span&gt;
          &lt;span class="na"&gt;UnhealthyThreshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
      &lt;span class="na"&gt;Tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;environment&lt;/span&gt;
          &lt;span class="na"&gt;Value&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="c1"&gt;# Api Gateway&lt;/span&gt;
  &lt;span class="na"&gt;ApiGatewayRestApi&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::ApiGateway::RestApi&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;Name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s"&gt;${AWS::StackName}-gateway-${Environment}&lt;/span&gt;
  &lt;span class="na"&gt;ApiGatewayResource&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::ApiGateway::Resource&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;ParentId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="kt"&gt;!GetAtt&lt;/span&gt; &lt;span class="s"&gt;ApiGatewayRestApi.RootResourceId&lt;/span&gt;
      &lt;span class="na"&gt;PathPart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;{proxy+}'&lt;/span&gt;
      &lt;span class="na"&gt;RestApiId&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;ApiGatewayRestApi&lt;/span&gt;
  &lt;span class="na"&gt;ApiGatewayMethod&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::ApiGateway::Method&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;HttpMethod&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ANY&lt;/span&gt;
      &lt;span class="na"&gt;ResourceId&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;ApiGatewayResource&lt;/span&gt;
      &lt;span class="na"&gt;RestApiId&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;ApiGatewayRestApi&lt;/span&gt;
      &lt;span class="na"&gt;AuthorizationType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NONE&lt;/span&gt;
      &lt;span class="na"&gt;RequestParameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;method.request.path.proxy&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;Integration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;RequestParameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;integration.request.path.proxy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;method.request.path.proxy&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;HTTP_PROXY&lt;/span&gt;
        &lt;span class="na"&gt;IntegrationHttpMethod&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ANY&lt;/span&gt;
        &lt;span class="na"&gt;Uri&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;https://${Backend.ServiceUrl}/{proxy}"&lt;/span&gt;
  &lt;span class="na"&gt;ApiGatewayDeployment&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="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;AWS::ApiGateway::Deployment'&lt;/span&gt;
    &lt;span class="na"&gt;DependsOn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ApiGatewayMethod&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;RestApiId&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;ApiGatewayRestApi&lt;/span&gt;
      &lt;span class="na"&gt;StageName&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;Outputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;AppRunnerServiceArn&lt;/span&gt;&lt;span class="pi"&gt;:&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;AppRunnerServiceArn&lt;/span&gt;
    &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!GetAtt&lt;/span&gt; &lt;span class="s"&gt;Backend.ServiceArn&lt;/span&gt;
  &lt;span class="na"&gt;AppRunnerServiceId&lt;/span&gt;&lt;span class="pi"&gt;:&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;AppRunnerServiceId&lt;/span&gt;
    &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!GetAtt&lt;/span&gt; &lt;span class="s"&gt;Backend.ServiceId&lt;/span&gt;
  &lt;span class="na"&gt;AppRunnerServiceUrl&lt;/span&gt;&lt;span class="pi"&gt;:&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;AppRunnerServiceUrl&lt;/span&gt;
    &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!GetAtt&lt;/span&gt; &lt;span class="s"&gt;Backend.ServiceUrl&lt;/span&gt;
  &lt;span class="na"&gt;IntegrationAPI&lt;/span&gt;&lt;span class="pi"&gt;:&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;URL For CDN&lt;/span&gt;
    &lt;span class="na"&gt;Value&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;https://${ApiGatewayRestApi}.execute-api.${AWS::Region}.amazonaws.com/${Environment}"&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This AWS CloudFormation template defines the infrastructure for deploying a backend application using AWS App Runner and exposing it via AWS API Gateway. Let's break down its key components:&lt;/p&gt;

&lt;h3&gt;
  
  
  Parameters
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Environment&lt;/code&gt;: Specifies the name of the environment (e.g., production or development) that this CloudFormation stack is part of.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ImageUrl&lt;/code&gt;: The URL of a Docker image containing the application process to handle traffic. This image should be stored in a private Amazon ECR registry.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ObservabilityConfigurationArnParam&lt;/code&gt;: ARN for the observability configuration, which can be created using the AWS CLI.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AppRunnerRole (IAM Role)&lt;/strong&gt;: This role allows the App Runner service to assume it and interact with other AWS services. It also attaches the necessary managed policy to access ECR.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backend (AWS App Runner Service)&lt;/strong&gt;: Defines the App Runner service, specifying its name, observability configuration, instance configuration (CPU and memory), source configuration (image repository details), health check configuration, and tags.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ApiGatewayRestApi (API Gateway REST API)&lt;/strong&gt;: Creates the entry point for the API Gateway.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ApiGatewayResource (API Gateway Resource)&lt;/strong&gt;: Configures a wildcard proxy resource to forward all requests to the App Runner service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ApiGatewayMethod (API Gateway Method)&lt;/strong&gt;: Defines a method that allows any HTTP method and integrates with the backend via HTTP_PROXY.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ApiGatewayDeployment (API Gateway Deployment)&lt;/strong&gt;: Deploys the API Gateway to a specified stage, making it accessible externally.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Outputs
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AppRunnerServiceArn&lt;/strong&gt; : The ARN of the App Runner service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AppRunnerServiceId&lt;/strong&gt; : The ID of the App Runner service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AppRunnerServiceUrl&lt;/strong&gt; : The URL of the App Runner service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;IntegrationAPI&lt;/strong&gt; : The external URL for accessing the API through the API Gateway.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This template sets up a backend service using AWS App Runner, utilizing a Docker image from ECR, and configures an API Gateway to handle and forward HTTP requests to this backend. It also supports observability through AWS X-Ray and offers outputs for accessing both the backend service and the API Gateway endpoint. Parameterizing the environment allows for different configurations for various deployment stages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Logs, Monitoring, and Tracing to Support Observability
&lt;/h2&gt;

&lt;p&gt;For comprehensive observability, you can access data about your backend by visiting the App Runner console. Here, you can view logs, monitor metrics, and trace information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seamlessly Updatable
&lt;/h2&gt;

&lt;p&gt;To make updates to your backend, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Modify the code by adding the word "new" to a string template in your application.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;    &lt;span class="nd"&gt;@RestController&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GreetingController&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Hello, new %s!"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Build the backend:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;$ &lt;/span&gt;./gradlew bootBuildImage &lt;span class="nt"&gt;--imageName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;spring-rest-api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Publish the new version to the private Elastic Container Registry (ECR):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    aws ecr get-login-password &lt;span class="nt"&gt;--region&lt;/span&gt; eu-central-1 | docker login &lt;span class="nt"&gt;--username&lt;/span&gt; AWS &lt;span class="nt"&gt;--password-stdin&lt;/span&gt; 11111111.dkr.ecr.eu-central-1.amazonaws.com
    docker tag spring-rest-api:latest 111111111.dkr.ecr.eu-central-1.amazonaws.com/ias:spring-rest-api
    docker push 111111111.dkr.ecr.eu-central-1.amazonaws.com/ias:spring-rest-api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Trigger an App Runner update:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    aws apprunner start-deployment &lt;span class="nt"&gt;--service-arn&lt;/span&gt; arn:aws:apprunner:eu-central-1:1111111111:service/apprunner-restapi-production/2222222222222222222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can check for logs in the App Runner console.&lt;/p&gt;

&lt;p&gt;After querying the API Gateway endpoint, you should receive a "new" response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://xxxxxxxxxxx.execute-api.eu-central-1.amazonaws.com/production/api/greeting

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

&lt;/div&gt;



&lt;p&gt;Response:&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="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Hello, new World!"&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;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This article has provided a comprehensive guide to deploying a backend application using AWS App Runner and exposing it through AWS API Gateway. It covered the creation of an AWS CloudFormation template, which defines the essential infrastructure, parameters, and resources. The template ensures observability through AWS X-Ray and supports seamless updates by demonstrating code changes and deployment triggers using a sample Spring Boot application.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>serverless</category>
      <category>containers</category>
      <category>restapi</category>
    </item>
  </channel>
</rss>
