cs-image-system-tf-ebs-instance-plugin 0.1.3__tar.gz → 0.1.5__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.
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/PKG-INFO +5 -4
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/pyproject.toml +5 -4
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/src/cs_image_system/tf_ebs_instance_plugin/main.py +1 -2
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/src/cs_image_system/tf_ebs_instance_plugin/tf_instance_builder.py +6 -6
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/src/cs_image_system/tf_ebs_instance_plugin/tf_instance_models.py +3 -3
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/src/cs_image_system/tf_ebs_instance_plugin/tf_storage_builder.py +16 -16
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/src/cs_image_system/tf_ebs_instance_plugin/tf_storage_models.py +3 -3
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/.gitignore +0 -0
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/LICENSE +0 -0
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/README.md +0 -0
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/src/cs_image_system/py.typed +0 -0
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/src/cs_image_system/tf_ebs_instance_plugin/__init__.py +0 -0
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/src/cs_image_system/tf_ebs_instance_plugin/helpers.py +0 -0
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/tests/test_instance_module_calls.py +0 -0
- {cs_image_system_tf_ebs_instance_plugin-0.1.3 → cs_image_system_tf_ebs_instance_plugin-0.1.5}/tests/test_storage_module_calls.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: cs-image-system-tf-ebs-instance-plugin
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: The OpenTofu plugin for AWS: instances and EBS, EFS and S3 storages as module calls
|
|
5
5
|
Project-URL: Repository, https://github.com/infrastructurebuilder/cs-image-system-3
|
|
6
6
|
Project-URL: Documentation, https://github.com/infrastructurebuilder/cs-image-system-3/blob/develop/docs/OPERATIONS.md
|
|
@@ -9,9 +9,10 @@ Author-email: Mykel Alvis <mykelalvis@infrastructurebuilder.org>
|
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Requires-Python: >=3.13
|
|
12
|
-
Requires-Dist: cs-image-system-aws-runtime-plugin==0.1.
|
|
13
|
-
Requires-Dist: cs-image-system-
|
|
14
|
-
Requires-Dist: cs-image-system-
|
|
12
|
+
Requires-Dist: cs-image-system-aws-runtime-plugin==0.1.5
|
|
13
|
+
Requires-Dist: cs-image-system-base==0.1.5
|
|
14
|
+
Requires-Dist: cs-image-system-contract==0.1.5
|
|
15
|
+
Requires-Dist: cs-image-system-hashicorp-utils==0.1.5
|
|
15
16
|
Requires-Dist: pydantic>=2.13
|
|
16
17
|
Description-Content-Type: text/markdown
|
|
17
18
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cs-image-system-tf-ebs-instance-plugin"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
description = "The OpenTofu plugin for AWS: instances and EBS, EFS and S3 storages as module calls"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Mykel Alvis", email = "mykelalvis@infrastructurebuilder.org" }]
|
|
@@ -12,9 +12,10 @@ license = "Apache-2.0"
|
|
|
12
12
|
license-files = ["LICENSE"]
|
|
13
13
|
requires-python = ">=3.13"
|
|
14
14
|
dependencies = [
|
|
15
|
-
"cs-image-system-
|
|
16
|
-
"cs-image-system-
|
|
17
|
-
"cs-image-system-
|
|
15
|
+
"cs-image-system-contract==0.1.5",
|
|
16
|
+
"cs-image-system-base==0.1.5",
|
|
17
|
+
"cs-image-system-hashicorp-utils==0.1.5",
|
|
18
|
+
"cs-image-system-aws-runtime-plugin==0.1.5",
|
|
18
19
|
"pydantic>=2.13",
|
|
19
20
|
]
|
|
20
21
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
6
|
from cs_image_system.base.basic.abstract_plugin_metadata import AbstractPluginMetadata
|
|
7
|
-
from cs_image_system.base.protocols.plugin_metadata import PluginMetadataProtocol
|
|
8
7
|
from .tf_instance_builder import TofuInstanceBuilder, TofuVersionChecker
|
|
9
8
|
from .tf_instance_models import TOFU, TofuInstanceBuilderModel
|
|
10
9
|
from .tf_storage_builder import (
|
|
@@ -28,7 +27,7 @@ from .tf_storage_models import (
|
|
|
28
27
|
log = logging.getLogger(__name__)
|
|
29
28
|
|
|
30
29
|
|
|
31
|
-
class TFEbsTofuTypes(AbstractPluginMetadata
|
|
30
|
+
class TFEbsTofuTypes(AbstractPluginMetadata):
|
|
32
31
|
"""Tofu instance AND storage builders in one registration.
|
|
33
32
|
|
|
34
33
|
Storages live in the same plugin as instances so the two generate together
|
|
@@ -9,10 +9,10 @@ from typing import Any, TypeVar
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
from cs_image_system.base import utils
|
|
12
|
-
from cs_image_system.
|
|
13
|
-
from cs_image_system.
|
|
12
|
+
from cs_image_system.contract.constants import OOPS_DEFAULTS
|
|
13
|
+
from cs_image_system.contract.hcl import HclRaw, hcl_expr, render_module_call
|
|
14
14
|
from cs_image_system.base.basic.abstract_version_checker import AbstractVersionChecker
|
|
15
|
-
from cs_image_system.
|
|
15
|
+
from cs_image_system.contract.assets import AssetSet
|
|
16
16
|
from cs_image_system.base.basic.builder_base_instance import InstanceBuilderBase
|
|
17
17
|
from cs_image_system.base.capabilities import group_builder_of
|
|
18
18
|
from cs_image_system.base.launch_params import (
|
|
@@ -20,9 +20,9 @@ from cs_image_system.base.launch_params import (
|
|
|
20
20
|
compute_launch_params,
|
|
21
21
|
user_data_template,
|
|
22
22
|
)
|
|
23
|
-
from cs_image_system.
|
|
23
|
+
from cs_image_system.contract.lifecycle import ExecutionLifecyclePhase
|
|
24
24
|
from cs_image_system.base.models.executable import ExecutableModel
|
|
25
|
-
from cs_image_system.
|
|
25
|
+
from cs_image_system.contract.executables import CFExecutables
|
|
26
26
|
from cs_image_system.base.models.instance import Instance
|
|
27
27
|
from cs_image_system.hashicorp_utils.collector import TerraformCollector, TerraformVariable
|
|
28
28
|
from cs_image_system.hashicorp_utils.roots import TerraformRootMixin
|
|
@@ -593,7 +593,7 @@ class TofuInstanceBuilder(InstanceBuilderBase[Q], TerraformRootMixin):
|
|
|
593
593
|
# generated/retention/, where no instance root exists and nothing
|
|
594
594
|
# reads it (never staged, it lingered untracked after every release
|
|
595
595
|
# run). Only the lifecycle that generates instance roots gets it.
|
|
596
|
-
from cs_image_system.
|
|
596
|
+
from cs_image_system.contract.lifecycles import Lifecycle
|
|
597
597
|
current = getattr(ctx, "current_lifecycle", None) # a bare harness context has none
|
|
598
598
|
if current is not None and str(current.value) != Lifecycle.INSTANCE_IMAGE.value:
|
|
599
599
|
return
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
5
|
from dataclasses import field
|
|
6
|
-
from cs_image_system.
|
|
6
|
+
from cs_image_system.contract.model_config import CSIS_MODEL_CONFIG
|
|
7
7
|
from pydantic.dataclasses import dataclass # stage 23: validation at construction
|
|
8
8
|
|
|
9
|
-
from cs_image_system.
|
|
10
|
-
from cs_image_system.
|
|
9
|
+
from cs_image_system.contract.constants import DEFAULT, VCT
|
|
10
|
+
from cs_image_system.contract.fields import fk_field
|
|
11
11
|
from cs_image_system.base.models.instance_builder import InstanceBuilderModel
|
|
12
12
|
from cs_image_system.hashicorp_utils.hashicorp_models import TFTofuPluginModel
|
|
13
13
|
|
|
@@ -8,18 +8,18 @@ from typing import Any, TypeVar, cast
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
from cs_image_system.base import utils
|
|
11
|
-
from cs_image_system.
|
|
11
|
+
from cs_image_system.contract.hcl import HclRaw, render_module_call
|
|
12
12
|
from cs_image_system.base.basic.abstract_version_checker import AbstractVersionChecker
|
|
13
|
-
from cs_image_system.
|
|
13
|
+
from cs_image_system.contract.assets import AssetSet
|
|
14
14
|
from cs_image_system.base.basic.builder_base_group import GroupBuilderBase
|
|
15
15
|
from cs_image_system.base.basic.builder_base_storage import (
|
|
16
16
|
CARDINALITY_MANY,
|
|
17
17
|
CARDINALITY_SINGLE,
|
|
18
18
|
StorageBuilderBase,
|
|
19
19
|
)
|
|
20
|
-
from cs_image_system.
|
|
20
|
+
from cs_image_system.contract.lifecycle import ExecutionLifecyclePhase
|
|
21
21
|
from cs_image_system.base.models.executable import ExecutableModel
|
|
22
|
-
from cs_image_system.
|
|
22
|
+
from cs_image_system.contract.executables import CFExecutables
|
|
23
23
|
from cs_image_system.base.models.storage import STORAGE_STATE_ACTIVE, STORAGE_STATE_ARCHIVED, STORAGE_STATE_DESTROYED, Storage
|
|
24
24
|
from cs_image_system.hashicorp_utils.blocks import OutputSpec, Raw, render_blocks
|
|
25
25
|
from cs_image_system.hashicorp_utils.collector import TerraformCollector
|
|
@@ -59,11 +59,11 @@ class RecordedStorage:
|
|
|
59
59
|
return f"RecordedStorage({self.name!r}, {self.recorded_state!r})"
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
def
|
|
62
|
+
def storage_groups(storage: Any) -> list[str]:
|
|
63
63
|
return list(getattr(storage, "groups", []) or [])
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
def
|
|
66
|
+
def storage_public_read(storage: Any) -> bool:
|
|
67
67
|
return bool(getattr(storage, "public_read", False))
|
|
68
68
|
|
|
69
69
|
|
|
@@ -162,7 +162,7 @@ class TofuStorageBuilder(StorageBuilderBase[Q], TerraformRootMixin):
|
|
|
162
162
|
"""Identity workspaces whose gids this root consumes, by workspace name."""
|
|
163
163
|
out: dict[str, GroupBuilderBase] = {}
|
|
164
164
|
for storage in self.live_storages():
|
|
165
|
-
for group in
|
|
165
|
+
for group in storage_groups(storage):
|
|
166
166
|
gb = self._group_builder_for(group)
|
|
167
167
|
ws = gb.gid_workspace() if gb is not None else None # stage 75 step 3
|
|
168
168
|
if gb is not None and ws is not None:
|
|
@@ -188,7 +188,7 @@ class TofuStorageBuilder(StorageBuilderBase[Q], TerraformRootMixin):
|
|
|
188
188
|
return {
|
|
189
189
|
group: {"gid": self.gid_reference(group), "path": f"/{group}",
|
|
190
190
|
"permissions": getattr(storage, "share_mode", "2770")}
|
|
191
|
-
for group in sorted(
|
|
191
|
+
for group in sorted(storage_groups(storage))
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
def generate_items_before(self, phase: ExecutionLifecyclePhase) -> AssetSet:
|
|
@@ -248,9 +248,9 @@ class TofuStorageBuilder(StorageBuilderBase[Q], TerraformRootMixin):
|
|
|
248
248
|
items.add(rpath,
|
|
249
249
|
f"# Terraform module call for storage {storage.get_name()} "
|
|
250
250
|
f"generated by {self.__class__.__name__} ({self.name})")
|
|
251
|
-
if
|
|
252
|
-
items.add(rpath, f"# allowed groups: {', '.join(
|
|
253
|
-
f"(gids by remote-state reference); public_read={str(
|
|
251
|
+
if storage_groups(storage):
|
|
252
|
+
items.add(rpath, f"# allowed groups: {', '.join(storage_groups(storage))} "
|
|
253
|
+
f"(gids by remote-state reference); public_read={str(storage_public_read(storage)).lower()}; "
|
|
254
254
|
f"requested state: {_state(storage)}")
|
|
255
255
|
items.add_list(rpath, render_module_call(
|
|
256
256
|
f"storage_{label}", src, self.module_args(storage),
|
|
@@ -632,10 +632,10 @@ class TofuEfsStorageBuilder(TofuStorageBuilder[S]):
|
|
|
632
632
|
args["transition_to_ia"] = f"AFTER_{int(spec['ia_days'])}_DAYS"
|
|
633
633
|
if spec.get("archive_days"):
|
|
634
634
|
args["transition_to_archive"] = f"AFTER_{int(spec['archive_days'])}_DAYS"
|
|
635
|
-
if
|
|
635
|
+
if storage_groups(storage):
|
|
636
636
|
# EFS access points realize gid-owned subtrees natively (Q3).
|
|
637
637
|
args["access_points"] = self.group_subtrees(storage)
|
|
638
|
-
if
|
|
638
|
+
if storage_public_read(storage):
|
|
639
639
|
args["public_read"] = True
|
|
640
640
|
# Mount targets (stage 19): an EFS filesystem is reachable only through
|
|
641
641
|
# an ENI in the VPC, one per availability zone, and without them
|
|
@@ -789,9 +789,9 @@ class TofuS3StorageBuilder(TofuStorageBuilder[B]):
|
|
|
789
789
|
"transition_days": int(spec.get("transition_days") or 0),
|
|
790
790
|
"storage_class": str(spec.get("storage_class") or ""),
|
|
791
791
|
"expire_days": int(spec.get("expire_days") or 0)}]
|
|
792
|
-
if
|
|
793
|
-
args["group_prefixes"] = sorted(
|
|
794
|
-
if
|
|
792
|
+
if storage_groups(storage):
|
|
793
|
+
args["group_prefixes"] = sorted(storage_groups(storage))
|
|
794
|
+
if storage_public_read(storage):
|
|
795
795
|
args["public_read"] = True
|
|
796
796
|
tags = _tags_for(self, storage)
|
|
797
797
|
if tags:
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
5
|
from dataclasses import field
|
|
6
|
-
from cs_image_system.
|
|
6
|
+
from cs_image_system.contract.model_config import CSIS_MODEL_CONFIG
|
|
7
7
|
from pydantic.dataclasses import dataclass # stage 23: validation at construction
|
|
8
8
|
|
|
9
|
-
from cs_image_system.
|
|
10
|
-
from cs_image_system.
|
|
9
|
+
from cs_image_system.contract.constants import DEFAULT, VCT
|
|
10
|
+
from cs_image_system.contract.fields import fk_field
|
|
11
11
|
from cs_image_system.base.models.module_variables import ModuleVariables
|
|
12
12
|
from cs_image_system.base.models.storage_builder import StorageBuilderModel
|
|
13
13
|
from cs_image_system.hashicorp_utils.hashicorp_models import TFTofuPluginModel
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|