Stacks Module¶
Stack base classes with environment configuration support.
base
¶
Base stack classes for environment-aware CDK stacks.
This module provides the foundational stack classes that enable environment-aware deployments with automatic tagging and resource naming.
Classes¶
EnvBaseStackMixins
¶
Bases: EnvBaseConstructMixins
Mixin class for environment-aware stack functionality.
Inherits all functionality from EnvBaseConstructMixins for use in stacks.
EnvBaseStack
¶
EnvBaseStack(
scope: Construct,
id: str | None,
env_base: EnvBase,
env: Environment | None = None,
**kwargs
)
Bases: Stack, EnvBaseStackMixins
Base stack class with environment awareness.
Provides automatic tagging with environment information and environment-specific removal policies.
Initialize an environment-aware stack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Construct
|
The parent construct scope. |
required |
id
|
Optional[str]
|
The stack ID. Auto-generated if None. |
required |
env_base
|
EnvBase
|
The environment base configuration. |
required |
env
|
Optional[Environment]
|
AWS environment settings. |
None
|
**kwargs
|
Additional arguments passed to cdk.Stack. |
{}
|
Source code in src/aibs_informatics_cdk_lib/stacks/base.py
Functions¶
Functions¶
get_all_stacks
¶
Get all CDK stacks from a construct scope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Construct
|
The construct scope to search. |
required |
Returns:
| Type | Description |
|---|---|
list[Stack]
|
List of all Stack children in the scope. |
Source code in src/aibs_informatics_cdk_lib/stacks/base.py
add_stack_dependencies
¶
Add dependencies between stacks.
Makes the dependent stacks depend on the source stack, ensuring proper deployment order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_stack
|
Stack
|
The stack that others depend on. |
required |
dependent_stacks
|
List[Stack]
|
Stacks that depend on the source. |
required |