8989OBJECT = "object"
9090ADDITIONAL_PROPERTIES = "additionalProperties"
9191ENABLE_INTER_CONTAINER_TRAFFIC_ENCRYPTION = "EnableInterContainerTrafficEncryption"
92+ SESSION = "Session"
93+ S3_BUCKET = "S3Bucket"
9294
9395
9496def _simple_path (* args : str ):
9597 """Appends an arbitrary number of strings to use as path constants"""
9698 return "." .join (args )
9799
98100
101+ # Paths for reference elsewhere in the SDK.
99102COMPILATION_JOB_VPC_CONFIG_PATH = _simple_path (SAGEMAKER , COMPILATION_JOB , VPC_CONFIG )
100103COMPILATION_JOB_KMS_KEY_ID_PATH = _simple_path (
101104 SAGEMAKER , COMPILATION_JOB , OUTPUT_CONFIG , KMS_KEY_ID
@@ -231,7 +234,6 @@ def _simple_path(*args: str):
231234MODEL_PACKAGE_VALIDATION_PROFILES_PATH = _simple_path (
232235 SAGEMAKER , MODEL_PACKAGE , VALIDATION_SPECIFICATION , VALIDATION_PROFILES
233236)
234-
235237REMOTE_FUNCTION_DEPENDENCIES = _simple_path (
236238 SAGEMAKER , PYTHON_SDK , MODULES , REMOTE_FUNCTION , DEPENDENCIES
237239)
@@ -274,9 +276,6 @@ def _simple_path(*args: str):
274276REMOTE_FUNCTION_ENABLE_INTER_CONTAINER_TRAFFIC_ENCRYPTION = _simple_path (
275277 SAGEMAKER , PYTHON_SDK , MODULES , REMOTE_FUNCTION , ENABLE_INTER_CONTAINER_TRAFFIC_ENCRYPTION
276278)
277-
278- # Paths for reference elsewhere in the SDK.
279- # Names include the schema version since the paths could change with other schema versions
280279MONITORING_SCHEDULE_INTER_CONTAINER_ENCRYPTION_PATH = _simple_path (
281280 SAGEMAKER ,
282281 MONITORING_SCHEDULE ,
@@ -298,6 +297,7 @@ def _simple_path(*args: str):
298297TRAINING_JOB_INTER_CONTAINER_ENCRYPTION_PATH = _simple_path (
299298 SAGEMAKER , TRAINING_JOB , ENABLE_INTER_CONTAINER_TRAFFIC_ENCRYPTION
300299)
300+ SESSION_S3_BUCKET_PATH = _simple_path (SAGEMAKER , PYTHON_SDK , MODULES , SESSION , S3_BUCKET )
301301
302302SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA = {
303303 "$schema" : "https://json-schema.org/draft/2020-12/schema" ,
@@ -447,6 +447,16 @@ def _simple_path(*args: str):
447447 "s3Uri" : {TYPE : "string" , "pattern" : "^(https|s3)://([^/]+)/?(.*)$" , "maxLength" : 1024 },
448448 # Regex is taken from https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AlgorithmSpecification.html#sagemaker-Type-AlgorithmSpecification-ContainerEntrypoint
449449 "preExecutionCommand" : {TYPE : "string" , "pattern" : r".*" },
450+
451+ # Regex based on https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_PipelineDefinitionS3Location.html
452+ # except with an additional ^ and $ for the beginning and the end to closer align to
453+ # https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html
454+ "s3Bucket" : {
455+ TYPE : "string" ,
456+ "pattern" : r"^[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9]$" ,
457+ "minLength" : 3 ,
458+ "maxLength" : 63 ,
459+ },
450460 },
451461 PROPERTIES : {
452462 SCHEMA_VERSION : {
@@ -477,6 +487,16 @@ def _simple_path(*args: str):
477487 TYPE : OBJECT ,
478488 ADDITIONAL_PROPERTIES : False ,
479489 PROPERTIES : {
490+ SESSION : {
491+ TYPE : OBJECT ,
492+ ADDITIONAL_PROPERTIES : False ,
493+ PROPERTIES : {
494+ S3_BUCKET : {
495+ "description" : "Used as `default_bucket` of Session" ,
496+ "$ref" : "#/definitions/s3Bucket" ,
497+ },
498+ },
499+ },
480500 REMOTE_FUNCTION : {
481501 TYPE : OBJECT ,
482502 ADDITIONAL_PROPERTIES : False ,
@@ -504,9 +524,9 @@ def _simple_path(*args: str):
504524 VOLUME_KMS_KEY_ID : {"$ref" : "#/definitions/kmsKeyId" },
505525 VPC_CONFIG : {"$ref" : "#/definitions/vpcConfig" },
506526 },
507- }
527+ },
508528 },
509- }
529+ },
510530 },
511531 },
512532 # Feature Group
0 commit comments