BuzzerboyAWSLightsail 0.331.1__tar.gz → 0.333.1__tar.gz

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.
Files changed (28) hide show
  1. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/BuzzerboyAWSLightsail.egg-info/PKG-INFO +91 -1
  2. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/BuzzerboyAWSLightsail.egg-info/SOURCES.txt +6 -0
  3. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/ArchitectureMaker.py +229 -0
  4. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/BuzzerboyAWSLightsailStack/LightSailPostDeploy.py +0 -0
  5. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/BuzzerboyAWSLightsailStack/LightsailAIContainer.py +0 -0
  6. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/BuzzerboyAWSLightsailStack/LightsailBase.py +4 -331
  7. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/LightsailBaseStandalone.py +154 -0
  8. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/LightsailContainer.py +145 -0
  9. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/LightsailContainerStandalone.py +149 -0
  10. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/LightsailDatabase.py +121 -0
  11. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/LightsailDatabaseStandalone.py +121 -0
  12. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/LightsailFlags.py +38 -0
  13. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/LightsailMixins.py +542 -0
  14. buzzerboyawslightsail-0.333.1/BuzzerboyAWSLightsailStack/__init__.py +1 -0
  15. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/LICENSE +0 -0
  16. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/PKG-INFO +91 -1
  17. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/README.md +107 -17
  18. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/pyproject.toml +1 -1
  19. buzzerboyawslightsail-0.331.1/BuzzerboyAWSLightsailStack/LightsailContainer.py +0 -381
  20. buzzerboyawslightsail-0.331.1/BuzzerboyAWSLightsailStack/LightsailDatabase.py +0 -484
  21. buzzerboyawslightsail-0.331.1/BuzzerboyAWSLightsailStack/__init__.py +0 -0
  22. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/BuzzerboyAWSLightsail.egg-info/dependency_links.txt +0 -0
  23. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/BuzzerboyAWSLightsail.egg-info/requires.txt +0 -0
  24. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/BuzzerboyAWSLightsail.egg-info/top_level.txt +0 -0
  25. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/MANIFEST.in +0 -0
  26. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/requirements.txt +0 -0
  27. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/setup.cfg +0 -0
  28. {buzzerboyawslightsail-0.331.1 → buzzerboyawslightsail-0.333.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: BuzzerboyAWSLightsail
3
- Version: 0.331.1
3
+ Version: 0.333.1
4
4
  Summary: Buzzerboy Architecture for Deploying Web Applications on AWS LightSail
5
5
  Home-page: https://www.buzzerboy.com/
6
6
  Author: Buzzerboy Inc
@@ -163,6 +163,96 @@ cdktf deploy
163
163
  cdktf destroy
164
164
  ```
165
165
 
166
+ ## ✅ ArchitectureMaker Usage
167
+
168
+ The preferred entrypoint is `ArchitectureMaker`, which builds stacks from a
169
+ simple definition dict. Examples are mirrored in the samples directory.
170
+
171
+ ### Container + Database (default)
172
+
173
+ ```python
174
+ from BuzzerboyAWSLightsailStack import ArchitectureMaker
175
+
176
+ definition = {
177
+ "product": "bb",
178
+ "name": "sample-container-db",
179
+ "tier": "dev",
180
+ "organization": "buzzerboy",
181
+ "region": "us-east-1",
182
+ }
183
+
184
+ ArchitectureMaker.auto_main(definition, include_compliance=False)
185
+ ```
186
+
187
+ ### Container Only
188
+
189
+ ```python
190
+ from BuzzerboyAWSLightsailStack import ArchitectureMaker
191
+
192
+ definition = {
193
+ "product": "bb",
194
+ "name": "sample-container",
195
+ "tier": "dev",
196
+ "organization": "buzzerboy",
197
+ "region": "us-east-1",
198
+ }
199
+
200
+ ArchitectureMaker.auto_main_container_only(definition, include_compliance=False)
201
+ ```
202
+
203
+ ### Database Only
204
+
205
+ ```python
206
+ from BuzzerboyAWSLightsailStack import ArchitectureMaker
207
+
208
+ definition = {
209
+ "product": "bb",
210
+ "name": "sample-db",
211
+ "tier": "dev",
212
+ "organization": "buzzerboy",
213
+ "region": "us-east-1",
214
+ "databases": ["app_db", "analytics_db", "logging_db", "audit_db"],
215
+ }
216
+
217
+ ArchitectureMaker.auto_stack_db_only(definition, include_compliance=False)
218
+ ```
219
+
220
+ ### Example `cdktf.json`
221
+
222
+ ```json
223
+ {
224
+ "language": "python",
225
+ "app": "python main.py",
226
+ "projectId": "9bad9bb7-b21d-4513-9ce9-74a6e2f7e0d9",
227
+ "sendCrashReports": "true",
228
+ "terraformProviders": [
229
+ "aws@~> 5.0",
230
+ "random@~> 3.5",
231
+ "null@~> 3.2"
232
+ ],
233
+ "terraformModules": [],
234
+ "codeMakerOutput": "imports",
235
+ "context": {}
236
+ }
237
+ ```
238
+
239
+ ### Example `requirements.txt`
240
+
241
+ ```text
242
+ cdktf>=0.17.0,<1.0
243
+ constructs>=10.0.0,<11.0
244
+ cdktf-cdktf-provider-aws>=12.0.0
245
+ cdktf-cdktf-provider-random>=8.0.0
246
+ cdktf-cdktf-provider-null>=9.0.0
247
+ -e ../../BuzzerboyAWSLightsail
248
+ ```
249
+
250
+ ### Sample Paths
251
+
252
+ - `samples/ContainerAndDB`
253
+ - `samples/ContainerOnly`
254
+ - `samples/DBOnly`
255
+
166
256
  ## 🛠 Useful Commands
167
257
 
168
258
  | Command | Description |
@@ -9,9 +9,15 @@ BuzzerboyAWSLightsail.egg-info/SOURCES.txt
9
9
  BuzzerboyAWSLightsail.egg-info/dependency_links.txt
10
10
  BuzzerboyAWSLightsail.egg-info/requires.txt
11
11
  BuzzerboyAWSLightsail.egg-info/top_level.txt
12
+ BuzzerboyAWSLightsailStack/ArchitectureMaker.py
12
13
  BuzzerboyAWSLightsailStack/LightSailPostDeploy.py
13
14
  BuzzerboyAWSLightsailStack/LightsailAIContainer.py
14
15
  BuzzerboyAWSLightsailStack/LightsailBase.py
16
+ BuzzerboyAWSLightsailStack/LightsailBaseStandalone.py
15
17
  BuzzerboyAWSLightsailStack/LightsailContainer.py
18
+ BuzzerboyAWSLightsailStack/LightsailContainerStandalone.py
16
19
  BuzzerboyAWSLightsailStack/LightsailDatabase.py
20
+ BuzzerboyAWSLightsailStack/LightsailDatabaseStandalone.py
21
+ BuzzerboyAWSLightsailStack/LightsailFlags.py
22
+ BuzzerboyAWSLightsailStack/LightsailMixins.py
17
23
  BuzzerboyAWSLightsailStack/__init__.py
@@ -0,0 +1,229 @@
1
+ """
2
+ ArchitectureMaker
3
+ =================
4
+
5
+ Helper routines to build common Lightsail architectures using CDKTF.
6
+ """
7
+
8
+ from typing import Any, Dict, List
9
+
10
+ from cdktf import App
11
+
12
+ from BuzzerboyAWSLightsailStack.LightsailDatabase import (
13
+ LightsailDatabaseStack,
14
+ )
15
+ from BuzzerboyAWSLightsailStack.LightsailDatabaseStandalone import (
16
+ LightsailDatabaseStandaloneStack,
17
+ )
18
+ from BuzzerboyAWSLightsailStack.LightsailContainer import (
19
+ LightsailContainerStack,
20
+ )
21
+ from BuzzerboyAWSLightsailStack.LightsailContainerStandalone import (
22
+ LightsailContainerStandaloneStack,
23
+ )
24
+ from BuzzerboyArchetypeStack.BuzzerboyArchetype import BuzzerboyArchetype
25
+
26
+
27
+ class ArchitectureMaker:
28
+ """
29
+ Factory utilities for building Lightsail architectures from a definition dict.
30
+ """
31
+
32
+ @staticmethod
33
+ def auto_stack_db_only(definition: Dict[str, Any], include_compliance: bool = False) -> App:
34
+ """
35
+ Create a DB-only Lightsail stack from a definition dictionary.
36
+
37
+ Expected keys in definition:
38
+ - product (str)
39
+ - name or app (str)
40
+ - tier (str)
41
+ - organization (str)
42
+ - region (str)
43
+ - databases (list[str])
44
+ Optional keys:
45
+ - profile (str)
46
+ - db_instance_size (str)
47
+ - master_username (str)
48
+ - flags (list[str])
49
+ """
50
+ if not isinstance(definition, dict):
51
+ raise ValueError("definition must be a dictionary")
52
+
53
+ product = definition.get("product")
54
+ app_name = definition.get("name") or definition.get("app")
55
+ tier = definition.get("tier")
56
+ organization = definition.get("organization")
57
+ region = definition.get("region")
58
+ databases = definition.get("databases", [])
59
+
60
+ missing = [key for key, value in {
61
+ "product": product,
62
+ "name/app": app_name,
63
+ "tier": tier,
64
+ "organization": organization,
65
+ "region": region,
66
+ "databases": databases,
67
+ }.items() if not value]
68
+ if missing:
69
+ raise ValueError(f"definition is missing required keys: {', '.join(missing)}")
70
+
71
+ archetype = BuzzerboyArchetype(
72
+ product=product,
73
+ app=app_name,
74
+ tier=tier,
75
+ organization=organization,
76
+ region=region,
77
+ )
78
+
79
+ flags: List[str] = list(definition.get("flags", []))
80
+ flags = list(dict.fromkeys(flags))
81
+
82
+ app = App()
83
+
84
+ stack_class = LightsailDatabaseStack if include_compliance else LightsailDatabaseStandaloneStack
85
+ stack_class(
86
+ app,
87
+ f"{archetype.get_project_name()}-db-stack",
88
+ project_name=archetype.get_project_name(),
89
+ environment=archetype.get_tier(),
90
+ region=archetype.get_region(),
91
+ secret_name=archetype.get_secret_name(),
92
+ databases=databases,
93
+ profile=definition.get("profile", "default"),
94
+ db_instance_size=definition.get("db_instance_size", "micro_2_0"),
95
+ master_username=definition.get("master_username", "dbmasteruser"),
96
+ flags=flags,
97
+ )
98
+
99
+ app.synth()
100
+ return app
101
+
102
+ @staticmethod
103
+ def auto_main_container_only(definition: Dict[str, Any], include_compliance: bool = False) -> App:
104
+ """
105
+ Create a container-only Lightsail stack from a definition dictionary.
106
+
107
+ Expected keys in definition:
108
+ - product (str)
109
+ - name or app (str)
110
+ - tier (str)
111
+ - organization (str)
112
+ - region (str)
113
+ Optional keys:
114
+ - profile (str)
115
+ - flags (list[str])
116
+ """
117
+ if not isinstance(definition, dict):
118
+ raise ValueError("definition must be a dictionary")
119
+
120
+ product = definition.get("product")
121
+ app_name = definition.get("name") or definition.get("app")
122
+ tier = definition.get("tier")
123
+ organization = definition.get("organization")
124
+ region = definition.get("region")
125
+
126
+ missing = [key for key, value in {
127
+ "product": product,
128
+ "name/app": app_name,
129
+ "tier": tier,
130
+ "organization": organization,
131
+ "region": region,
132
+ }.items() if not value]
133
+ if missing:
134
+ raise ValueError(f"definition is missing required keys: {', '.join(missing)}")
135
+
136
+ archetype = BuzzerboyArchetype(
137
+ product=product,
138
+ app=app_name,
139
+ tier=tier,
140
+ organization=organization,
141
+ region=region,
142
+ )
143
+
144
+ flags: List[str] = list(definition.get("flags", []))
145
+ flags.extend([
146
+ "skip_database",
147
+ "skip_domain",
148
+ ])
149
+ flags = list(dict.fromkeys(flags))
150
+
151
+ app = App()
152
+
153
+ stack_class = LightsailContainerStack if include_compliance else LightsailContainerStandaloneStack
154
+ stack_class(
155
+ app,
156
+ f"{archetype.get_project_name()}-stack",
157
+ project_name=archetype.get_project_name(),
158
+ environment=archetype.get_tier(),
159
+ region=archetype.get_region(),
160
+ secret_name=archetype.get_secret_name(),
161
+ profile=definition.get("profile", "default"),
162
+ flags=flags,
163
+ )
164
+
165
+ app.synth()
166
+ return app
167
+
168
+ @staticmethod
169
+ def auto_main(definition: Dict[str, Any], include_compliance: bool = False) -> App:
170
+ """
171
+ Create a container + database Lightsail stack from a definition dictionary.
172
+
173
+ Expected keys in definition:
174
+ - product (str)
175
+ - name or app (str)
176
+ - tier (str)
177
+ - organization (str)
178
+ - region (str)
179
+ Optional keys:
180
+ - profile (str)
181
+ - flags (list[str])
182
+ """
183
+ if not isinstance(definition, dict):
184
+ raise ValueError("definition must be a dictionary")
185
+
186
+ product = definition.get("product")
187
+ app_name = definition.get("name") or definition.get("app")
188
+ tier = definition.get("tier")
189
+ organization = definition.get("organization")
190
+ region = definition.get("region")
191
+
192
+ missing = [key for key, value in {
193
+ "product": product,
194
+ "name/app": app_name,
195
+ "tier": tier,
196
+ "organization": organization,
197
+ "region": region,
198
+ }.items() if not value]
199
+ if missing:
200
+ raise ValueError(f"definition is missing required keys: {', '.join(missing)}")
201
+
202
+ archetype = BuzzerboyArchetype(
203
+ product=product,
204
+ app=app_name,
205
+ tier=tier,
206
+ organization=organization,
207
+ region=region,
208
+ )
209
+
210
+ flags: List[str] = list(definition.get("flags", []))
211
+ flags.append("skip_domain")
212
+ flags = list(dict.fromkeys(flags))
213
+
214
+ app = App()
215
+
216
+ stack_class = LightsailContainerStack if include_compliance else LightsailContainerStandaloneStack
217
+ stack_class(
218
+ app,
219
+ f"{archetype.get_project_name()}-stack",
220
+ project_name=archetype.get_project_name(),
221
+ environment=archetype.get_tier(),
222
+ region=archetype.get_region(),
223
+ secret_name=archetype.get_secret_name(),
224
+ profile=definition.get("profile", "default"),
225
+ flags=flags,
226
+ )
227
+
228
+ app.synth()
229
+ return app