Skip to content

Commit

Permalink
feat: added aws certificate manager node
Browse files Browse the repository at this point in the history
  • Loading branch information
tsypuk committed Sep 17, 2023
1 parent 74992aa commit d1945b6
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 0 deletions.
99 changes: 99 additions & 0 deletions docs/docs/aws-components/certificate_manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
layout: default
title: Certificate Manager
parent: AWS Components
nav_order: 3
date: 2023-09-17
---

# Certificate Manager
{: .d-inline-block .no_toc }

New (v0.3.14)
{: .label .label-green }

## Table of contents
{: .no_toc .text-delta }

1. TOC
{:toc}

---


## Node Type: ``certificate_manager``

## Rendering:

![lambda](output/jpg/certificate_manager.jpg)

## Code Snippet:

```python
{% root_include_snippet ../tests/aws/test_certificate_manager.py %}
```

## drawio certificate_manager vertex:

```xml
<mxCell id="vertex:certificate_manager:arn:aws:acm:us-west-1:123456789012:certificate/cd2e" parent="1" vertex="1">
<mxGeometry width="59" height="78" as="geometry"/>
</mxCell>
```
---

## Advanced for Geeks:

### Style:
```html
style="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.certificate_manager;"
```

| attribute | value |
|:----------|:------|
|align| left |
|aspect| fixed |
|dashed| 0 |
|fillColor| #3F8624 |
|fontColor| #232F3E |
|fontSize| 12 |
|fontStyle| 0 |
|gradientColor| none |
|html| 1 |
|outlineConnect| 0 |
|pointerEvents| 1 |
|shape| mxgraph.aws4.certificate_manager |
|sketch| 0 |
|strokeColor| none |
|verticalAlign| top |
|verticalLabelPosition| bottom |

### Vertex size:

| attribute | value |
|:---------|:-----------|
| width | 59 |
| height |78|

### Full XML dump:
```xml
<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:certificate_manager:arn:aws:acm:us-west-1:123456789012:certificate/cd2e" value="&lt;b&gt;Name&lt;/b&gt;: Client Certificate&lt;BR&gt;&lt;b&gt;ARN&lt;/b&gt;: arn:aws:acm:us-west-1:123456789012:certificate/cd2e&lt;BR&gt;-----------&lt;BR&gt;&lt;b&gt;ARN&lt;/b&gt;: arn:aws:acm:us-west-1:123456789012:certificate/cd2e&lt;BR&gt;&lt;b&gt;Domain&lt;/b&gt;: client1.domain.tld&lt;BR&gt;&lt;b&gt;Type&lt;/b&gt;: Imported&lt;BR&gt;&lt;b&gt;Public Key info&lt;/b&gt;: RSA 2048&lt;BR&gt;&lt;b&gt;Signature algorithm&lt;/b&gt;: SHA-256 with RSA" style="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.certificate_manager;" parent="1" vertex="1">
<mxGeometry width="59" height="78" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
```

### drawio file:

Download generated ``certificate_manager.drawio``:

[Download](output/drawio/certificate_manager.drawio){: .btn .btn-purple }
13 changes: 13 additions & 0 deletions docs/docs/aws-components/output/drawio/certificate_manager.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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:certificate_manager:arn:aws:acm:us-west-1:123456789012:certificate/cd2e" value="&lt;b&gt;Name&lt;/b&gt;: Client Certificate&lt;BR&gt;&lt;b&gt;ARN&lt;/b&gt;: arn:aws:acm:us-west-1:123456789012:certificate/cd2e&lt;BR&gt;-----------&lt;BR&gt;&lt;b&gt;ARN&lt;/b&gt;: arn:aws:acm:us-west-1:123456789012:certificate/cd2e&lt;BR&gt;&lt;b&gt;Domain&lt;/b&gt;: client1.domain.tld&lt;BR&gt;&lt;b&gt;Type&lt;/b&gt;: Imported&lt;BR&gt;&lt;b&gt;Public Key info&lt;/b&gt;: RSA 2048&lt;BR&gt;&lt;b&gt;Signature algorithm&lt;/b&gt;: SHA-256 with RSA" style="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.certificate_manager;" parent="1" vertex="1">
<mxGeometry width="59" height="78" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions multicloud_diagrams/providers/aws.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,12 @@
"height": "78",
"version": "0.3.14",
"desc": "Client VPN"
},
"certificate_manager": {
"style": "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.certificate_manager;",
"width": "59",
"height": "78",
"version": "0.3.14",
"desc": "Certificate Manager"
}
}
39 changes: 39 additions & 0 deletions tests/aws/test_certificate_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from multicloud_diagrams import MultiCloudDiagrams
from utils.templating import TestRendering


class TestAWSVertexInIsolation(TestRendering):

def test_dynamo(self):
# docs
self.node_type = 'certificate_manager'

# given
mcd = MultiCloudDiagrams()

# when
cert_manager_arn = 'arn:aws:acm:us-west-1:123456789012:certificate/cd2e'
cert_manager_name = 'Client Certificate'
metadata = {
'ARN': 'arn:aws:acm:us-west-1:123456789012:certificate/cd2e',
'Domain': 'client1.domain.tld',
'Type': 'Imported',
'Public Key info': 'RSA 2048',
'Signature algorithm': 'SHA-256 with RSA'
}
mcd.add_vertex(node_id=cert_manager_arn, node_name=cert_manager_name, node_type='certificate_manager', metadata=metadata)

# then
expected = {'id': 'vertex:certificate_manager:arn:aws:acm:us-west-1:123456789012:certificate/cd2e',
'parent': '1',
'style': '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.certificate_manager;',
'value': '<b>Name</b>: Client Certificate<BR><b>ARN</b>: '
'arn:aws:acm:us-west-1:123456789012:certificate/cd2e<BR>-----------<BR><b>ARN</b>: '
'arn:aws:acm:us-west-1:123456789012:certificate/cd2e<BR><b>Domain</b>: '
'client1.domain.tld<BR><b>Type</b>: Imported<BR><b>Public Key '
'info</b>: RSA 2048<BR><b>Signature algorithm</b>: SHA-256 with RSA',
'vertex': '1'}
self.verify_resource(expected, mcd.mx_file, 'Client Certificate', self.node_type)

# docs
self.mcd = mcd

0 comments on commit d1945b6

Please sign in to comment.