-
-
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.
tests: migrate for aws nodes; linked to online documentation
- Loading branch information
Showing
11 changed files
with
213 additions
and
207 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
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
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,32 @@ | ||
--- | ||
layout: default | ||
title: SNS (Simple Notification Service) | ||
parent: AWS Components | ||
nav_order: 4 | ||
--- | ||
|
||
# SNS (Simple Notification Service) | ||
{: .d-inline-block } | ||
|
||
New (v0.2.0) | ||
{: .label .label-green } | ||
|
||
## Code Snippet: | ||
|
||
```python | ||
{% root_include ../tests/aws/test_sns.py 9:19 %} | ||
``` | ||
|
||
## Rendering: | ||
|
||
<div class="code-example" markdown="1"> | ||
|
||
| head1 | head two | three | | ||
|:-------------|:------------------|:------| | ||
| ok | good swedish fish | nice | | ||
| out of stock | good and plenty | nice | | ||
| ok | good `oreos` | hmm | | ||
| ok | good `zoute` drop | yumm | | ||
|
||
TODO: add image here | ||
</div> |
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 |
---|---|---|
@@ -1,95 +1,32 @@ | ||
--- | ||
layout: default | ||
title: SQS | ||
title: SQS (Simple Queue Service) | ||
parent: AWS Components | ||
nav_order: 2 | ||
nav_order: 3 | ||
--- | ||
|
||
# SQS | ||
{: .no_toc } | ||
# SQS (Simple Queue Service) | ||
{: .d-inline-block } | ||
|
||
## Table of contents | ||
{: .no_toc .text-delta } | ||
New (v0.2.0) | ||
{: .label .label-green } | ||
|
||
1. TOC | ||
{:toc} | ||
## Code Snippet: | ||
|
||
--- | ||
|
||
## Basic button styles | ||
|
||
### Links that look like buttons | ||
|
||
<div class="code-example" markdown="1"> | ||
[Link button](http://example.com/){: .btn } | ||
|
||
[Link button](http://example.com/){: .btn .btn-purple } | ||
[Link button](http://example.com/){: .btn .btn-blue } | ||
[Link button](http://example.com/){: .btn .btn-green } | ||
|
||
[Link button](http://example.com/){: .btn .btn-outline } | ||
</div> | ||
```markdown | ||
[Link button](http://example.com/){: .btn } | ||
|
||
[Link button](http://example.com/){: .btn .btn-purple } | ||
[Link button](http://example.com/){: .btn .btn-blue } | ||
[Link button](http://example.com/){: .btn .btn-green } | ||
|
||
[Link button](http://example.com/){: .btn .btn-outline } | ||
``` | ||
|
||
### Button element | ||
|
||
GitHub Flavored Markdown does not support the `button` element, so you'll have to use inline HTML for this: | ||
|
||
<div class="code-example"> | ||
<button type="button" name="button" class="btn">Button element</button> | ||
</div> | ||
```html | ||
<button type="button" name="button" class="btn">Button element</button> | ||
```python | ||
{% root_include ../tests/aws/test_sqs.py 9:21 %} | ||
``` | ||
|
||
--- | ||
|
||
## Using utilities with buttons | ||
|
||
### Button size | ||
|
||
## Rendering: | ||
|
||
<div class="code-example" markdown="1"> | ||
<span class="fs-6"> | ||
[Big ass button](http://example.com/){: .btn } | ||
</span> | ||
|
||
<span class="fs-3"> | ||
[Tiny ass button](http://example.com/){: .btn } | ||
</span> | ||
</div> | ||
```markdown | ||
<span class="fs-8"> | ||
[Link button](http://example.com/){: .btn } | ||
</span> | ||
|
||
<span class="fs-3"> | ||
[Tiny ass button](http://example.com/){: .btn } | ||
</span> | ||
``` | ||
|
||
### Spacing between buttons | ||
| head1 | head two | three | | ||
|:-------------|:------------------|:------| | ||
| ok | good swedish fish | nice | | ||
| out of stock | good and plenty | nice | | ||
| ok | good `oreos` | hmm | | ||
| ok | good `zoute` drop | yumm | | ||
|
||
|
||
<div class="code-example" markdown="1"> | ||
[Button with space](http://example.com/){: .btn .btn-purple .mr-2 } | ||
[Button](http://example.com/){: .btn .btn-blue } | ||
|
||
[Button with more space](http://example.com/){: .btn .btn-green .mr-4 } | ||
[Button](http://example.com/){: .btn .btn-blue } | ||
TODO: add image here | ||
</div> | ||
```markdown | ||
[Button with space](http://example.com/){: .btn .btn-purple .mr-2 } | ||
[Button](http://example.com/){: .btn .btn-blue } | ||
|
||
[Button with more space](http://example.com/){: .btn .btn-green .mr-4 } | ||
[Button](http://example.com/){: .btn .btn-blue } | ||
``` |
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
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
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,31 @@ | ||
from multicloud_diagrams import MultiCloudDiagrams | ||
|
||
from utils.utils import TestUtilities | ||
# NOTE!!! Content of this file is mapped to documentation with lines position | ||
|
||
class TestAWSVertexInIsolation(TestUtilities): | ||
|
||
def test_dynamo(self): | ||
# given | ||
mcd = MultiCloudDiagrams() | ||
|
||
# when | ||
table_arn = 'arn:aws:dynamodb:eu-west-1:123456789012:table/prod-dynamo-table' | ||
table_name = 'prod-dynamo-table' | ||
metadata = { | ||
'DeletionProtectionEnabled': True, | ||
'ItemCount': 900, | ||
'TableSizeBytes': 123 | ||
} | ||
mcd.add_vertex(node_id=table_arn, node_name=table_name, arn=table_arn, node_type='dynamo', metadata=metadata) | ||
|
||
# then | ||
expected = { | ||
'id': 'vertex:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/prod-dynamo-table', | ||
'value': ('<b>Name</b>: prod-dynamo-table<BR><b>ARN</b>: arn:aws:dynamodb:eu-west-1:123456789012:table/prod-dynamo-table' | ||
'<BR>-----------<BR>' | ||
'<b>DeletionProtectionEnabled</b>: True<BR><b>ItemCount</b>: 900<BR><b>TableSizeBytes</b>: 123'), | ||
'parent': '1', | ||
'vertex': '1' | ||
} | ||
self.verify_aws_resource(expected, mcd.mx_file, 'prod-dynamo-table', 'dynamo') |
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,37 @@ | ||
from multicloud_diagrams import MultiCloudDiagrams | ||
|
||
from utils.utils import TestUtilities | ||
# NOTE!!! Content of this file is mapped to documentation with lines position | ||
|
||
class TestAWSVertexInIsolation(TestUtilities): | ||
|
||
def test_lambda(self): | ||
# 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', arn=func_arn, node_type='lambda_function', metadata=metadata) | ||
|
||
# then | ||
expected = { | ||
'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", | ||
'parent': '1', | ||
'vertex': '1' | ||
} | ||
self.verify_aws_resource(expected, mcd.mx_file, 'producer-lambda', 'lambda_function') |
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 | ||
|
||
from utils.utils import TestUtilities | ||
# NOTE!!! Content of this file is mapped to documentation with lines position | ||
|
||
class TestAWSVertexInIsolation(TestUtilities): | ||
|
||
def test_sns(self): | ||
# given | ||
mcd = MultiCloudDiagrams() | ||
|
||
# when | ||
sns_arn = 'arn:aws:sns:eu-west-1:123456789012:internal.fifo' | ||
metadata = { | ||
"Owner": 123456789012, | ||
"SubscriptionsConfirmed": 3, | ||
"SubscriptionsPending": 0 | ||
} | ||
mcd.add_vertex(node_id=sns_arn, node_name='internal.fifo', arn=sns_arn, node_type='sns', metadata=metadata) | ||
|
||
# then | ||
expected = { | ||
'id': 'vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo', | ||
'value': '<b>Name</b>: internal.fifo<BR><b>ARN</b>: arn:aws:sns:eu-west-1:123456789012:internal.fifo' | ||
'<BR>-----------<BR>' | ||
'<b>Owner</b>: 123456789012<BR><b>SubscriptionsConfirmed</b>: 3<BR><b>SubscriptionsPending</b>: 0', | ||
'parent': '1', | ||
'vertex': '1' | ||
} | ||
self.verify_aws_resource(expected, mcd.mx_file, 'internal.fifo', 'sns') |
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,32 @@ | ||
from multicloud_diagrams import MultiCloudDiagrams | ||
|
||
from utils.utils import TestUtilities | ||
# NOTE!!! Content of this file is mapped to documentation with lines position | ||
|
||
class TestAWSVertexInIsolation(TestUtilities): | ||
|
||
def test_sqs(self): | ||
# given | ||
mcd = MultiCloudDiagrams() | ||
|
||
# when | ||
sqs_arn = 'arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo' | ||
metadata = { | ||
"DelaySeconds": 0, | ||
"FifoQueue": "TRUE", | ||
"ReceiveMessageWaitTimeSeconds": 0, | ||
"SqsManagedSseEnabled": "false", | ||
"VisibilityTimeout": 30 | ||
} | ||
mcd.add_vertex(node_id=sqs_arn, node_name='int-eu-live-events.fifo', arn=sqs_arn, node_type='sqs', metadata=metadata) | ||
|
||
# then | ||
expected = { | ||
'id': 'vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo', | ||
'value': '<b>Name</b>: int-eu-live-events.fifo<BR><b>ARN</b>: arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo' | ||
'<BR>-----------<BR>' | ||
'<b>DelaySeconds</b>: 0<BR><b>FifoQueue</b>: TRUE<BR><b>ReceiveMessageWaitTimeSeconds</b>: 0<BR><b>SqsManagedSseEnabled</b>: false<BR><b>VisibilityTimeout</b>: 30', | ||
'parent': '1', | ||
'vertex': '1' | ||
} | ||
self.verify_aws_resource(expected, mcd.mx_file, 'int-eu-live-events.fifo', 'sqs') |
Oops, something went wrong.