Skip to content

Commit

Permalink
fix Lambda version suppression for sagemaker-studio
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonLuttenberger committed Mar 11, 2024
1 parent 787e0f1 commit 2a6652c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion modules/sagemaker/sagemaker-studio/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def enable_sagemaker_projects(self, roles: List[str]) -> None:
event_handler = PythonFunction(
self,
"sg-project-function",
runtime=lambda_.Runtime.PYTHON_3_8,
runtime=lambda_.Runtime.PYTHON_3_12,
entry="functions/sm_studio/enable_sm_projects",
timeout=core.Duration.seconds(120),
)
Expand Down Expand Up @@ -182,6 +182,15 @@ def enable_sagemaker_projects(self, roles: List[str]) -> None:
),
],
)
cdk_nag.NagSuppressions.add_resource_suppressions(
provider,
apply_to_children=True,
suppressions=[
cdk_nag.NagPackSuppression(
id="AwsSolutions-L1", reason="We don't control the version used by the Provider construct."
),
],
)

def sagemaker_studio_domain(
self,
Expand Down
2 changes: 1 addition & 1 deletion modules/sagemaker/sagemaker-studio/tests/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_synthesize_stack(stack: cdk.Stack, enable_custom_sagemaker_projects: bo
template.resource_count_is("AWS::SageMaker::Domain", 1)
template.resource_count_is("AWS::SageMaker::UserProfile", 2)
template.resource_count_is("AWS::EC2::SecurityGroup", 1)
template.resource_count_is("AWS::IAM::Role", 3)
template.resource_count_is("AWS::IAM::Role", 5 if enable_custom_sagemaker_projects else 3)


@pytest.mark.parametrize("enable_custom_sagemaker_projects", [True, False])
Expand Down

0 comments on commit 2a6652c

Please sign in to comment.