Repository: linz/geostore

Issue:
feat: Use poetry extras for subprojects



Discussion:
When running `cdk synth` I've got following error:

```
ERROR: Invalid requirement: 'Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.' (from line 1 of /dev/fd/63)
```

So you probably need to add updated poetry lock file.

Resolving patch:
diff --git a/app.py b/app.py
--- a/app.py
+++ b/app.py
@@ -9,9 +9,9 @@
 from aws_cdk import core
 
 from datalake.api_stack import APIStack
-from datalake.dataset_source_stack import DatasetSourceStack
 from datalake.networking_stack import NetworkingStack
 from datalake.processing_stack import ProcessingStack
+from datalake.staging_stack import StagingStack
 from datalake.storage_stack import StorageStack
 
 ENV = os.environ.get("DEPLOY_ENV", "dev")
@@ -61,10 +61,10 @@ def str2bool(value: str) -> bool:
     datasets_table=storage.datasets_table,
 )
 
-api = DatasetSourceStack(
+api = StagingStack(
     app,
-    "dataset-source",
-    stack_name=f"geospatial-data-lake-dataset-source-{ENV}",
+    "staging",
+    stack_name=f"geospatial-data-lake-staging-{ENV}",
     env={"region": os.environ["CDK_DEFAULT_REGION"], "account": os.environ["CDK_DEFAULT_ACCOUNT"]},
     deploy_env=ENV,
 )
diff --git a/datalake/dataset_source_stack.py b/datalake/staging_stack.py
similarity index 63%
rename from datalake/dataset_source_stack.py
rename to datalake/staging_stack.py
--- a/datalake/dataset_source_stack.py
+++ b/datalake/staging_stack.py
@@ -1,23 +1,23 @@
 from aws_cdk import aws_s3, core
 from aws_cdk.core import Tags
 
+STAGING_BUCKET_NAME = "linz-geospatial-data-lake-staging"
 
-class DatasetSourceStack(core.Stack):
+
+class StagingStack(core.Stack):
     def __init__(self, scope: core.Construct, stack_id: str, deploy_env, **kwargs) -> None:
         super().__init__(scope, stack_id, **kwargs)
 
         ############################################################################################
-        # ### DATASET SOURCE S3 BUCKET #############################################################
+        # ### DATASET STAGING S3 BUCKET ############################################################
         ############################################################################################
-        self.source_bucket = aws_s3.Bucket(
+        self.staging_bucket = aws_s3.Bucket(
             self,
-            "dataset-source-bucket",
-            bucket_name="{}-{}".format(
-                self.node.try_get_context("data-lake-dataset-source-bucket-name"), deploy_env
-            ),
+            "dataset-staging-bucket",
+            bucket_name=f"{STAGING_BUCKET_NAME}-{deploy_env}",
             access_control=aws_s3.BucketAccessControl.PRIVATE,
             block_public_access=aws_s3.BlockPublicAccess.BLOCK_ALL,
             versioned=True,
             removal_policy=core.RemovalPolicy.DESTROY,
         )
-        Tags.of(self.source_bucket).add("ApplicationLayer", "storage")
+        Tags.of(self.staging_bucket).add("ApplicationLayer", "storage")


Test patch:
diff --git a/datalake/backend/tests/test_processing_stack.py b/datalake/backend/tests/test_processing_stack.py
--- a/datalake/backend/tests/test_processing_stack.py
+++ b/datalake/backend/tests/test_processing_stack.py
@@ -8,6 +8,7 @@
 
 from pytest import mark
 
+from ...staging_stack import STAGING_BUCKET_NAME
 from .utils import (
     S3Object,
     any_dataset_description,
@@ -118,7 +119,7 @@ def test_should_successfully_run_dataset_version_creation_process(
 
     metadata_file = "{}/{}.json".format(any_safe_file_path(), any_safe_filename())
     metadata_content = dumps(MINIMAL_VALID_STAC_OBJECT)
-    s3_bucket = f"linz-geospatial-data-lake-dataset-source-{ENV}"
+    s3_bucket = f"{STAGING_BUCKET_NAME}-{ENV}"
 
     with S3Object(
         BytesIO(f"{metadata_content}".encode()),