cloud-radar 0.14.0a0__py3-none-any.whl → 0.14.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cloud_radar/cf/unit/_template.py +17 -2
- {cloud_radar-0.14.0a0.dist-info → cloud_radar-0.14.0a1.dist-info}/METADATA +3 -4
- {cloud_radar-0.14.0a0.dist-info → cloud_radar-0.14.0a1.dist-info}/RECORD +5 -5
- {cloud_radar-0.14.0a0.dist-info → cloud_radar-0.14.0a1.dist-info}/LICENSE.txt +0 -0
- {cloud_radar-0.14.0a0.dist-info → cloud_radar-0.14.0a1.dist-info}/WHEEL +0 -0
cloud_radar/cf/unit/_template.py
CHANGED
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import json
|
4
4
|
import re
|
5
|
+
import uuid
|
5
6
|
from pathlib import Path
|
6
7
|
from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Union
|
7
8
|
|
@@ -26,8 +27,8 @@ class Template:
|
|
26
27
|
NoValue: str = "" # Not yet implemented
|
27
28
|
Partition: str = "aws" # Other regions not implemented
|
28
29
|
Region: str = "us-east-1"
|
29
|
-
StackId: str = "" #
|
30
|
-
StackName: str = ""
|
30
|
+
StackId: str = "" # If left blank this will be generated
|
31
|
+
StackName: str = "my-cloud-radar-stack"
|
31
32
|
URLSuffix: str = "amazonaws.com" # Other regions not implemented
|
32
33
|
|
33
34
|
def __init__(
|
@@ -310,6 +311,19 @@ class Template:
|
|
310
311
|
|
311
312
|
return template
|
312
313
|
|
314
|
+
# If the StackId variable is not set, generate a value for it
|
315
|
+
def _get_populated_stack_id(self) -> str:
|
316
|
+
if not Template.StackId:
|
317
|
+
# Not explicitly set, generate a value
|
318
|
+
unique_uuid = uuid.uuid4()
|
319
|
+
|
320
|
+
return (
|
321
|
+
f"arn:{Template.Partition}:cloudformation:{self.Region}:"
|
322
|
+
f"{Template.AccountId}:stack/{Template.StackName}/{unique_uuid}"
|
323
|
+
)
|
324
|
+
|
325
|
+
return Template.StackId
|
326
|
+
|
313
327
|
def create_stack(
|
314
328
|
self,
|
315
329
|
params: Optional[Dict[str, str]] = None,
|
@@ -318,6 +332,7 @@ class Template:
|
|
318
332
|
):
|
319
333
|
if region:
|
320
334
|
self.Region = region
|
335
|
+
self.StackId = self._get_populated_stack_id()
|
321
336
|
|
322
337
|
self.render(params, parameters_file=parameters_file)
|
323
338
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: cloud-radar
|
3
|
-
Version: 0.14.
|
3
|
+
Version: 0.14.0a1
|
4
4
|
Summary: Run functional tests on cloudformation stacks.
|
5
5
|
Home-page: https://github.com/DontShaveTheYak/cloud-radar
|
6
6
|
License: Apache-2.0
|
@@ -200,8 +200,8 @@ The default values for pseudo parameters:
|
|
200
200
|
| **NoValue** | "" |
|
201
201
|
| **Partition** | "aws" |
|
202
202
|
| Region | "us-east-1" |
|
203
|
-
|
|
204
|
-
|
|
203
|
+
| StackId | (generated based on other values) |
|
204
|
+
| StackName | "my-cloud-radar-stack" |
|
205
205
|
| **URLSuffix** | "amazonaws.com" |
|
206
206
|
_Note: Bold variables are not fully implemented yet see the [Roadmap](#roadmap)_
|
207
207
|
|
@@ -356,7 +356,6 @@ A real functional testing example using Pytest can be seen [here](./tests/test_c
|
|
356
356
|
### Unit
|
357
357
|
- Add full functionality to pseudo variables.
|
358
358
|
* Variables like `Partition`, `URLSuffix` should change if the region changes.
|
359
|
-
* Variables like `StackName` and `StackId` should have a better default than ""
|
360
359
|
- Handle References to resources that shouldn't exist.
|
361
360
|
* It's currently possible that a `!Ref` to a Resource stays in the final template even if that resource is later removed because of a conditional.
|
362
361
|
|
@@ -9,10 +9,10 @@ cloud_radar/cf/unit/_output.py,sha256=rhQQ4aJu06bxAoG7GOXkuOPzAmLCrTA2Ytb8rNXA4V
|
|
9
9
|
cloud_radar/cf/unit/_parameter.py,sha256=AdPIqc2ggSW1VR0USF30zjphX3z1HHbGKQt8n-Kzhfo,3199
|
10
10
|
cloud_radar/cf/unit/_resource.py,sha256=dWaR-5s6ea5mIu6Dhf1hY31Wd4WLHbHsbyxnu2Tz6QI,8512
|
11
11
|
cloud_radar/cf/unit/_stack.py,sha256=_S0L9O7Lw-QAJDKubClp2b6UYtYfyzg272_7WQkUdo8,5785
|
12
|
-
cloud_radar/cf/unit/_template.py,sha256=
|
12
|
+
cloud_radar/cf/unit/_template.py,sha256=ESpor5rputwtCKJuvlfp_M0VUuYrciRaLNE8TfdqhRU,32782
|
13
13
|
cloud_radar/cf/unit/functions.py,sha256=iWBhc9JmyObusAAZ2iAXf7dXof36mdqoHOLR4UzuC58,29234
|
14
14
|
cloud_radar/cf/unit/test__template.py,sha256=jVPMJTn6Q0sSZ8BjRGyutuR9-NjdHdwDTVsd2kvjQbs,1491
|
15
|
-
cloud_radar-0.14.
|
16
|
-
cloud_radar-0.14.
|
17
|
-
cloud_radar-0.14.
|
18
|
-
cloud_radar-0.14.
|
15
|
+
cloud_radar-0.14.0a1.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
16
|
+
cloud_radar-0.14.0a1.dist-info/METADATA,sha256=bnK78rCtNf-t9giZQ2I6rX7NKK24xIcYLz_4lA_ATkE,16756
|
17
|
+
cloud_radar-0.14.0a1.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
18
|
+
cloud_radar-0.14.0a1.dist-info/RECORD,,
|
File without changes
|
File without changes
|