Skip to content
v2.278.0

MonitoringJobDefinitionProperty Struct ​

Defines the monitoring job.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sagemaker as sagemaker } from 'aws-cdk-lib';
const monitoringJobDefinitionProperty: sagemaker.CfnMonitoringSchedule.MonitoringJobDefinitionProperty = {
  monitoringAppSpecification: {
    imageUri: 'imageUri',

    // the properties below are optional
    containerArguments: ['containerArguments'],
    containerEntrypoint: ['containerEntrypoint'],
    postAnalyticsProcessorSourceUri: 'postAnalyticsProcessorSourceUri',
    recordPreprocessorSourceUri: 'recordPreprocessorSourceUri',
  },
  monitoringInputs: [{
    batchTransformInput: {
      dataCapturedDestinationS3Uri: 'dataCapturedDestinationS3Uri',
      datasetFormat: {
        csv: {
          header: false,
        },
        json: {
          line: false,
        },
        parquet: false,
      },
      localPath: 'localPath',

      // the properties below are optional
      excludeFeaturesAttribute: 'excludeFeaturesAttribute',
      s3DataDistributionType: 's3DataDistributionType',
      s3InputMode: 's3InputMode',
    },
    endpointInput: {
      endpointName: 'endpointName',
      localPath: 'localPath',

      // the properties below are optional
      excludeFeaturesAttribute: 'excludeFeaturesAttribute',
      s3DataDistributionType: 's3DataDistributionType',
      s3InputMode: 's3InputMode',
    },
  }],
  monitoringOutputConfig: {
    monitoringOutputs: [{
      s3Output: {
        localPath: 'localPath',
        s3Uri: 's3Uri',

        // the properties below are optional
        s3UploadMode: 's3UploadMode',
      },
    }],

    // the properties below are optional
    kmsKeyId: 'kmsKeyId',
  },
  monitoringResources: {
    clusterConfig: {
      instanceCount: 123,
      instanceType: 'instanceType',
      volumeSizeInGb: 123,

      // the properties below are optional
      volumeKmsKeyId: 'volumeKmsKeyId',
    },
  },
  roleArn: 'roleArn',

  // the properties below are optional
  baselineConfig: {
    constraintsResource: {
      s3Uri: 's3Uri',
    },
    statisticsResource: {
      s3Uri: 's3Uri',
    },
  },
  environment: {
    environmentKey: 'environment',
  },
  networkConfig: {
    enableInterContainerTrafficEncryption: false,
    enableNetworkIsolation: false,
    vpcConfig: {
      securityGroupIds: ['securityGroupIds'],
      subnets: ['subnets'],
    },
  },
  stoppingCondition: {
    maxRuntimeInSeconds: 123,
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sagemaker as sagemaker

monitoring_job_definition_property = sagemaker.CfnMonitoringSchedule.MonitoringJobDefinitionProperty(
    monitoring_app_specification=sagemaker.CfnMonitoringSchedule.MonitoringAppSpecificationProperty(
        image_uri="imageUri",

        # the properties below are optional
        container_arguments=["containerArguments"],
        container_entrypoint=["containerEntrypoint"],
        post_analytics_processor_source_uri="postAnalyticsProcessorSourceUri",
        record_preprocessor_source_uri="recordPreprocessorSourceUri"
    ),
    monitoring_inputs=[sagemaker.CfnMonitoringSchedule.MonitoringInputProperty(
        batch_transform_input=sagemaker.CfnMonitoringSchedule.BatchTransformInputProperty(
            data_captured_destination_s3_uri="dataCapturedDestinationS3Uri",
            dataset_format=sagemaker.CfnMonitoringSchedule.DatasetFormatProperty(
                csv=sagemaker.CfnMonitoringSchedule.CsvProperty(
                    header=False
                ),
                json=sagemaker.CfnMonitoringSchedule.JsonProperty(
                    line=False
                ),
                parquet=False
            ),
            local_path="localPath",

            # the properties below are optional
            exclude_features_attribute="excludeFeaturesAttribute",
            s3_data_distribution_type="s3DataDistributionType",
            s3_input_mode="s3InputMode"
        ),
        endpoint_input=sagemaker.CfnMonitoringSchedule.EndpointInputProperty(
            endpoint_name="endpointName",
            local_path="localPath",

            # the properties below are optional
            exclude_features_attribute="excludeFeaturesAttribute",
            s3_data_distribution_type="s3DataDistributionType",
            s3_input_mode="s3InputMode"
        )
    )],
    monitoring_output_config=sagemaker.CfnMonitoringSchedule.MonitoringOutputConfigProperty(
        monitoring_outputs=[sagemaker.CfnMonitoringSchedule.MonitoringOutputProperty(
            s3_output=sagemaker.CfnMonitoringSchedule.S3OutputProperty(
                local_path="localPath",
                s3_uri="s3Uri",

                # the properties below are optional
                s3_upload_mode="s3UploadMode"
            )
        )],

        # the properties below are optional
        kms_key_id="kmsKeyId"
    ),
    monitoring_resources=sagemaker.CfnMonitoringSchedule.MonitoringResourcesProperty(
        cluster_config=sagemaker.CfnMonitoringSchedule.ClusterConfigProperty(
            instance_count=123,
            instance_type="instanceType",
            volume_size_in_gb=123,

            # the properties below are optional
            volume_kms_key_id="volumeKmsKeyId"
        )
    ),
    role_arn="roleArn",

    # the properties below are optional
    baseline_config=sagemaker.CfnMonitoringSchedule.BaselineConfigProperty(
        constraints_resource=sagemaker.CfnMonitoringSchedule.ConstraintsResourceProperty(
            s3_uri="s3Uri"
        ),
        statistics_resource=sagemaker.CfnMonitoringSchedule.StatisticsResourceProperty(
            s3_uri="s3Uri"
        )
    ),
    environment={
        "environment_key": "environment"
    },
    network_config=sagemaker.CfnMonitoringSchedule.NetworkConfigProperty(
        enable_inter_container_traffic_encryption=False,
        enable_network_isolation=False,
        vpc_config=sagemaker.CfnMonitoringSchedule.VpcConfigProperty(
            security_group_ids=["securityGroupIds"],
            subnets=["subnets"]
        )
    ),
    stopping_condition=sagemaker.CfnMonitoringSchedule.StoppingConditionProperty(
        max_runtime_in_seconds=123
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sagemaker.*;

MonitoringJobDefinitionProperty monitoringJobDefinitionProperty = MonitoringJobDefinitionProperty.builder()
        .monitoringAppSpecification(MonitoringAppSpecificationProperty.builder()
                .imageUri("imageUri")

                // the properties below are optional
                .containerArguments(List.of("containerArguments"))
                .containerEntrypoint(List.of("containerEntrypoint"))
                .postAnalyticsProcessorSourceUri("postAnalyticsProcessorSourceUri")
                .recordPreprocessorSourceUri("recordPreprocessorSourceUri")
                .build())
        .monitoringInputs(List.of(MonitoringInputProperty.builder()
                .batchTransformInput(BatchTransformInputProperty.builder()
                        .dataCapturedDestinationS3Uri("dataCapturedDestinationS3Uri")
                        .datasetFormat(DatasetFormatProperty.builder()
                                .csv(CsvProperty.builder()
                                        .header(false)
                                        .build())
                                .json(JsonProperty.builder()
                                        .line(false)
                                        .build())
                                .parquet(false)
                                .build())
                        .localPath("localPath")

                        // the properties below are optional
                        .excludeFeaturesAttribute("excludeFeaturesAttribute")
                        .s3DataDistributionType("s3DataDistributionType")
                        .s3InputMode("s3InputMode")
                        .build())
                .endpointInput(EndpointInputProperty.builder()
                        .endpointName("endpointName")
                        .localPath("localPath")

                        // the properties below are optional
                        .excludeFeaturesAttribute("excludeFeaturesAttribute")
                        .s3DataDistributionType("s3DataDistributionType")
                        .s3InputMode("s3InputMode")
                        .build())
                .build()))
        .monitoringOutputConfig(MonitoringOutputConfigProperty.builder()
                .monitoringOutputs(List.of(MonitoringOutputProperty.builder()
                        .s3Output(S3OutputProperty.builder()
                                .localPath("localPath")
                                .s3Uri("s3Uri")

                                // the properties below are optional
                                .s3UploadMode("s3UploadMode")
                                .build())
                        .build()))

                // the properties below are optional
                .kmsKeyId("kmsKeyId")
                .build())
        .monitoringResources(MonitoringResourcesProperty.builder()
                .clusterConfig(ClusterConfigProperty.builder()
                        .instanceCount(123)
                        .instanceType("instanceType")
                        .volumeSizeInGb(123)

                        // the properties below are optional
                        .volumeKmsKeyId("volumeKmsKeyId")
                        .build())
                .build())
        .roleArn("roleArn")

        // the properties below are optional
        .baselineConfig(BaselineConfigProperty.builder()
                .constraintsResource(ConstraintsResourceProperty.builder()
                        .s3Uri("s3Uri")
                        .build())
                .statisticsResource(StatisticsResourceProperty.builder()
                        .s3Uri("s3Uri")
                        .build())
                .build())
        .environment(Map.of(
                "environmentKey", "environment"))
        .networkConfig(NetworkConfigProperty.builder()
                .enableInterContainerTrafficEncryption(false)
                .enableNetworkIsolation(false)
                .vpcConfig(VpcConfigProperty.builder()
                        .securityGroupIds(List.of("securityGroupIds"))
                        .subnets(List.of("subnets"))
                        .build())
                .build())
        .stoppingCondition(StoppingConditionProperty.builder()
                .maxRuntimeInSeconds(123)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;

var monitoringJobDefinitionProperty = new MonitoringJobDefinitionProperty {
    MonitoringAppSpecification = new MonitoringAppSpecificationProperty {
        ImageUri = "imageUri",

        // the properties below are optional
        ContainerArguments = new [] { "containerArguments" },
        ContainerEntrypoint = new [] { "containerEntrypoint" },
        PostAnalyticsProcessorSourceUri = "postAnalyticsProcessorSourceUri",
        RecordPreprocessorSourceUri = "recordPreprocessorSourceUri"
    },
    MonitoringInputs = new [] { new MonitoringInputProperty {
        BatchTransformInput = new BatchTransformInputProperty {
            DataCapturedDestinationS3Uri = "dataCapturedDestinationS3Uri",
            DatasetFormat = new DatasetFormatProperty {
                Csv = new CsvProperty {
                    Header = false
                },
                Json = new JsonProperty {
                    Line = false
                },
                Parquet = false
            },
            LocalPath = "localPath",

            // the properties below are optional
            ExcludeFeaturesAttribute = "excludeFeaturesAttribute",
            S3DataDistributionType = "s3DataDistributionType",
            S3InputMode = "s3InputMode"
        },
        EndpointInput = new EndpointInputProperty {
            EndpointName = "endpointName",
            LocalPath = "localPath",

            // the properties below are optional
            ExcludeFeaturesAttribute = "excludeFeaturesAttribute",
            S3DataDistributionType = "s3DataDistributionType",
            S3InputMode = "s3InputMode"
        }
    } },
    MonitoringOutputConfig = new MonitoringOutputConfigProperty {
        MonitoringOutputs = new [] { new MonitoringOutputProperty {
            S3Output = new S3OutputProperty {
                LocalPath = "localPath",
                S3Uri = "s3Uri",

                // the properties below are optional
                S3UploadMode = "s3UploadMode"
            }
        } },

        // the properties below are optional
        KmsKeyId = "kmsKeyId"
    },
    MonitoringResources = new MonitoringResourcesProperty {
        ClusterConfig = new ClusterConfigProperty {
            InstanceCount = 123,
            InstanceType = "instanceType",
            VolumeSizeInGb = 123,

            // the properties below are optional
            VolumeKmsKeyId = "volumeKmsKeyId"
        }
    },
    RoleArn = "roleArn",

    // the properties below are optional
    BaselineConfig = new BaselineConfigProperty {
        ConstraintsResource = new ConstraintsResourceProperty {
            S3Uri = "s3Uri"
        },
        StatisticsResource = new StatisticsResourceProperty {
            S3Uri = "s3Uri"
        }
    },
    Environment = new Dictionary<string, string> {
        { "environmentKey", "environment" }
    },
    NetworkConfig = new NetworkConfigProperty {
        EnableInterContainerTrafficEncryption = false,
        EnableNetworkIsolation = false,
        VpcConfig = new VpcConfigProperty {
            SecurityGroupIds = new [] { "securityGroupIds" },
            Subnets = new [] { "subnets" }
        }
    },
    StoppingCondition = new StoppingConditionProperty {
        MaxRuntimeInSeconds = 123
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

monitoringJobDefinitionProperty := &MonitoringJobDefinitionProperty{
	MonitoringAppSpecification: &MonitoringAppSpecificationProperty{
		ImageUri: jsii.String("imageUri"),

		// the properties below are optional
		ContainerArguments: []*string{
			jsii.String("containerArguments"),
		},
		ContainerEntrypoint: []*string{
			jsii.String("containerEntrypoint"),
		},
		PostAnalyticsProcessorSourceUri: jsii.String("postAnalyticsProcessorSourceUri"),
		RecordPreprocessorSourceUri: jsii.String("recordPreprocessorSourceUri"),
	},
	MonitoringInputs: []interface{}{
		&MonitoringInputProperty{
			BatchTransformInput: &BatchTransformInputProperty{
				DataCapturedDestinationS3Uri: jsii.String("dataCapturedDestinationS3Uri"),
				DatasetFormat: &DatasetFormatProperty{
					Csv: &CsvProperty{
						Header: jsii.Boolean(false),
					},
					Json: &JsonProperty{
						Line: jsii.Boolean(false),
					},
					Parquet: jsii.Boolean(false),
				},
				LocalPath: jsii.String("localPath"),

				// the properties below are optional
				ExcludeFeaturesAttribute: jsii.String("excludeFeaturesAttribute"),
				S3DataDistributionType: jsii.String("s3DataDistributionType"),
				S3InputMode: jsii.String("s3InputMode"),
			},
			EndpointInput: &EndpointInputProperty{
				EndpointName: jsii.String("endpointName"),
				LocalPath: jsii.String("localPath"),

				// the properties below are optional
				ExcludeFeaturesAttribute: jsii.String("excludeFeaturesAttribute"),
				S3DataDistributionType: jsii.String("s3DataDistributionType"),
				S3InputMode: jsii.String("s3InputMode"),
			},
		},
	},
	MonitoringOutputConfig: &MonitoringOutputConfigProperty{
		MonitoringOutputs: []interface{}{
			&MonitoringOutputProperty{
				S3Output: &S3OutputProperty{
					LocalPath: jsii.String("localPath"),
					S3Uri: jsii.String("s3Uri"),

					// the properties below are optional
					S3UploadMode: jsii.String("s3UploadMode"),
				},
			},
		},

		// the properties below are optional
		KmsKeyId: jsii.String("kmsKeyId"),
	},
	MonitoringResources: &MonitoringResourcesProperty{
		ClusterConfig: &ClusterConfigProperty{
			InstanceCount: jsii.Number(123),
			InstanceType: jsii.String("instanceType"),
			VolumeSizeInGb: jsii.Number(123),

			// the properties below are optional
			VolumeKmsKeyId: jsii.String("volumeKmsKeyId"),
		},
	},
	RoleArn: jsii.String("roleArn"),

	// the properties below are optional
	BaselineConfig: &BaselineConfigProperty{
		ConstraintsResource: &ConstraintsResourceProperty{
			S3Uri: jsii.String("s3Uri"),
		},
		StatisticsResource: &StatisticsResourceProperty{
			S3Uri: jsii.String("s3Uri"),
		},
	},
	Environment: map[string]*string{
		"environmentKey": jsii.String("environment"),
	},
	NetworkConfig: &NetworkConfigProperty{
		EnableInterContainerTrafficEncryption: jsii.Boolean(false),
		EnableNetworkIsolation: jsii.Boolean(false),
		VpcConfig: &VpcConfigProperty{
			SecurityGroupIds: []*string{
				jsii.String("securityGroupIds"),
			},
			Subnets: []*string{
				jsii.String("subnets"),
			},
		},
	},
	StoppingCondition: &StoppingConditionProperty{
		MaxRuntimeInSeconds: jsii.Number(123),
	},
}

Properties ​

baselineConfigoptionalIResolvable | CfnMonitoringSchedule.BaselineConfigPropertybaseline_configoptionaltyping.Union[IResolvable, BaselineConfigProperty]baselineConfigoptionalIResolvableBaselineConfigoptionalIResolvableBaselineConfigoptionalinterface{} #
Baseline configuration used to validate that the data conforms to the specified constraints and statistics.
environmentoptionalIResolvable | { [key: string]: string }environmentoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]environmentoptionalIResolvableEnvironmentoptionalIResolvableEnvironmentoptionalinterface{} #
Sets the environment variables in the Docker container.
monitoringAppSpecificationIResolvable | CfnMonitoringSchedule.MonitoringAppSpecificationPropertymonitoring_app_specificationtyping.Union[IResolvable, MonitoringAppSpecificationProperty]monitoringAppSpecificationIResolvableMonitoringAppSpecificationIResolvableMonitoringAppSpecificationinterface{} required #
Configures the monitoring job to run a specified Docker container image.
monitoringInputsIResolvable | IResolvable | CfnMonitoringSchedule.MonitoringInputProperty[]monitoring_inputstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, MonitoringInputProperty]]]monitoringInputsIResolvableMonitoringInputsIResolvableMonitoringInputsinterface{} required #
The array of inputs for the monitoring job.

Currently we support monitoring an Amazon SageMaker AI Endpoint.

monitoringOutputConfigIResolvable | CfnMonitoringSchedule.MonitoringOutputConfigPropertymonitoring_output_configtyping.Union[IResolvable, MonitoringOutputConfigProperty]monitoringOutputConfigIResolvableMonitoringOutputConfigIResolvableMonitoringOutputConfiginterface{} required #
The array of outputs from the monitoring job to be uploaded to Amazon S3.
monitoringResourcesIResolvable | CfnMonitoringSchedule.MonitoringResourcesPropertymonitoring_resourcestyping.Union[IResolvable, MonitoringResourcesProperty]monitoringResourcesIResolvableMonitoringResourcesIResolvableMonitoringResourcesinterface{} required #
Identifies the resources, ML compute instances, and ML storage volumes to deploy for a monitoring job.

In distributed processing, you specify more than one instance.

networkConfigoptionalIResolvable | CfnMonitoringSchedule.NetworkConfigPropertynetwork_configoptionaltyping.Union[IResolvable, NetworkConfigProperty]networkConfigoptionalIResolvableNetworkConfigoptionalIResolvableNetworkConfigoptionalinterface{} #
Specifies networking options for an monitoring job.
roleArnstringrole_arnstrroleArnStringRoleArnstringRoleArn*string required #
The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on your behalf.
stoppingConditionoptionalIResolvable | CfnMonitoringSchedule.StoppingConditionPropertystopping_conditionoptionaltyping.Union[IResolvable, StoppingConditionProperty]stoppingConditionoptionalIResolvableStoppingConditionoptionalIResolvableStoppingConditionoptionalinterface{} #
Specifies a time limit for how long the monitoring job is allowed to run.