Skip to content

Commit 7a6a697

Browse files
authored
Use unique construct ids in the data integration stack (IT-4057) (Sage-Bionetworks-IT#87)
* Use unique construct ids in the data integration stack * Fix consutrct prefixes
1 parent e06fc60 commit 7a6a697

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

openchallenges/data_integration_lambda.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, scope: Construct, id: str) -> None:
2828
def _build_lambda_role(self) -> iam.Role:
2929
return iam.Role(
3030
self,
31-
"LambdaRole",
31+
f"{id}-LambdaRole",
3232
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com"),
3333
managed_policies=[
3434
iam.ManagedPolicy.from_aws_managed_policy_name(
@@ -51,7 +51,7 @@ def _build_lambda_function(self, role: iam.Role) -> lambda_.Function:
5151
"""
5252
return lambda_.DockerImageFunction(
5353
self,
54-
"LambdaFunction",
54+
f"{id}-LambdaFunction",
5555
code=lambda_.DockerImageCode.from_image_asset(
5656
# Directory relative to where you execute cdk deploy contains a
5757
# Dockerfile with build instructions.

openchallenges/data_integration_stack.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(
4141
"""
4242
super().__init__(scope, id, **kwargs)
4343

44-
data_integration_lambda = DataIntegrationLambda(self, "data-integration-lambda")
44+
data_integration_lambda = DataIntegrationLambda(self, f"{id}-lambda")
4545

4646
target = scheduler_targets.LambdaInvoke(
4747
data_integration_lambda.lambda_function,
@@ -52,13 +52,13 @@ def __init__(
5252
# to this group the future)
5353
schedule_group = scheduler_alpha.Group(
5454
self,
55-
"group",
56-
group_name="schedule-group",
55+
f"{id}-schedule-group",
56+
group_name=f"{id}-schedule-group",
5757
)
5858

5959
scheduler_alpha.Schedule(
6060
self,
61-
"schedule",
61+
f"{id}-schedule",
6262
schedule=props.schedule,
6363
target=target,
6464
group=schedule_group,

0 commit comments

Comments
 (0)