Skip to content

Commit d8fffe9

Browse files
committed
Change: Raise error if custom VPC is halfway defined
1 parent 8c2012b commit d8fffe9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sagemaker/estimator.py

+9
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,15 @@ def __init__(
578578
self.dependencies = dependencies or []
579579
self.uploaded_code: Optional[UploadedCode] = None
580580

581+
# Check that the user properly sets both subnet and secutiry_groupe_ids
582+
if (
583+
subnets is not None
584+
and security_group_ids is None
585+
or security_group_ids is not None
586+
and subnets is None
587+
):
588+
raise RuntimeError("When setting up custom VPC, both subnets and security_group_ids must be set")
589+
581590
if self.instance_type in ("local", "local_gpu"):
582591
if self.instance_type == "local_gpu" and self.instance_count > 1:
583592
raise RuntimeError("Distributed Training in Local GPU is not supported")

0 commit comments

Comments
 (0)