Skip to content

Commit 5285ec6

Browse files
authored
Merge pull request #3 from lperez31/diagram
New architecture diagram
2 parents 607341f + bd36667 commit 5285ec6

3 files changed

Lines changed: 151 additions & 42 deletions

File tree

README.md

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
# Amazon Bedrock AgentCore - Automated Full-Stack Deployment
22

3-
Starter template for deploying AI agents with [Amazon Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/resources/). Complete infrastructure scaffolding with authentication, API, and web interface - all automated in one command.
3+
Starter template for deploying AI agents with [Amazon Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/resources/). Complete infrastructure scaffolding with authentication, API, and web interface - deployment automated in one command.
44

55
The example agent is built with the [Strands Agents framework](https://github.com/strands-agents/) and includes calculator and weather tools to demonstrate tool integration. The focus is on deployment automation - you can easily swap the agent implementation or extend its capabilities.
66

7+
## Architecture
8+
9+
![Architecture](./img/architecture_diagram.svg)
10+
11+
Flow:
12+
1. Browser loads React app from CloudFront/S3
13+
2. User authenticates with Cognito, receives JWT token
14+
3. Browser calls AgentCore directly with JWT Bearer token
15+
4. AgentCore validates JWT and processes agent requests
16+
717
## Quick Start
818

919
### Prerequisites
@@ -66,47 +76,6 @@ Try these prompts:
6676
- "Calculate 123 * 456"
6777
- "What is 2 to the power of 10?"
6878

69-
## Architecture
70-
71-
```
72-
┌─────────────┐ 1. Load Static Assets ┌─────────────────┐
73-
│ Browser │ ──────────────────────────> │ CloudFront │
74-
└──────┬──────┘ └──────┬──────────┘
75-
│ │
76-
│ ▼
77-
│ ┌─────────────────┐
78-
│ │ React App │
79-
│ │ (S3 Bucket) │
80-
│ │ + Auth UI │
81-
│ └─────────────────┘
82-
83-
│ 2. Sign In/Sign Up
84-
85-
┌─────────────────┐
86-
│ Cognito │
87-
│ User Pool │ ──── JWT Token ────┐
88-
│ (Auth) │ │
89-
└─────────────────┘ │
90-
91-
┌───────────────────────────────┘
92-
│ 3. POST /runtimes/{arn}/invocations
93-
│ Authorization: Bearer {JWT}
94-
95-
┌─────────────────┐
96-
│ AgentCore │
97-
│ Runtime │
98-
│ (ARM64 Docker) │
99-
│ + Built-in │
100-
│ Cognito Auth │
101-
│ + Bedrock LLM │
102-
└─────────────────┘
103-
104-
Flow:
105-
1. Browser loads React app from CloudFront/S3
106-
2. User authenticates with Cognito, receives JWT token
107-
3. Browser calls AgentCore directly with JWT Bearer token
108-
4. AgentCore validates JWT and processes agent requests
109-
```
11079

11180
## Stack Architecture
11281

img/architecture_diagram.drawio

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<mxfile host="Electron" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/27.0.5 Chrome/134.0.6998.205 Electron/35.3.0 Safari/537.36" version="27.0.5">
2+
<diagram name="AWS AgentCore Simple Architecture" id="simple-architecture">
3+
<mxGraphModel dx="2052" dy="1258" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
<mxCell id="OhggSYJSpCa1kSrFaGi9-24" value="AWS Cloud" style="sketch=0;outlineConnect=0;gradientColor=none;html=1;whiteSpace=wrap;fontSize=12;fontStyle=0;shape=mxgraph.aws4.group;grIcon=mxgraph.aws4.group_vpc;strokeColor=#879196;fillColor=none;verticalAlign=top;align=left;spacingLeft=30;fontColor=#879196;dashed=0;" parent="1" vertex="1">
8+
<mxGeometry x="370" y="40" width="480" height="430" as="geometry" />
9+
</mxCell>
10+
<mxCell id="OhggSYJSpCa1kSrFaGi9-17" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
11+
<mxGeometry x="400" y="190" width="410" height="130" as="geometry" />
12+
</mxCell>
13+
<mxCell id="OhggSYJSpCa1kSrFaGi9-16" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
14+
<mxGeometry x="400" y="70" width="410" height="120" as="geometry" />
15+
</mxCell>
16+
<mxCell id="user" value="" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;fillColor=#232F3D;strokeColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;pointerEvents=1;shape=mxgraph.aws4.user;" parent="1" vertex="1">
17+
<mxGeometry x="40" y="227.5" width="60" height="60" as="geometry" />
18+
</mxCell>
19+
<mxCell id="user-label" value="User" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontColor=#232F3E;" parent="1" vertex="1">
20+
<mxGeometry x="40" y="287.5" width="60" height="20" as="geometry" />
21+
</mxCell>
22+
<mxCell id="flow1" value="1. Load Static Assets" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#5A30B5;strokeWidth=3;fontColor=#232F3E;fontSize=12;fontStyle=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="OhggSYJSpCa1kSrFaGi9-1" target="cloudfront" edge="1">
23+
<mxGeometry x="0.1549" y="10" relative="1" as="geometry">
24+
<mxPoint as="offset" />
25+
<mxPoint x="220" y="245" as="sourcePoint" />
26+
</mxGeometry>
27+
</mxCell>
28+
<mxCell id="flow1b" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#5A30B5;strokeWidth=3;" parent="1" source="cloudfront" target="s3" edge="1">
29+
<mxGeometry relative="1" as="geometry" />
30+
</mxCell>
31+
<mxCell id="flow2" value="2. Sign In/Sign Up" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#C7131F;strokeWidth=3;fontColor=#232F3E;fontSize=12;fontStyle=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="OhggSYJSpCa1kSrFaGi9-1" target="cognito" edge="1">
32+
<mxGeometry x="-0.28" relative="1" as="geometry">
33+
<Array as="points">
34+
<mxPoint x="380" y="258" />
35+
<mxPoint x="380" y="258" />
36+
</Array>
37+
<mxPoint as="offset" />
38+
</mxGeometry>
39+
</mxCell>
40+
<mxCell id="jwt-response" value="JWT Token" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#C7131F;strokeWidth=2;dashed=1;fontColor=#232F3E;fontSize=11;exitX=0.5;exitY=0;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.98;entryY=0.02;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="cognito" target="OhggSYJSpCa1kSrFaGi9-1" edge="1">
41+
<mxGeometry x="0.1991" y="-10" relative="1" as="geometry">
42+
<Array as="points">
43+
<mxPoint x="480" y="210" />
44+
<mxPoint x="199" y="210" />
45+
</Array>
46+
<mxPoint x="210" y="260" as="targetPoint" />
47+
<mxPoint as="offset" />
48+
</mxGeometry>
49+
</mxCell>
50+
<mxCell id="OhggSYJSpCa1kSrFaGi9-1" value="" style="verticalLabelPosition=bottom;html=1;verticalAlign=top;align=center;strokeColor=none;fillColor=#00BEF2;shape=mxgraph.azure.computer;pointerEvents=1;" parent="1" vertex="1">
51+
<mxGeometry x="150" y="235" width="50" height="45" as="geometry" />
52+
</mxCell>
53+
<mxCell id="OhggSYJSpCa1kSrFaGi9-4" value="" style="group" parent="1" vertex="1" connectable="0">
54+
<mxGeometry x="584" y="100" width="100" height="90" as="geometry" />
55+
</mxCell>
56+
<mxCell id="s3-label" value="Amazon S3&lt;br&gt;Static assets" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#232F3E;" parent="OhggSYJSpCa1kSrFaGi9-4" vertex="1">
57+
<mxGeometry y="60" width="100" height="30" as="geometry" />
58+
</mxCell>
59+
<mxCell id="s3" value="" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;gradientColor=#60A337;gradientDirection=north;fillColor=#277116;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.s3;" parent="OhggSYJSpCa1kSrFaGi9-4" vertex="1">
60+
<mxGeometry x="20" width="60" height="60" as="geometry" />
61+
</mxCell>
62+
<mxCell id="OhggSYJSpCa1kSrFaGi9-7" value="Browser" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#232F3E;" parent="1" vertex="1">
63+
<mxGeometry x="145" y="280" width="60" height="30" as="geometry" />
64+
</mxCell>
65+
<mxCell id="OhggSYJSpCa1kSrFaGi9-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="user" target="OhggSYJSpCa1kSrFaGi9-1" edge="1">
66+
<mxGeometry relative="1" as="geometry" />
67+
</mxCell>
68+
<mxCell id="OhggSYJSpCa1kSrFaGi9-9" value="" style="group" parent="1" vertex="1" connectable="0">
69+
<mxGeometry x="604" y="340" width="206" height="110" as="geometry" />
70+
</mxCell>
71+
<mxCell id="OhggSYJSpCa1kSrFaGi9-18" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="OhggSYJSpCa1kSrFaGi9-9" vertex="1">
72+
<mxGeometry x="-204" y="-20" width="410" height="130" as="geometry" />
73+
</mxCell>
74+
<mxCell id="OhggSYJSpCa1kSrFaGi9-10" value="" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;gradientColor=#4AB29A;gradientDirection=north;fillColor=#116D5B;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.bedrock;" parent="OhggSYJSpCa1kSrFaGi9-9" vertex="1">
75+
<mxGeometry width="60" height="60" as="geometry" />
76+
</mxCell>
77+
<mxCell id="OhggSYJSpCa1kSrFaGi9-11" value="Amazon Bedrock" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#232F3E;" parent="OhggSYJSpCa1kSrFaGi9-9" vertex="1">
78+
<mxGeometry x="-40" y="60" width="140" height="30" as="geometry" />
79+
</mxCell>
80+
<mxCell id="OhggSYJSpCa1kSrFaGi9-6" value="" style="group" parent="OhggSYJSpCa1kSrFaGi9-9" vertex="1" connectable="0">
81+
<mxGeometry x="-173" y="-240" width="110" height="80" as="geometry" />
82+
</mxCell>
83+
<mxCell id="cloudfront" value="" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;gradientColor=#945DF2;gradientDirection=north;fillColor=#5A30B5;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.cloudfront;" parent="OhggSYJSpCa1kSrFaGi9-6" vertex="1">
84+
<mxGeometry x="20" width="60" height="60" as="geometry" />
85+
</mxCell>
86+
<mxCell id="cloudfront-label" value="Amazon CloudFront" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontColor=#232F3E;" parent="OhggSYJSpCa1kSrFaGi9-6" vertex="1">
87+
<mxGeometry y="60" width="110" height="20" as="geometry" />
88+
</mxCell>
89+
<mxCell id="OhggSYJSpCa1kSrFaGi9-13" value="" style="group" parent="OhggSYJSpCa1kSrFaGi9-9" vertex="1" connectable="0">
90+
<mxGeometry x="-174" y="-120" width="100" height="92.5" as="geometry" />
91+
</mxCell>
92+
<mxCell id="cognito" value="" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;gradientColor=#F54749;gradientDirection=north;fillColor=#C7131F;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.cognito;" parent="OhggSYJSpCa1kSrFaGi9-13" vertex="1">
93+
<mxGeometry x="20" width="60" height="60" as="geometry" />
94+
</mxCell>
95+
<mxCell id="cognito-label" value="Amazon Cognito&lt;br&gt;User Pool" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#232F3E;" parent="OhggSYJSpCa1kSrFaGi9-13" vertex="1">
96+
<mxGeometry y="62.5" width="100" height="30" as="geometry" />
97+
</mxCell>
98+
<mxCell id="OhggSYJSpCa1kSrFaGi9-12" value="&lt;span style=&quot;background-color: light-dark(rgb(252, 230, 204), rgb(237, 237, 237));&quot;&gt;LLM calls&lt;/span&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#116D5B;strokeWidth=3;fontColor=#232F3E;fontSize=12;fontStyle=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;" parent="OhggSYJSpCa1kSrFaGi9-9" source="bedrock" target="OhggSYJSpCa1kSrFaGi9-10" edge="1">
99+
<mxGeometry x="-0.0909" y="10" relative="1" as="geometry">
100+
<Array as="points" />
101+
<mxPoint x="-104" y="30" as="sourcePoint" />
102+
<mxPoint x="293.5" y="220" as="targetPoint" />
103+
<mxPoint as="offset" />
104+
</mxGeometry>
105+
</mxCell>
106+
<mxCell id="OhggSYJSpCa1kSrFaGi9-23" value="" style="group" parent="OhggSYJSpCa1kSrFaGi9-9" vertex="1" connectable="0">
107+
<mxGeometry x="-179" width="110" height="90" as="geometry" />
108+
</mxCell>
109+
<mxCell id="bedrock" value="" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;gradientColor=#4AB29A;gradientDirection=north;fillColor=#116D5B;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.bedrock;" parent="OhggSYJSpCa1kSrFaGi9-23" vertex="1">
110+
<mxGeometry x="25" width="60" height="60" as="geometry" />
111+
</mxCell>
112+
<mxCell id="bedrock-label" value="Amazon Bedrock&lt;br&gt;AgentCore" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontColor=#232F3E;" parent="OhggSYJSpCa1kSrFaGi9-23" vertex="1">
113+
<mxGeometry y="60" width="110" height="30" as="geometry" />
114+
</mxCell>
115+
<mxCell id="OhggSYJSpCa1kSrFaGi9-19" value="Frontend (React)" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
116+
<mxGeometry x="705" y="70" width="110" height="30" as="geometry" />
117+
</mxCell>
118+
<mxCell id="OhggSYJSpCa1kSrFaGi9-20" value="Authentication" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
119+
<mxGeometry x="715" y="190" width="100" height="30" as="geometry" />
120+
</mxCell>
121+
<mxCell id="OhggSYJSpCa1kSrFaGi9-21" value="Agent" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
122+
<mxGeometry x="760" y="320" width="50" height="30" as="geometry" />
123+
</mxCell>
124+
<mxCell id="flow3" value="3. API Calls with JWT Bearer Token" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#116D5B;strokeWidth=3;fontColor=#232F3E;fontSize=12;fontStyle=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" target="bedrock" edge="1">
125+
<mxGeometry x="0.0448" y="10" relative="1" as="geometry">
126+
<Array as="points">
127+
<mxPoint x="175" y="370" />
128+
</Array>
129+
<mxPoint x="175" y="310" as="sourcePoint" />
130+
<mxPoint as="offset" />
131+
</mxGeometry>
132+
</mxCell>
133+
</root>
134+
</mxGraphModel>
135+
</diagram>
136+
</mxfile>

img/architecture_diagram.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)