BaseResource
laktory.models.resources.BaseResource
¤
Parent class for all Laktory models deployable as one or multiple cloud
core resources. This BaseResource class is derived from
pydantic.BaseModel.
| PARAMETER | DESCRIPTION |
|---|---|
lookup_existing
|
Import a pre-existing resource instead of creating a new one. The resource becomes available for cross-referencing (
TYPE:
|
resource_options
|
Deployed resource options (name, provider, enabled flag, dependencies, etc.).
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
lookup |
Create an instance that references an existing resource without managing it. |
resource_options_compat |
Backward compatibility for |
| ATTRIBUTE | DESCRIPTION |
|---|---|
core_resources |
List of core resources to be deployed with this laktory model:
|
resource_key |
Resource key used to build default resource name. Equivalent to
TYPE:
|
resource_name |
Logical name of the resource within the stack — auto-generated as
TYPE:
|
resource_type_id |
Resource type id used to build default resource name. Equivalent to
TYPE:
|
self_as_core_resources |
Flag set to
|
core_resources
property
¤
List of core resources to be deployed with this laktory model: - class instance (self)
resource_key
property
¤
Resource key used to build default resource name. Equivalent to name properties if available. Otherwise, empty string.
resource_name
property
¤
Logical name of the resource within the stack — auto-generated as
{resource_type_id}-{resource_safe_key} unless overridden via
resource_options.name. Used as the IaC state address and as the key
for ${resources.<name>.<property>} cross-references.
resource_type_id
property
¤
Resource type id used to build default resource name. Equivalent to class name converted to kebab case. e.g.: SecretScope -> secret-scope
self_as_core_resources
property
¤
Flag set to True if self must be included in core resources
lookup(lookup_existing, **kwargs)
classmethod
¤
Create an instance that references an existing resource without managing it.
Required fields are filled with placeholder values so Pydantic validation
passes — only lookup_existing is used at deploy time. Prefer this over
passing lookup_existing directly to the constructor to make the intent
explicit.
Source code in laktory/models/resources/baseresource.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
resource_options_compat(data)
classmethod
¤
Backward compatibility for options field.
Source code in laktory/models/resources/baseresource.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
laktory.models.resources.baseresource.ResourceOptions
¤
Bases: BaseModel
Resource options for deployment.
| PARAMETER | DESCRIPTION |
|---|---|
depends_on
|
Explicit list of resource dependencies.
TYPE:
|
ignore_changes
|
Declare that changes to certain properties should be ignored during a diff.
TYPE:
|
import_
|
Bring an existing cloud resource into Laktory management.
TYPE:
|
is_enabled
|
If
TYPE:
|
moved_from
|
Declare that a resource was moved from another address.
TYPE:
|
name
|
Logical name of the resource within the stack. Used by the IaC backend to track the
resource across deployments, and as the key for cross-referencing this resource from
other resources or YAML configs via If Examples of auto-generated names:
- Set this explicitly to pin the resource address and prevent destroy-and-recreate when the
resource
TYPE:
|
provider
|
Explicit declaration of resource provider.
TYPE:
|