Skip to content

Commit

Permalink
[sdlf-dataset][cdk] avoid using a hardcoded stack name
Browse files Browse the repository at this point in the history
  • Loading branch information
cnfait committed Oct 23, 2024
1 parent bb61d96 commit fe71505
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions sdlf-dataset/src/app.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
#!/usr/bin/env python3

import aws_cdk as cdk
import os

from dataset import Dataset

app = cdk.App()
# Project specific
project_name = os.getenv("SEEDFARMER_PROJECT_NAME", "")
deployment_name = os.getenv("SEEDFARMER_DEPLOYMENT_NAME", "")
module_name = os.getenv("SEEDFARMER_MODULE_NAME", "")

if project_name:
stack_name = f"{project_name}-{deployment_name}-{module_name}"
else: # app.py not used in a seedfarmer context somehow
stack_name = "sdlf-dataset"

lakeformation_cicd_stack = cdk.Stack(app, "LakeFormationDatasetStack")
app = cdk.App()
lakeformation_cicd_stack = cdk.Stack(app, f"{stack_name}-lakeformation")

cdk.aws_lakeformation.CfnDataLakeSettings(
lakeformation_cicd_stack,
Expand All @@ -21,7 +31,7 @@
mutation_type="APPEND",
)

stack = cdk.Stack(app, "DatasetStack")
stack = cdk.Stack(app, stack_name)
stack.add_dependency(lakeformation_cicd_stack)
Dataset(stack, "dataset")

Expand Down

0 comments on commit fe71505

Please sign in to comment.