-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added reload coordinates from previous file version; added samp…
…les for aws iam
- Loading branch information
Showing
8 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
venv/ | ||
|
||
dist/ | ||
|
||
/__pycache__/ | ||
*.iml | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mxfile host="drawio-plugin" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36" modified="2023-05-14T18:06:49.551Z" version="20.5.3" etag="Cm7ZALJA5nENWioBdHw4" type="embed"><diagram id="diagram_1" name="AWS components"><mxGraphModel dx="618" dy="1680" 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="0"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789:function:prod-lambda-name" value="<b>Name</b>: prod-lambda-name<BR><b>ARN</b>: arn:aws:lambda:eu-west-1:123456789:function:prod-lambda-name " style="verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;verticalLabelPosition=bottom;html=1;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 x="320" y="-40" width="69" height="72" as="geometry"/></mxCell><mxCell id="vertex:iam_role:arn:aws:iam::123456789:role/prod-lambda-name" value="<b>Name</b>: role-lambda-name<BR><b>ARN</b>: arn:aws:iam::123456789:role/prod-lambda-name " style="verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.role;fillColor=#759C3E;gradientColor=none;" parent="1" vertex="1"><mxGeometry x="350" y="180" width="94.5" height="79.5" as="geometry"/></mxCell><mxCell id="edge:lambda_function:arn:aws:lambda:eu-west-1:123456789:function:prod-lambda-name:to:iam_role:arn:aws:iam::123456789:role/prod-lambda-name" style="endFill=0;endArrow=none;endArrow=none;" parent="1" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789:function:prod-lambda-name" target="vertex:iam_role:arn:aws:iam::123456789:role/prod-lambda-name" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="vertex:iam_policy:arn:aws:iam::123456789:policy/prod-cloudwatch-policy" value="<b>Name</b>: prod-cloudwatch-policy<BR><b>ARN</b>: arn:aws:iam::123456789:policy/prod-cloudwatch-policy " style="verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;fillColor=#3F8624;strokeColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;pointerEvents=1;shape=mxgraph.aws4.policy;" parent="1" vertex="1"><mxGeometry x="40" y="270" width="78" height="67" as="geometry"/></mxCell><mxCell id="edge:iam_role:arn:aws:iam::123456789:role/prod-lambda-name:to:iam_policy:arn:aws:iam::123456789:policy/prod-cloudwatch-policy" style="endFill=0;endArrow=none;endArrow=none;" parent="1" source="vertex:iam_role:arn:aws:iam::123456789:role/prod-lambda-name" target="vertex:iam_policy:arn:aws:iam::123456789:policy/prod-cloudwatch-policy" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="vertex:iam_policy:arn:aws:iam::123456789:policy/prod-s3-policy" value="<b>Name</b>: prod-s3-policy<BR><b>ARN</b>: arn:aws:iam::123456789:policy/prod-s3-policy " style="verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;fillColor=#3F8624;strokeColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;pointerEvents=1;shape=mxgraph.aws4.policy;" parent="1" vertex="1"><mxGeometry x="270" y="400" width="78" height="67" as="geometry"/></mxCell><mxCell id="edge:iam_role:arn:aws:iam::123456789:role/prod-lambda-name:to:iam_policy:arn:aws:iam::123456789:policy/prod-s3-policy" style="endFill=0;endArrow=none;endArrow=none;" parent="1" source="vertex:iam_role:arn:aws:iam::123456789:role/prod-lambda-name" target="vertex:iam_policy:arn:aws:iam::123456789:policy/prod-s3-policy" edge="2"><mxGeometry as="geometry"/></mxCell></root></mxGraphModel></diagram></mxfile> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[tool.poetry] | ||
name = "samples" | ||
version = "0.1.0" | ||
description = "Sample code example HOW-TO use multicloud-diagrams" | ||
authors = ["Roman Tsypuk <tsypuk.conf@gmail.com>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
multicloud-diagrams = "^0.2.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from multicloud_diagrams import MultiCloudDiagrams | ||
|
||
|
||
def main(): | ||
mcd = MultiCloudDiagrams() | ||
|
||
prefix = 'prod' | ||
roles_file = f'../output/iam_output.{prefix}.iam-roles.drawio' | ||
|
||
mcd.read_coords_from_file(roles_file) | ||
|
||
func_arn = 'arn:aws:lambda:eu-west-1:123456789:function:prod-lambda-name' | ||
mcd.add_vertex(id=func_arn, node_name='prod-lambda-name', arn=func_arn, node_type='lambda_function') | ||
role_arn = 'arn:aws:iam::123456789:role/prod-lambda-name' | ||
mcd.add_vertex(id=role_arn, node_name='role-lambda-name', arn=role_arn, node_type='iam_role') | ||
mcd.add_link(src_node_id="lambda_function:" + func_arn, dst_node_id="iam_role:" + role_arn) | ||
|
||
cw_policy_arn = "arn:aws:iam::123456789:policy/prod-cloudwatch-policy" | ||
mcd.add_vertex(id=cw_policy_arn, node_name='prod-cloudwatch-policy', arn=cw_policy_arn, node_type='iam_policy') | ||
mcd.add_link("iam_role:" + role_arn, "iam_policy:" + cw_policy_arn) | ||
|
||
s3_policy_arn = "arn:aws:iam::123456789:policy/prod-s3-policy" | ||
mcd.add_vertex(id=s3_policy_arn, node_name='prod-s3-policy', arn=s3_policy_arn, node_type='iam_policy') | ||
mcd.add_link("iam_role:" + role_arn, "iam_policy:" + s3_policy_arn) | ||
|
||
mcd.export_to_file(roles_file) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Empty file.