cdk-factory 0.8.3__py3-none-any.whl → 0.8.5__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.

Potentially problematic release.


This version of cdk-factory might be problematic. Click here for more details.

@@ -137,7 +137,14 @@ class EnhancedSsmConfig:
137
137
  if self.ssm_imports:
138
138
  if isinstance(self.ssm_imports, dict):
139
139
  # Handle dict format: {"attribute": "auto" or path}
140
+ # Skip metadata fields that are not actual imports
141
+ metadata_fields = {"workload", "environment", "organization"}
142
+
140
143
  for attribute, import_value in self.ssm_imports.items():
144
+ # Skip metadata fields - they specify context, not what to import
145
+ if attribute in metadata_fields:
146
+ continue
147
+
141
148
  if import_value == "auto":
142
149
  # Use auto-discovery with source mapping
143
150
  imports_config = RESOURCE_AUTO_IMPORTS.get(self.resource_type, {})
@@ -332,6 +332,19 @@ class ApiGatewayStack(IStack, EnhancedSsmParameterMixin):
332
332
  api_gateway, route_config, self.stack_config, api_id
333
333
  )
334
334
 
335
+ def _get_route_suffix(self, route: dict) -> str:
336
+ """
337
+ Calculate a unique suffix for route construct IDs.
338
+ Uses 'name' field if provided, otherwise includes method + path for uniqueness.
339
+ """
340
+ if "name" in route and route["name"]:
341
+ return route["name"] # Use the unique name provided in config
342
+ else:
343
+ # Include method to ensure uniqueness when same path has multiple methods
344
+ method = route.get("method", "GET").upper()
345
+ path_suffix = route["path"].strip("/").replace("/", "-") or "health"
346
+ return f"{method.lower()}-{path_suffix}"
347
+
335
348
  def _setup_lambda_routes(self, api_gateway, api_id, routes, authorizer):
336
349
  """Setup Lambda routes and integrations"""
337
350
  for route in routes:
@@ -352,7 +365,7 @@ class ApiGatewayStack(IStack, EnhancedSsmParameterMixin):
352
365
  This is the NEW PATTERN for separating Lambda and API Gateway stacks.
