Skip to content

Commit

Permalink
feat: add aws s3 glacier node
Browse files Browse the repository at this point in the history
  • Loading branch information
tsypuk committed Feb 6, 2024
1 parent 5bbdb6c commit 5acff2f
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 0 deletions.
92 changes: 92 additions & 0 deletions docs/docs/aws-components/glacier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
layout: default
title: Amazon S3 Glacier
parent: AWS Components
nav_order: 3
date: 2024-02-06
---

# Amazon S3 Glacier
{: .d-inline-block .no_toc }

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

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

1. TOC
{:toc}

---


## Node Type: ``glacier``

## Rendering:

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

## Code Snippet:

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

## drawio glacier vertex:

```xml
<mxCell id="vertex:glacier:arn:aws:glacier:::content_bucket" parent="1" vertex="1">
<mxGeometry width="76.5" height="93" as="geometry"/>
</mxCell>
```
---

## Advanced for Geeks:

### Style:
```html
style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.glacier;fillColor=#E05243;gradientColor=none;"
```

| attribute | value |
|:----------|:------|
|align| left |
|dashed| 0 |
|fillColor| #E05243 |
|gradientColor| none |
|html| 1 |
|outlineConnect| 0 |
|shape| mxgraph.aws3.glacier |
|verticalAlign| top |
|verticalLabelPosition| bottom |

### Vertex size:

| attribute | value |
|:---------|:-----------|
| width | 76.5 |
| height |93|

### 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:glacier:arn:aws:glacier:::content_bucket" value="&lt;b&gt;Name&lt;/b&gt;: content_bucket&lt;BR&gt;&lt;b&gt;ARN&lt;/b&gt;: arn:aws:glacier:::content_bucket&lt;BR&gt;-----------&lt;BR&gt;&lt;b&gt;x-amz-bucket-region&lt;/b&gt;: eu-west-1&lt;BR&gt;&lt;b&gt;CreationDate&lt;/b&gt;: 2023-11-11&lt;BR&gt;&lt;b&gt;AbortIncompleteMultipartUpload&lt;/b&gt;: {'DaysAfterInitiation': 5}&lt;BR&gt;&lt;b&gt;Expiration&lt;/b&gt;: {'Days': 90}&lt;BR&gt;&lt;b&gt;MFADelete&lt;/b&gt;: Disabled" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.glacier;fillColor=#E05243;gradientColor=none;" parent="1" vertex="1">
<mxGeometry width="76.5" height="93" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
```

### drawio file:

Download generated ``glacier.drawio``:

[Download](output/drawio/glacier.drawio){: .btn .btn-purple }
13 changes: 13 additions & 0 deletions docs/docs/aws-components/output/drawio/glacier.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:glacier:arn:aws:glacier:::content_bucket" value="&lt;b&gt;Name&lt;/b&gt;: content_bucket&lt;BR&gt;&lt;b&gt;ARN&lt;/b&gt;: arn:aws:glacier:::content_bucket&lt;BR&gt;-----------&lt;BR&gt;&lt;b&gt;x-amz-bucket-region&lt;/b&gt;: eu-west-1&lt;BR&gt;&lt;b&gt;CreationDate&lt;/b&gt;: 2023-11-11&lt;BR&gt;&lt;b&gt;AbortIncompleteMultipartUpload&lt;/b&gt;: {'DaysAfterInitiation': 5}&lt;BR&gt;&lt;b&gt;Expiration&lt;/b&gt;: {'Days': 90}&lt;BR&gt;&lt;b&gt;MFADelete&lt;/b&gt;: Disabled" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.glacier;fillColor=#E05243;gradientColor=none;" parent="1" vertex="1">
<mxGeometry width="76.5" height="93" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file added docs/docs/aws-components/output/jpg/glacier.jpg
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 @@ -172,5 +172,12 @@
"height": "78",
"version": "0.3.25",
"desc": "Amazon Aurora"
},
"glacier": {
"style": "outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.glacier;fillColor=#E05243;gradientColor=none;",
"width": "76.5",
"height": "93",
"version": "0.3.27",
"desc": "Amazon S3 Glacier"
}
}
42 changes: 42 additions & 0 deletions tests/aws/test_glacier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from multicloud_diagrams import MultiCloudDiagrams
from utils.templating import TestRendering


class TestAWSVertexInIsolation(TestRendering):

def test_glacier(self):
# docs
self.node_type = 'glacier'

# given
mcd = MultiCloudDiagrams()

# when
glacier_arn = 'arn:aws:glacier:::content_bucket'

metadata = {
'x-amz-bucket-region': 'eu-west-1',
'CreationDate': '2023-11-11',
'AbortIncompleteMultipartUpload': "{'DaysAfterInitiation': 5}",
'Expiration': "{'Days': 90}",
'MFADelete': 'Disabled'
}

mcd.add_vertex(node_id=glacier_arn, node_name='content_bucket', node_type='glacier', metadata=metadata)

# then
expected = {'id': 'vertex:glacier:arn:aws:glacier:::content_bucket',
'parent': '1',
'style': 'outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.glacier;fillColor=#E05243;gradientColor=none;',
'value': '<b>Name</b>: content_bucket<BR><b>ARN</b>: '
'arn:aws:glacier:::content_bucket<BR>-----------<BR><b>x-amz-bucket-region</b>: '
'eu-west-1<BR><b>CreationDate</b>: '
'2023-11-11<BR><b>AbortIncompleteMultipartUpload</b>: '
"{'DaysAfterInitiation': 5}<BR><b>Expiration</b>: {'Days': "
'90}<BR><b>MFADelete</b>: Disabled',
'vertex': '1'}

self.verify_resource(expected, mcd.mx_file, 'content_bucket', 'glacier')

# docs
self.mcd = mcd

0 comments on commit 5acff2f

Please sign in to comment.