Created: 2023-08-11 | Updated: 2024-09-21

Lambda Function

New (v0.2.0)

Table of contents

  1. Node Type: lambda_function
  2. Rendering:
  3. Code Snippet:
  4. drawio lambda_function vertex:
  5. Advanced for Geeks:
    1. Style:
    2. Vertex size:
    3. Full XML dump:
    4. drawio file:

Node Type: lambda_function

Rendering:

lambda

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;"
attributevalue
alignleft
aspectfixed
fillColor#F58534
gradientColornone
html1
pointerEvents1
prIconserver
shapemxgraph.aws3.lambda_function
verticalAligntop
verticalLabelPositionbottom

Vertex size:

attributevalue
width69
height72

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="&lt;b&gt;Name&lt;/b&gt;: producer-lambda&lt;BR&gt;&lt;b&gt;ARN&lt;/b&gt;: arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda&lt;BR&gt;-----------&lt;BR&gt;&lt;b&gt;CodeSize&lt;/b&gt;: 1234&lt;BR&gt;&lt;b&gt;Handler&lt;/b&gt;: main&lt;BR&gt;&lt;b&gt;Layers&lt;/b&gt;: 0&lt;BR&gt;&lt;b&gt;Memory&lt;/b&gt;: 128&lt;BR&gt;&lt;b&gt;PackageType&lt;/b&gt;: Zip&lt;BR&gt;&lt;b&gt;Runtime&lt;/b&gt;: go1.x&lt;BR&gt;&lt;b&gt;Timeout&lt;/b&gt;: 30&lt;BR&gt;&lt;b&gt;TracingConfig&lt;/b&gt;: {'Mode': 'Active'}&lt;BR&gt;&lt;b&gt;Version&lt;/b&gt;: $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:

Download