353
366
  """
354
367
  route_path = route["path"]
355
- suffix = route_path.strip("/").replace("/", "-") or "health"
368
+ suffix = self._get_route_suffix(route) # Use shared method for consistent suffix calculation
356
369
 
357
370
  # Get Lambda ARN from SSM Parameter Store
358
371
  lambda_arn = self._get_lambda_arn_from_ssm(route)
@@ -437,15 +450,7 @@ class ApiGatewayStack(IStack, EnhancedSsmParameterMixin):
437
450
 
438
451
  def _setup_single_lambda_route(self, api_gateway, api_id, route, authorizer):
439
452
  """Setup a single Lambda route with integration and CORS"""
440
- # Use the 'name' field if provided, otherwise include method in suffix for uniqueness
441
- if "name" in route and route["name"]:
442
- suffix = route["name"] # Use the unique name provided in config
443
- else:
444
- # Include method to ensure uniqueness when same path has multiple methods
445
- method = route.get("method", "GET").upper()
446
- path_suffix = route["path"].strip("/").replace("/", "-") or "health"
447
- suffix = f"{method.lower()}-{path_suffix}"
448
-
453
+ suffix = self._get_route_suffix(route) # Use shared method for consistent suffix calculation
449
454
  src = route.get("src")
450
455
  handler = route.get("handler")
451
456
 
@@ -295,7 +295,20 @@ class LambdaFunctionUtilities:
295
295
  if not os.path.exists(lambda_directory):
296
296
  raise FileNotFoundError(f"directory not found: {lambda_directory}")
297
297
 
298
- shutil.copytree(lambda_directory, output_dir, dirs_exist_ok=True)
298
+ # Copy lambda directory, excluding __pycache__ and other build artifacts
299
+ def ignore_patterns(directory, files):
300
+ """Ignore __pycache__, .pyc files, and other build artifacts"""
301
+ return [
302
+ f for f in files
303
+ if f == '__pycache__'
304
+ or f.endswith('.pyc')
305
+ or f.endswith('.pyo')
306
+ or f == '.pytest_cache'
307
+ or f == '.mypy_cache'
308
+ or f == '__pycache__'
309
+ ]
310
+
311
+ shutil.copytree(lambda_directory, output_dir, dirs_exist_ok=True, ignore=ignore_patterns)
299
312
 
300
313
  def __requirements(
301
314
  self,
@@ -377,7 +390,8 @@ class LambdaFunctionUtilities:
377
390
  logger.warning(f"CodeArtifact login failed (continuing): {e}")
378
391
  # Continue with other logins or pip install
379
392
 
380
- commands = f"pip install -r {requirement} -t {output_dir}".split()
393
+ # Use --upgrade to avoid warnings about existing directories
394
+ commands = f"pip install -r {requirement} -t {output_dir} --upgrade".split()
381
395
  subprocess.check_call(commands)
382
396
  else:
383
397
  logger.warning(
cdk_factory/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.8.3"
1
+ __version__ = "0.8.5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdk_factory
3
- Version: 0.8.3
3
+ Version: 0.8.5
4
4
  Summary: CDK Factory. A QuickStarter and best practices setup for CDK projects
5
5
  Author-email: Eric Wilson <eric.wilson@geekcafe.com>
6
6
  License: MIT License
@@ -1,7 +1,7 @@
1
1
  cdk_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  cdk_factory/app.py,sha256=xv863N7O6HPKznB68_t7O4la9JacrkG87t9TjoDUk7s,2827
3
3
  cdk_factory/cdk.json,sha256=SKZKhJ2PBpFH78j-F8S3VDYW-lf76--Q2I3ON-ZIQfw,3106
4
- cdk_factory/version.py,sha256=otnwfmvJLUamPajTPUaIekiO9mA-2HPi-_h_E0N-uOQ,22
4
+ cdk_factory/version.py,sha256=K0kGrhh1kzVisZcoSkeuJdC06rTwxufV05Vy2hOVGoo,22
5
5
  cdk_factory/builds/README.md,sha256=9BBWd7bXpyKdMU_g2UljhQwrC9i5O_Tvkb6oPvndoZk,90
6
6
  cdk_factory/commands/command_loader.py,sha256=QbLquuP_AdxtlxlDy-2IWCQ6D-7qa58aphnDPtp_uTs,3744
7
7
  cdk_factory/configurations/base_config.py,sha256=JKjhNsy0RCUZy1s8n5D_aXXI-upR9izaLtCTfKYiV9k,9624
@@ -10,7 +10,7 @@ cdk_factory/configurations/deployment.py,sha256=LO2gd1yv1nqlX_2MIjRXptylFybWiTKs
10
10
  cdk_factory/configurations/deployment_wave.py,sha256=TFX7CYgr5SmLyziEb-R_OTteFWtlMHB4pT53ekV3d1Y,233
11
11
  cdk_factory/configurations/devops.py,sha256=PG-s2ldZmMULheWdKf2lf2LSugLoKiOKyLELTZJJxu8,2506
12
12
  cdk_factory/configurations/enhanced_base_config.py,sha256=Y1gcGZxyf_O2KFnVpCBORSGHWHqHxw0vNx_ijMad_QA,6654
13
- cdk_factory/configurations/enhanced_ssm_config.py,sha256=VDmIUSrj8nYS6fE9DdOp5yi9jUfMfitz5A7kCuPS-kI,12895
13
+ cdk_factory/configurations/enhanced_ssm_config.py,sha256=KXRYMHztlqZAAnKNt1pfMvctLZJw6TvR1BrHNejLA6I,13254
14
14
  cdk_factory/configurations/management.py,sha256=TSOIyxO9hGNxbgiTsS8a3pz03ungXiNqPPtZtfOpr8M,1373
15
15
  cdk_factory/configurations/pipeline.py,sha256=3RmRP1GIk42rjYZ-A9H3357RcO13IA47N-2IQcBkySQ,4939
16
16
  cdk_factory/configurations/pipeline_stage.py,sha256=eAT-FoIepIuv5tObk4TXlCN47FaatQO2rrFchgbMdXU,3415
@@ -73,7 +73,7 @@ cdk_factory/stack/stack_module_registry.py,sha256=J14-A75VZESzRQa8p-Fepdap7Z8T7m
73
73
  cdk_factory/stack/stack_modules.py,sha256=kgEK-j0smZPozVwTCfM1g1V17EyTBT0TXAQZq4vZz0o,784
74
74
  cdk_factory/stack_library/__init__.py,sha256=5Y9TpIe8ZK1688G60PGcuP-hM0RvYEY_3Hl2qJCJJrw,581
75
75
  cdk_factory/stack_library/stack_base.py,sha256=tTleSFmlf26DuKVF_ytftf8P7IVWb5iex8cYfYupfvQ,4940
76
- cdk_factory/stack_library/api_gateway/api_gateway_stack.py,sha256=AdC_TTAgdOIagahEuMZcA208E6osjO1lK80I6E1k5cc,38212
76
+ cdk_factory/stack_library/api_gateway/api_gateway_stack.py,sha256=BWhawbwGHggKQN3QLolZhdECoeTTnTBTrRo2hTJC570,38469
77
77
  cdk_factory/stack_library/auto_scaling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
78
  cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py,sha256=UsFqUb_3XPJAlmZ6F75nXna3elOggD1KuFmmdmhi0Lg,19070
79
79
  cdk_factory/stack_library/aws_lambdas/lambda_stack.py,sha256=SFbBPvvCopbyiuYtq-O5sQkFCf94Wzua6aDUXiFDSB4,26161
@@ -108,11 +108,11 @@ cdk_factory/utilities/environment_services.py,sha256=cd2T0efJtFPMLa1Fm7MPL-sqUlh
108
108
  cdk_factory/utilities/file_operations.py,sha256=HCZevKlmnHNB2wkIEPtdm-g2nJSKT3B9uipLk8Kx_Yk,8946
109
109
  cdk_factory/utilities/git_utilities.py,sha256=7Xac8PaThc7Lmk5jtDBHaJOj-fWRT017cgZmgXkVizM,3155
110
110
  cdk_factory/utilities/json_loading_utility.py,sha256=YRgzA1I-B_HwZm1eWJTeQ1JLkebCL4C1gpHOqo6GkCA,10341
111
- cdk_factory/utilities/lambda_function_utilities.py,sha256=j3tBdv_gC2MdEwBINDwAqYey5vgn7YiQtJ0XZybTsCQ,15197
111
+ cdk_factory/utilities/lambda_function_utilities.py,sha256=S1GvBsY_q2cyUiaud3HORJMnLhI5cRi31fbeaktY-_Q,15826
112
112
  cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
113
113
  cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
114
114
  cdk_factory/workload/workload_factory.py,sha256=yBUDGIuB8-5p_mGcVFxsD2ZoZIziak3yh3LL3JvS0M4,5903
115
- cdk_factory-0.8.3.dist-info/METADATA,sha256=yE-OmEZQq02UmCyeqJXEL3H3nkMU3qVba2GuHqDWfqo,2450
116
- cdk_factory-0.8.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
117
- cdk_factory-0.8.3.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
118
- cdk_factory-0.8.3.dist-info/RECORD,,
115
+ cdk_factory-0.8.5.dist-info/METADATA,sha256=YvPCDURf01vFMctbkAMdz74vNTDy3mhYPEIcaocczkY,2450
116
+ cdk_factory-0.8.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
117
+ cdk_factory-0.8.5.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
118
+ cdk_factory-0.8.5.dist-info/RECORD,,