@@ -295,7 +295,6 @@ def create_monitoring_schedule(
295295 network_config_dict = None
296296 if self .network_config is not None :
297297 network_config_dict = self .network_config ._to_request_dict ()
298- self ._validate_network_config (network_config_dict )
299298
300299 self .sagemaker_session .create_monitoring_schedule (
301300 monitoring_schedule_name = self .monitoring_schedule_name ,
@@ -448,7 +447,6 @@ def update_monitoring_schedule(
448447 network_config_dict = None
449448 if self .network_config is not None :
450449 network_config_dict = self .network_config ._to_request_dict ()
451- self ._validate_network_config (network_config_dict )
452450
453451 self .sagemaker_session .update_monitoring_schedule (
454452 monitoring_schedule_name = self .monitoring_schedule_name ,
@@ -708,6 +706,9 @@ def attach(cls, monitor_schedule_name, sagemaker_session=None):
708706 if network_config_dict :
709707 network_config = NetworkConfig (
710708 enable_network_isolation = network_config_dict ["EnableNetworkIsolation" ],
709+ encrypt_inter_container_traffic = network_config_dict [
710+ "EnableInterContainerTrafficEncryption"
711+ ],
711712 security_group_ids = security_group_ids ,
712713 subnets = subnets ,
713714 )
@@ -784,6 +785,9 @@ def _attach(clazz, sagemaker_session, schedule_desc, job_desc, tags):
784785 if network_config_dict :
785786 network_config = NetworkConfig (
786787 enable_network_isolation = network_config_dict ["EnableNetworkIsolation" ],
788+ encrypt_inter_container_traffic = network_config_dict [
789+ "EnableInterContainerTrafficEncryption"
790+ ],
787791 security_group_ids = security_group_ids ,
788792 subnets = subnets ,
789793 )
@@ -1164,31 +1168,6 @@ def _wait_for_schedule_changes_to_apply(self):
11641168 if schedule_desc ["MonitoringScheduleStatus" ] != "Pending" :
11651169 break
11661170
1167- def _validate_network_config (self , network_config_dict ):
1168- """Function to validate EnableInterContainerTrafficEncryption.
1169-
1170- It validates EnableInterContainerTrafficEncryption is not set in the provided
1171- NetworkConfig request dictionary.
1172-
1173- Args:
1174- network_config_dict (dict): NetworkConfig request dictionary.
1175- Contains parameters from :class:`~sagemaker.network.NetworkConfig` object
1176- that configures network isolation, encryption of
1177- inter-container traffic, security group IDs, and subnets.
1178-
1179- """
1180- if "EnableInterContainerTrafficEncryption" in network_config_dict :
1181- message = (
1182- "EnableInterContainerTrafficEncryption is not supported in Model Monitor. "
1183- "Please ensure that encrypt_inter_container_traffic=None "
1184- "when creating your NetworkConfig object. "
1185- "Current encrypt_inter_container_traffic value: {}" .format (
1186- self .network_config .encrypt_inter_container_traffic
1187- )
1188- )
1189- _LOGGER .info (message )
1190- raise ValueError (message )
1191-
11921171 @classmethod
11931172 def monitoring_type (cls ):
11941173 """Type of the monitoring job."""
@@ -1781,7 +1760,6 @@ def update_monitoring_schedule(
17811760 network_config_dict = None
17821761 if self .network_config is not None :
17831762 network_config_dict = self .network_config ._to_request_dict ()
1784- super (DefaultModelMonitor , self )._validate_network_config (network_config_dict )
17851763
17861764 if role is not None :
17871765 self .role = role
@@ -2034,6 +2012,9 @@ def attach(cls, monitor_schedule_name, sagemaker_session=None):
20342012 subnets = vpc_config .get ("Subnets" )
20352013 network_config = NetworkConfig (
20362014 enable_network_isolation = network_config_dict ["EnableNetworkIsolation" ],
2015+ encrypt_inter_container_traffic = network_config_dict [
2016+ "EnableInterContainerTrafficEncryption"
2017+ ],
20372018 security_group_ids = security_group_ids ,
20382019 subnets = subnets ,
20392020 )
@@ -2304,7 +2285,6 @@ def _build_create_data_quality_job_definition_request(
23042285
23052286 if network_config is not None :
23062287 network_config_dict = network_config ._to_request_dict ()
2307- self ._validate_network_config (network_config_dict )
23082288 request_dict ["NetworkConfig" ] = network_config_dict
23092289 elif existing_network_config is not None :
23102290 request_dict ["NetworkConfig" ] = existing_network_config
@@ -3007,7 +2987,6 @@ def _build_create_model_quality_job_definition_request(
30072987
30082988 if network_config is not None :
30092989 network_config_dict = network_config ._to_request_dict ()
3010- self ._validate_network_config (network_config_dict )
30112990 request_dict ["NetworkConfig" ] = network_config_dict
30122991 elif existing_network_config is not None :
30132992 request_dict ["NetworkConfig" ] = existing_network_config
0 commit comments