Created: 2023-08-11 | Updated: 2024-08-11
Lambda Function
New (v0.2.0)
Table of contents
Node Type: lambda_function
Rendering:
Code Snippet:
# given
mcd = MultiCloudDiagrams()
# when
func_arn = 'arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda'
metadata = {
"CodeSize": 1234,
"Handler": "main",
"Layers": 0,
"Memory": 128,
"PackageType": "Zip",
"Runtime": "go1.x",
"Timeout": 30,
"TracingConfig": "{'Mode': 'Active'}",
"Version": "$LATEST"
}
mcd.add_vertex(node_id=func_arn, node_name='producer-lambda', node_type='lambda_function', metadata=metadata)
drawio lambda_function vertex:
<mxCell id="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" parent="1" vertex="1">
<mxGeometry width="69" height="72" as="geometry"/>
</mxCell>
Advanced for Geeks:
Style:
style="verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.aws3.lambda_function;prIcon=server;fillColor=#F58534;gradientColor=none;html=1;"
attribute | value |
---|---|
align | left |
aspect | fixed |
fillColor | #F58534 |
gradientColor | none |
html | 1 |
pointerEvents | 1 |
prIcon | server |
shape | mxgraph.aws3.lambda_function |
verticalAlign | top |
verticalLabelPosition | bottom |
Vertex size:
attribute | value |
---|---|
width | 69 |
height | 72 |
Full XML dump:
<mxfile host="multicloud-diagrams" agent="PIP package multicloud-diagrams. Generate resources in draw.io compatible format for Cloud infrastructure. Copyrights @ Roman Tsypuk 2023. MIT license." type="MultiCloud">
<diagram id="diagram_1" name="AWS components">
<mxGraphModel dx="1015" dy="661" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="1">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" value="<b>Name</b>: producer-lambda<BR><b>ARN</b>: arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda<BR>-----------<BR><b>CodeSize</b>: 1234<BR><b>Handler</b>: main<BR><b>Layers</b>: 0<BR><b>Memory</b>: 128<BR><b>PackageType</b>: Zip<BR><b>Runtime</b>: go1.x<BR><b>Timeout</b>: 30<BR><b>TracingConfig</b>: {'Mode': 'Active'}<BR><b>Version</b>: $LATEST" style="verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.aws3.lambda_function;prIcon=server;fillColor=#F58534;gradientColor=none;html=1;" parent="1" vertex="1">
<mxGeometry width="69" height="72" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
drawio file:
Download generated lambda_function.drawio
: