Skip to content

Commit 192e6e6

Browse files
committed
Update
1 parent 4e3d19d commit 192e6e6

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The s3hub command provides following features:
4646
|Name|README|implementation|
4747
|:--|:--|:--|
4848
|[Lambda batch with EventBridge (CloudWatch Events)](./cloudformation/lambda-batch/README.md)||100%|
49+
|[Lambda with API Gateway](./cloudformation/api-gateway-with-lambda/README.md)||100%|
4950
|[CloudWatch Real User Monitoring (RUM)](./cloudformation/cloudwatch-rum/README.md)||100%|
5051

5152

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## API Gateway with Lambda
2+
### Overview
3+
4+
Lambda and API Gateway combined infrastructure is a powerful means for realizing serverless architecture. Lambda is a service for executing code, while API Gateway creates HTTP endpoints and forwards requests to Lambda functions.
5+
6+
![lambda-with-apigateway](./lambda-with-apigateway.png)
7+
8+
This combination offers the following characteristics:
9+
10+
- Simplified Serverless Architecture: Combining API Gateway with Lambda allows for the creation of a serverless architecture, eliminating issues with server management and scaling.
11+
- Cost Efficiency: Being billed only for the resources you use, costs can scale with traffic, reducing wasteful spending.
12+
- Seamless Integration: API Gateway provides seamless integration with Lambda, allowing you to define API endpoints and route requests to Lambda functions.
13+
- Facilitates the implementation of microservices architecture, allowing deployment of independent Lambda functions for each functionality.
14+
15+
### Limitations
16+
- Long Processing Time: Lambda functions are limited by execution time. If long processing is required, Lambda might not be suitable. Alternative methods should be explored for long-running processes.
17+
- Heavy Data Processing: Lambda functions have resource limits. For tasks requiring heavy data processing or significant memory, other services or architectures might be more suitable.
18+
- Always Active Services: Lambda is event-driven and goes to sleep when there are no requests. For services that need to be always active or for background processing, Lambda might not be appropriate.
19+
20+
21+
### How to deploy
22+
> [!NOTE]
23+
> Before running `make deploy`, ensure you have configured AWS credentials and set the correct region. Otherwise, you use single sign-on (SSO).
24+
25+
```shell
26+
$ make deploy
27+
```
28+
29+
### Endpoint Base URL Syntax
30+
The URL syntax for the API Gateway endpoint is as follows:
31+
32+
```
33+
https://<api-id>.execute-api.<region>.amazonaws.com/<stage>
34+
```
35+
36+
- `<api-id>`: The API Gateway ID.
37+
- `<region>`: The AWS region where the API Gateway is deployed.
38+
- `<stage>`: The stage name of the API Gateway.
39+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<mxfile host="65bd71144e">
2+
<diagram id="XGAyPcSnOJNRtPWJga0X" name="ページ1">
3+
<mxGraphModel dx="1297" dy="347" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="827" pageHeight="1169" background="#ffffff" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0"/>
6+
<mxCell id="1" parent="0"/>
7+
<mxCell id="29" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;fontSize=16;fontColor=#000000;strokeColor=#000000;" parent="1" target="27" edge="1">
8+
<mxGeometry relative="1" as="geometry">
9+
<mxPoint x="-29" y="211" as="sourcePoint"/>
10+
</mxGeometry>
11+
</mxCell>
12+
<mxCell id="26" value="&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;API Gateway&lt;/span&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
13+
<mxGeometry x="-164.5" y="261" width="193" height="30" as="geometry"/>
14+
</mxCell>
15+
<mxCell id="33" style="edgeStyle=none;html=1;strokeColor=#000000;" parent="1" source="27" target="32" edge="1">
16+
<mxGeometry relative="1" as="geometry"/>
17+
</mxCell>
18+
<mxCell id="27" 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=#F78E04;gradientDirection=north;fillColor=#D05C17;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.lambda;" parent="1" vertex="1">
19+
<mxGeometry x="173" y="172" width="78" height="78" as="geometry"/>
20+
</mxCell>
21+
<mxCell id="28" value="&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;Lambda&lt;/span&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
22+
<mxGeometry x="115.5" y="261" width="193" height="30" as="geometry"/>
23+
</mxCell>
24+
<mxCell id="30" value="&lt;div style=&quot;text-align: start;&quot;&gt;&lt;font face=&quot;Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji&quot; color=&quot;#000000&quot;&gt;&lt;span style=&quot;font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;invoke&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
25+
<mxGeometry x="-24" y="181" width="193" height="30" as="geometry"/>
26+
</mxCell>
27+
<mxCell id="32" 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]];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=#F34482;gradientDirection=north;fillColor=#BC1356;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.cloudwatch_2;" parent="1" vertex="1">
28+
<mxGeometry x="173" y="28" width="78" height="78" as="geometry"/>
29+
</mxCell>
30+
<mxCell id="34" value="&lt;span style=&quot;font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; text-align: start; background-color: rgb(255, 255, 255);&quot;&gt;&lt;font style=&quot;&quot; color=&quot;#000000&quot;&gt;CloudWatch&lt;/font&gt;&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
31+
<mxGeometry x="251" y="76" width="104" height="30" as="geometry"/>
32+
</mxCell>
33+
<mxCell id="35" value="&lt;span style=&quot;font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; text-align: start; background-color: rgb(255, 255, 255);&quot;&gt;&lt;font style=&quot;&quot; color=&quot;#000000&quot;&gt;Logging&lt;/font&gt;&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
34+
<mxGeometry x="135" y="124" width="78" height="30" as="geometry"/>
35+
</mxCell>
36+
<mxCell id="36" 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=#FF4F8B;gradientDirection=north;fillColor=#BC1356;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.api_gateway;" vertex="1" parent="1">
37+
<mxGeometry x="-107" y="172" width="78" height="78" as="geometry"/>
38+
</mxCell>
39+
<mxCell id="41" style="edgeStyle=none;html=1;strokeColor=#2c1c1c;" edge="1" parent="1" source="40">
40+
<mxGeometry relative="1" as="geometry">
41+
<mxPoint x="-108" y="211" as="targetPoint"/>
42+
</mxGeometry>
43+
</mxCell>
44+
<mxCell id="40" 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;" vertex="1" parent="1">
45+
<mxGeometry x="-319" y="172" width="78" height="78" as="geometry"/>
46+
</mxCell>
47+
<mxCell id="42" value="&lt;div style=&quot;text-align: start;&quot;&gt;&lt;font face=&quot;Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji&quot; color=&quot;#000000&quot;&gt;&lt;span style=&quot;font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;Request&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
48+
<mxGeometry x="-266" y="179" width="193" height="30" as="geometry"/>
49+
</mxCell>
50+
</root>
51+
</mxGraphModel>
52+
</diagram>
53+
</mxfile>
Loading

0 commit comments

Comments
 (0)