CfnModelPackage
- class aws_cdk.aws_sagemaker.CfnModelPackage(scope, id, *, additional_inference_specification_definition=None, additional_inference_specifications=None, additional_inference_specifications_to_add=None, approval_description=None, certify_for_marketplace=None, client_token=None, created_by=None, customer_metadata_properties=None, domain=None, drift_check_baselines=None, environment=None, inference_specification=None, last_modified_by=None, last_modified_time=None, metadata_properties=None, model_approval_status=None, model_metrics=None, model_package_description=None, model_package_group_name=None, model_package_name=None, model_package_status_details=None, model_package_status_item=None, model_package_version=None, sample_payload_url=None, source_algorithm_specification=None, tags=None, task=None, validation_specification=None)
Bases:
CfnResource
A CloudFormation
AWS::SageMaker::ModelPackage
.A versioned model that can be deployed for SageMaker inference.
- CloudformationResource:
AWS::SageMaker::ModelPackage
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker # model_input: Any cfn_model_package = sagemaker.CfnModelPackage(self, "MyCfnModelPackage", additional_inference_specification_definition=sagemaker.CfnModelPackage.AdditionalInferenceSpecificationDefinitionProperty( containers=[sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty( image="image", # the properties below are optional container_hostname="containerHostname", environment={ "environment_key": "environment" }, framework="framework", framework_version="frameworkVersion", image_digest="imageDigest", model_data_url="modelDataUrl", model_input=model_input, nearest_model_name="nearestModelName", product_id="productId" )], name="name", # the properties below are optional description="description", supported_content_types=["supportedContentTypes"], supported_realtime_inference_instance_types=["supportedRealtimeInferenceInstanceTypes"], supported_response_mime_types=["supportedResponseMimeTypes"], supported_transform_instance_types=["supportedTransformInstanceTypes"] ), additional_inference_specifications=[sagemaker.CfnModelPackage.AdditionalInferenceSpecificationDefinitionProperty( containers=[sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty( image="image", # the properties below are optional container_hostname="containerHostname", environment={ "environment_key": "environment" }, framework="framework", framework_version="frameworkVersion", image_digest="imageDigest", model_data_url="modelDataUrl", model_input=model_input, nearest_model_name="nearestModelName", product_id="productId" )], name="name", # the properties below are optional description="description", supported_content_types=["supportedContentTypes"], supported_realtime_inference_instance_types=["supportedRealtimeInferenceInstanceTypes"], supported_response_mime_types=["supportedResponseMimeTypes"], supported_transform_instance_types=["supportedTransformInstanceTypes"] )], additional_inference_specifications_to_add=[sagemaker.CfnModelPackage.AdditionalInferenceSpecificationDefinitionProperty( containers=[sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty( image="image", # the properties below are optional container_hostname="containerHostname", environment={ "environment_key": "environment" }, framework="framework", framework_version="frameworkVersion", image_digest="imageDigest", model_data_url="modelDataUrl", model_input=model_input, nearest_model_name="nearestModelName", product_id="productId" )], name="name", # the properties below are optional description="description", supported_content_types=["supportedContentTypes"], supported_realtime_inference_instance_types=["supportedRealtimeInferenceInstanceTypes"], supported_response_mime_types=["supportedResponseMimeTypes"], supported_transform_instance_types=["supportedTransformInstanceTypes"] )], approval_description="approvalDescription", certify_for_marketplace=False, client_token="clientToken", created_by=sagemaker.CfnModelPackage.UserContextProperty( domain_id="domainId", user_profile_arn="userProfileArn", user_profile_name="userProfileName" ), customer_metadata_properties={ "customer_metadata_properties_key": "customerMetadataProperties" }, domain="domain", drift_check_baselines=sagemaker.CfnModelPackage.DriftCheckBaselinesProperty( bias=sagemaker.CfnModelPackage.DriftCheckBiasProperty( config_file=sagemaker.CfnModelPackage.FileSourceProperty( s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest", content_type="contentType" ), post_training_constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), pre_training_constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), explainability=sagemaker.CfnModelPackage.DriftCheckExplainabilityProperty( config_file=sagemaker.CfnModelPackage.FileSourceProperty( s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest", content_type="contentType" ), constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), model_data_quality=sagemaker.CfnModelPackage.DriftCheckModelDataQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), model_quality=sagemaker.CfnModelPackage.DriftCheckModelQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ) ), environment={ "environment_key": "environment" }, inference_specification=sagemaker.CfnModelPackage.InferenceSpecificationProperty( containers=[sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty( image="image", # the properties below are optional container_hostname="containerHostname", environment={ "environment_key": "environment" }, framework="framework", framework_version="frameworkVersion", image_digest="imageDigest", model_data_url="modelDataUrl", model_input=model_input, nearest_model_name="nearestModelName", product_id="productId" )], supported_content_types=["supportedContentTypes"], supported_response_mime_types=["supportedResponseMimeTypes"], # the properties below are optional supported_realtime_inference_instance_types=["supportedRealtimeInferenceInstanceTypes"], supported_transform_instance_types=["supportedTransformInstanceTypes"] ), last_modified_by=sagemaker.CfnModelPackage.UserContextProperty( domain_id="domainId", user_profile_arn="userProfileArn", user_profile_name="userProfileName" ), last_modified_time="lastModifiedTime", metadata_properties=sagemaker.CfnModelPackage.MetadataPropertiesProperty( commit_id="commitId", generated_by="generatedBy", project_id="projectId", repository="repository" ), model_approval_status="modelApprovalStatus", model_metrics=sagemaker.CfnModelPackage.ModelMetricsProperty( bias=sagemaker.CfnModelPackage.BiasProperty( post_training_report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), pre_training_report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), explainability=sagemaker.CfnModelPackage.ExplainabilityProperty( report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), model_data_quality=sagemaker.CfnModelPackage.ModelDataQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), model_quality=sagemaker.CfnModelPackage.ModelQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ) ), model_package_description="modelPackageDescription", model_package_group_name="modelPackageGroupName", model_package_name="modelPackageName", model_package_status_details=sagemaker.CfnModelPackage.ModelPackageStatusDetailsProperty( validation_statuses=[sagemaker.CfnModelPackage.ModelPackageStatusItemProperty( name="name", status="status", # the properties below are optional failure_reason="failureReason" )], # the properties below are optional image_scan_statuses=[sagemaker.CfnModelPackage.ModelPackageStatusItemProperty( name="name", status="status", # the properties below are optional failure_reason="failureReason" )] ), model_package_status_item=sagemaker.CfnModelPackage.ModelPackageStatusItemProperty( name="name", status="status", # the properties below are optional failure_reason="failureReason" ), model_package_version=123, sample_payload_url="samplePayloadUrl", source_algorithm_specification=sagemaker.CfnModelPackage.SourceAlgorithmSpecificationProperty( source_algorithms=[sagemaker.CfnModelPackage.SourceAlgorithmProperty( algorithm_name="algorithmName", # the properties below are optional model_data_url="modelDataUrl" )] ), tags=[CfnTag( key="key", value="value" )], task="task", validation_specification=sagemaker.CfnModelPackage.ValidationSpecificationProperty( validation_profiles=[sagemaker.CfnModelPackage.ValidationProfileProperty( profile_name="profileName", transform_job_definition=sagemaker.CfnModelPackage.TransformJobDefinitionProperty( transform_input=sagemaker.CfnModelPackage.TransformInputProperty( data_source=sagemaker.CfnModelPackage.DataSourceProperty( s3_data_source=sagemaker.CfnModelPackage.S3DataSourceProperty( s3_data_type="s3DataType", s3_uri="s3Uri" ) ), # the properties below are optional compression_type="compressionType", content_type="contentType", split_type="splitType" ), transform_output=sagemaker.CfnModelPackage.TransformOutputProperty( s3_output_path="s3OutputPath", # the properties below are optional accept="accept", assemble_with="assembleWith", kms_key_id="kmsKeyId" ), transform_resources=sagemaker.CfnModelPackage.TransformResourcesProperty( instance_count=123, instance_type="instanceType", # the properties below are optional volume_kms_key_id="volumeKmsKeyId" ), # the properties below are optional batch_strategy="batchStrategy", environment={ "environment_key": "environment" }, max_concurrent_transforms=123, max_payload_in_mb=123 ) )], validation_role="validationRole" ) )
Create a new
AWS::SageMaker::ModelPackage
.- Parameters:
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
additional_inference_specification_definition (
Union
[IResolvable
,AdditionalInferenceSpecificationDefinitionProperty
,Dict
[str
,Any
],None
]) – A structure of additional Inference Specification. Additional Inference Specification specifies details about inference jobs that can be run with models based on this model packageadditional_inference_specifications (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,AdditionalInferenceSpecificationDefinitionProperty
,Dict
[str
,Any
]]],None
]) – An array of additional Inference Specification objects.additional_inference_specifications_to_add (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,AdditionalInferenceSpecificationDefinitionProperty
,Dict
[str
,Any
]]],None
]) – An array of additional Inference Specification objects to be added to the existing array. The total number of additional Inference Specification objects cannot exceed 15. Each additional Inference Specification object specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.approval_description (
Optional
[str
]) – A description provided when the model approval is set.certify_for_marketplace (
Union
[bool
,IResolvable
,None
]) – Whether the model package is to be certified to be listed on AWS Marketplace. For information about listing model packages on AWS Marketplace, see List Your Algorithm or Model Package on AWS Marketplace .client_token (
Optional
[str
]) – A unique token that guarantees that the call to this API is idempotent.created_by (
Union
[IResolvable
,UserContextProperty
,Dict
[str
,Any
],None
]) – Information about the user who created or modified an experiment, trial, trial component, lineage group, or project.customer_metadata_properties (
Union
[IResolvable
,Mapping
[str
,str
],None
]) – The metadata properties for the model package.domain (
Optional
[str
]) – The machine learning domain of your model package and its components. Common machine learning domains include computer vision and natural language processing.drift_check_baselines (
Union
[IResolvable
,DriftCheckBaselinesProperty
,Dict
[str
,Any
],None
]) – Represents the drift check baselines that can be used when the model monitor is set using the model package.environment (
Union
[IResolvable
,Mapping
[str
,str
],None
]) – The environment variables to set in the Docker container. Each key and value in theEnvironment
string to string map can have length of up to 1024. We support up to 16 entries in the map.inference_specification (
Union
[IResolvable
,InferenceSpecificationProperty
,Dict
[str
,Any
],None
]) – Defines how to perform inference generation after a training job is run.last_modified_by (
Union
[IResolvable
,UserContextProperty
,Dict
[str
,Any
],None
]) – Information about the user who created or modified an experiment, trial, trial component, lineage group, or project.last_modified_time (
Optional
[str
]) – The last time the model package was modified.metadata_properties (
Union
[IResolvable
,MetadataPropertiesProperty
,Dict
[str
,Any
],None
]) – Metadata properties of the tracking entity, trial, or trial component.model_approval_status (
Optional
[str
]) – The approval status of the model. This can be one of the following values. -APPROVED
- The model is approved -REJECTED
- The model is rejected. -PENDING_MANUAL_APPROVAL
- The model is waiting for manual approval.model_metrics (
Union
[IResolvable
,ModelMetricsProperty
,Dict
[str
,Any
],None
]) – Metrics for the model.model_package_description (
Optional
[str
]) – The description of the model package.model_package_group_name (
Optional
[str
]) – The model group to which the model belongs.model_package_name (
Optional
[str
]) – The name of the model.model_package_status_details (
Union
[IResolvable
,ModelPackageStatusDetailsProperty
,Dict
[str
,Any
],None
]) – Specifies the validation and image scan statuses of the model package.model_package_status_item (
Union
[IResolvable
,ModelPackageStatusItemProperty
,Dict
[str
,Any
],None
]) – Represents the overall status of a model package.model_package_version (
Union
[int
,float
,None
]) – The version number of a versioned model.sample_payload_url (
Optional
[str
]) – The Amazon Simple Storage Service path where the sample payload are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix).source_algorithm_specification (
Union
[IResolvable
,SourceAlgorithmSpecificationProperty
,Dict
[str
,Any
],None
]) – A list of algorithms that were used to create a model package.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – A list of the tags associated with the model package. For more information, see Tagging AWS resources in the AWS General Reference Guide .task (
Optional
[str
]) – The machine learning task your model package accomplishes. Common machine learning tasks include object detection and image classification.validation_specification (
Union
[IResolvable
,ValidationSpecificationProperty
,Dict
[str
,Any
],None
]) – Specifies batch transform jobs that SageMaker runs to validate your model package.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_depends_on(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
- Return type:
None
- get_att(attribute_name)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type:
None
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::SageMaker::ModelPackage'
- additional_inference_specification_definition
A structure of additional Inference Specification.
Additional Inference Specification specifies details about inference jobs that can be run with models based on this model package
- additional_inference_specifications
An array of additional Inference Specification objects.
- additional_inference_specifications_to_add
An array of additional Inference Specification objects to be added to the existing array.
The total number of additional Inference Specification objects cannot exceed 15. Each additional Inference Specification object specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.
- approval_description
A description provided when the model approval is set.
- attr_creation_time
The time that the model package was created.
- CloudformationAttribute:
CreationTime
- attr_model_package_arn
The Amazon Resource Name (ARN) of the model package.
- CloudformationAttribute:
ModelPackageArn
- attr_model_package_status
The status of the model package. This can be one of the following values.
PENDING
- The model package creation is pending.IN_PROGRESS
- The model package is in the process of being created.COMPLETED
- The model package was successfully created.FAILED
- The model package creation failed.DELETING
- The model package is in the process of being deleted.
- CloudformationAttribute:
ModelPackageStatus
- certify_for_marketplace
Whether the model package is to be certified to be listed on AWS Marketplace.
For information about listing model packages on AWS Marketplace, see List Your Algorithm or Model Package on AWS Marketplace .
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- client_token
A unique token that guarantees that the call to this API is idempotent.
- created_by
Information about the user who created or modified an experiment, trial, trial component, lineage group, or project.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- customer_metadata_properties
The metadata properties for the model package.
- domain
The machine learning domain of your model package and its components.
Common machine learning domains include computer vision and natural language processing.
- drift_check_baselines
Represents the drift check baselines that can be used when the model monitor is set using the model package.
- environment
The environment variables to set in the Docker container.
Each key and value in the
Environment
string to string map can have length of up to 1024. We support up to 16 entries in the map.
- inference_specification
Defines how to perform inference generation after a training job is run.
- last_modified_by
Information about the user who created or modified an experiment, trial, trial component, lineage group, or project.
- last_modified_time
The last time the model package was modified.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- metadata_properties
Metadata properties of the tracking entity, trial, or trial component.
- model_approval_status
The approval status of the model. This can be one of the following values.
APPROVED
- The model is approvedREJECTED
- The model is rejected.PENDING_MANUAL_APPROVAL
- The model is waiting for manual approval.
- model_metrics
Metrics for the model.
- model_package_description
The description of the model package.
- model_package_group_name
The model group to which the model belongs.
- model_package_name
The name of the model.
- model_package_status_details
Specifies the validation and image scan statuses of the model package.
- model_package_status_item
Represents the overall status of a model package.
- model_package_version
The version number of a versioned model.
- node
The construct tree node associated with this construct.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- sample_payload_url
The Amazon Simple Storage Service path where the sample payload are stored.
This path must point to a single gzip compressed tar archive (.tar.gz suffix).
- source_algorithm_specification
A list of algorithms that were used to create a model package.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
A list of the tags associated with the model package.
For more information, see Tagging AWS resources in the AWS General Reference Guide .
- task
The machine learning task your model package accomplishes.
Common machine learning tasks include object detection and image classification.
- validation_specification
Specifies batch transform jobs that SageMaker runs to validate your model package.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(construct)
Check whether the given construct is a CfnResource.
- Parameters:
construct (
IConstruct
) –- Return type:
bool
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
) –- Return type:
bool
AdditionalInferenceSpecificationDefinitionProperty
- class CfnModelPackage.AdditionalInferenceSpecificationDefinitionProperty(*, containers, name, description=None, supported_content_types=None, supported_realtime_inference_instance_types=None, supported_response_mime_types=None, supported_transform_instance_types=None)
Bases:
object
A structure of additional Inference Specification.
Additional Inference Specification specifies details about inference jobs that can be run with models based on this model package
- Parameters:
containers (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ModelPackageContainerDefinitionProperty
,Dict
[str
,Any
]]]]) – The Amazon ECR registry path of the Docker image that contains the inference code.name (
str
) – A unique name to identify the additional inference specification. The name must be unique within the list of your additional inference specifications for a particular model package.description (
Optional
[str
]) – A description of the additional Inference specification.supported_content_types (
Optional
[Sequence
[str
]]) – The supported MIME types for the input data.supported_realtime_inference_instance_types (
Optional
[Sequence
[str
]]) – A list of the instance types that are used to generate inferences in real-time.supported_response_mime_types (
Optional
[Sequence
[str
]]) – The supported MIME types for the output data.supported_transform_instance_types (
Optional
[Sequence
[str
]]) – A list of the instance types on which a transformation job can be run or on which an endpoint can be deployed.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker # model_input: Any additional_inference_specification_definition_property = sagemaker.CfnModelPackage.AdditionalInferenceSpecificationDefinitionProperty( containers=[sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty( image="image", # the properties below are optional container_hostname="containerHostname", environment={ "environment_key": "environment" }, framework="framework", framework_version="frameworkVersion", image_digest="imageDigest", model_data_url="modelDataUrl", model_input=model_input, nearest_model_name="nearestModelName", product_id="productId" )], name="name", # the properties below are optional description="description", supported_content_types=["supportedContentTypes"], supported_realtime_inference_instance_types=["supportedRealtimeInferenceInstanceTypes"], supported_response_mime_types=["supportedResponseMimeTypes"], supported_transform_instance_types=["supportedTransformInstanceTypes"] )
Attributes
- containers
The Amazon ECR registry path of the Docker image that contains the inference code.
- description
A description of the additional Inference specification.
- name
A unique name to identify the additional inference specification.
The name must be unique within the list of your additional inference specifications for a particular model package.
- supported_content_types
The supported MIME types for the input data.
- supported_realtime_inference_instance_types
A list of the instance types that are used to generate inferences in real-time.
- supported_response_mime_types
The supported MIME types for the output data.
- supported_transform_instance_types
A list of the instance types on which a transformation job can be run or on which an endpoint can be deployed.
BiasProperty
- class CfnModelPackage.BiasProperty(*, post_training_report=None, pre_training_report=None, report=None)
Bases:
object
Contains bias metrics for a model.
- Parameters:
post_training_report (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The post-training bias report for a model.pre_training_report (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The pre-training bias report for a model.report (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The bias report for a model.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker bias_property = sagemaker.CfnModelPackage.BiasProperty( post_training_report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), pre_training_report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) )
Attributes
- post_training_report
The post-training bias report for a model.
- pre_training_report
The pre-training bias report for a model.
- report
The bias report for a model.
DataSourceProperty
- class CfnModelPackage.DataSourceProperty(*, s3_data_source)
Bases:
object
Describes the location of the channel data.
- Parameters:
s3_data_source (
Union
[IResolvable
,S3DataSourceProperty
,Dict
[str
,Any
]]) – The S3 location of the data source that is associated with a channel.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker data_source_property = sagemaker.CfnModelPackage.DataSourceProperty( s3_data_source=sagemaker.CfnModelPackage.S3DataSourceProperty( s3_data_type="s3DataType", s3_uri="s3Uri" ) )
Attributes
- s3_data_source
The S3 location of the data source that is associated with a channel.
DriftCheckBaselinesProperty
- class CfnModelPackage.DriftCheckBaselinesProperty(*, bias=None, explainability=None, model_data_quality=None, model_quality=None)
Bases:
object
Represents the drift check baselines that can be used when the model monitor is set using the model package.
- Parameters:
bias (
Union
[IResolvable
,DriftCheckBiasProperty
,Dict
[str
,Any
],None
]) – Represents the drift check bias baselines that can be used when the model monitor is set using the model package.explainability (
Union
[IResolvable
,DriftCheckExplainabilityProperty
,Dict
[str
,Any
],None
]) – Represents the drift check explainability baselines that can be used when the model monitor is set using the model package.model_data_quality (
Union
[IResolvable
,DriftCheckModelDataQualityProperty
,Dict
[str
,Any
],None
]) – Represents the drift check model data quality baselines that can be used when the model monitor is set using the model package.model_quality (
Union
[IResolvable
,DriftCheckModelQualityProperty
,Dict
[str
,Any
],None
]) – Represents the drift check model quality baselines that can be used when the model monitor is set using the model package.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker drift_check_baselines_property = sagemaker.CfnModelPackage.DriftCheckBaselinesProperty( bias=sagemaker.CfnModelPackage.DriftCheckBiasProperty( config_file=sagemaker.CfnModelPackage.FileSourceProperty( s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest", content_type="contentType" ), post_training_constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), pre_training_constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), explainability=sagemaker.CfnModelPackage.DriftCheckExplainabilityProperty( config_file=sagemaker.CfnModelPackage.FileSourceProperty( s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest", content_type="contentType" ), constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), model_data_quality=sagemaker.CfnModelPackage.DriftCheckModelDataQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), model_quality=sagemaker.CfnModelPackage.DriftCheckModelQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ) )
Attributes
- bias
Represents the drift check bias baselines that can be used when the model monitor is set using the model package.
- explainability
Represents the drift check explainability baselines that can be used when the model monitor is set using the model package.
- model_data_quality
Represents the drift check model data quality baselines that can be used when the model monitor is set using the model package.
- model_quality
Represents the drift check model quality baselines that can be used when the model monitor is set using the model package.
DriftCheckBiasProperty
- class CfnModelPackage.DriftCheckBiasProperty(*, config_file=None, post_training_constraints=None, pre_training_constraints=None)
Bases:
object
Represents the drift check bias baselines that can be used when the model monitor is set using the model package.
- Parameters:
config_file (
Union
[IResolvable
,FileSourceProperty
,Dict
[str
,Any
],None
]) – The bias config file for a model.post_training_constraints (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The post-training constraints.pre_training_constraints (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The pre-training constraints.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker drift_check_bias_property = sagemaker.CfnModelPackage.DriftCheckBiasProperty( config_file=sagemaker.CfnModelPackage.FileSourceProperty( s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest", content_type="contentType" ), post_training_constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), pre_training_constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) )
Attributes
- config_file
The bias config file for a model.
- post_training_constraints
The post-training constraints.
- pre_training_constraints
The pre-training constraints.
DriftCheckExplainabilityProperty
- class CfnModelPackage.DriftCheckExplainabilityProperty(*, config_file=None, constraints=None)
Bases:
object
Represents the drift check explainability baselines that can be used when the model monitor is set using the model package.
- Parameters:
config_file (
Union
[IResolvable
,FileSourceProperty
,Dict
[str
,Any
],None
]) – The explainability config file for the model.constraints (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The drift check explainability constraints.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker drift_check_explainability_property = sagemaker.CfnModelPackage.DriftCheckExplainabilityProperty( config_file=sagemaker.CfnModelPackage.FileSourceProperty( s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest", content_type="contentType" ), constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) )
Attributes
- config_file
The explainability config file for the model.
- constraints
The drift check explainability constraints.
DriftCheckModelDataQualityProperty
- class CfnModelPackage.DriftCheckModelDataQualityProperty(*, constraints=None, statistics=None)
Bases:
object
Represents the drift check data quality baselines that can be used when the model monitor is set using the model package.
- Parameters:
constraints (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The drift check model data quality constraints.statistics (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The drift check model data quality statistics.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker drift_check_model_data_quality_property = sagemaker.CfnModelPackage.DriftCheckModelDataQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) )
Attributes
- constraints
The drift check model data quality constraints.
- statistics
The drift check model data quality statistics.
DriftCheckModelQualityProperty
- class CfnModelPackage.DriftCheckModelQualityProperty(*, constraints=None, statistics=None)
Bases:
object
Represents the drift check model quality baselines that can be used when the model monitor is set using the model package.
- Parameters:
constraints (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The drift check model quality constraints.statistics (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The drift check model quality statistics.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker drift_check_model_quality_property = sagemaker.CfnModelPackage.DriftCheckModelQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) )
Attributes
- constraints
The drift check model quality constraints.
- statistics
The drift check model quality statistics.
ExplainabilityProperty
- class CfnModelPackage.ExplainabilityProperty(*, report=None)
Bases:
object
Contains explainability metrics for a model.
- Parameters:
report (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – The explainability report for a model.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker explainability_property = sagemaker.CfnModelPackage.ExplainabilityProperty( report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) )
Attributes
- report
The explainability report for a model.
FileSourceProperty
- class CfnModelPackage.FileSourceProperty(*, s3_uri, content_digest=None, content_type=None)
Bases:
object
Contains details regarding the file source.
- Parameters:
s3_uri (
str
) – The Amazon S3 URI for the file source.content_digest (
Optional
[str
]) – The digest of the file source.content_type (
Optional
[str
]) – The type of content stored in the file source.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker file_source_property = sagemaker.CfnModelPackage.FileSourceProperty( s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest", content_type="contentType" )
Attributes
- content_digest
The digest of the file source.
- content_type
The type of content stored in the file source.
- s3_uri
The Amazon S3 URI for the file source.
InferenceSpecificationProperty
- class CfnModelPackage.InferenceSpecificationProperty(*, containers, supported_content_types, supported_response_mime_types, supported_realtime_inference_instance_types=None, supported_transform_instance_types=None)
Bases:
object
Defines how to perform inference generation after a training job is run.
- Parameters:
containers (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ModelPackageContainerDefinitionProperty
,Dict
[str
,Any
]]]]) – The Amazon ECR registry path of the Docker image that contains the inference code.supported_content_types (
Sequence
[str
]) – The supported MIME types for the input data.supported_response_mime_types (
Sequence
[str
]) – The supported MIME types for the output data.supported_realtime_inference_instance_types (
Optional
[Sequence
[str
]]) – A list of the instance types that are used to generate inferences in real-time. This parameter is required for unversioned models, and optional for versioned models.supported_transform_instance_types (
Optional
[Sequence
[str
]]) – A list of the instance types on which a transformation job can be run or on which an endpoint can be deployed. This parameter is required for unversioned models, and optional for versioned models.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker # model_input: Any inference_specification_property = sagemaker.CfnModelPackage.InferenceSpecificationProperty( containers=[sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty( image="image", # the properties below are optional container_hostname="containerHostname", environment={ "environment_key": "environment" }, framework="framework", framework_version="frameworkVersion", image_digest="imageDigest", model_data_url="modelDataUrl", model_input=model_input, nearest_model_name="nearestModelName", product_id="productId" )], supported_content_types=["supportedContentTypes"], supported_response_mime_types=["supportedResponseMimeTypes"], # the properties below are optional supported_realtime_inference_instance_types=["supportedRealtimeInferenceInstanceTypes"], supported_transform_instance_types=["supportedTransformInstanceTypes"] )
Attributes
- containers
The Amazon ECR registry path of the Docker image that contains the inference code.
- supported_content_types
The supported MIME types for the input data.
- supported_realtime_inference_instance_types
A list of the instance types that are used to generate inferences in real-time.
This parameter is required for unversioned models, and optional for versioned models.
- supported_response_mime_types
The supported MIME types for the output data.
- supported_transform_instance_types
A list of the instance types on which a transformation job can be run or on which an endpoint can be deployed.
This parameter is required for unversioned models, and optional for versioned models.
MetadataPropertiesProperty
- class CfnModelPackage.MetadataPropertiesProperty(*, commit_id=None, generated_by=None, project_id=None, repository=None)
Bases:
object
Metadata properties of the tracking entity, trial, or trial component.
- Parameters:
commit_id (
Optional
[str
]) – The commit ID.generated_by (
Optional
[str
]) – The entity this entity was generated by.project_id (
Optional
[str
]) – The project ID.repository (
Optional
[str
]) – The repository.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker metadata_properties_property = sagemaker.CfnModelPackage.MetadataPropertiesProperty( commit_id="commitId", generated_by="generatedBy", project_id="projectId", repository="repository" )
Attributes
- commit_id
The commit ID.
- generated_by
The entity this entity was generated by.
- project_id
The project ID.
MetricsSourceProperty
- class CfnModelPackage.MetricsSourceProperty(*, content_type, s3_uri, content_digest=None)
Bases:
object
Details about the metrics source.
- Parameters:
content_type (
str
) – The metric source content type.s3_uri (
str
) – The S3 URI for the metrics source.content_digest (
Optional
[str
]) – The hash key used for the metrics source.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker metrics_source_property = sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" )
Attributes
- content_digest
The hash key used for the metrics source.
- content_type
The metric source content type.
- s3_uri
The S3 URI for the metrics source.
ModelDataQualityProperty
- class CfnModelPackage.ModelDataQualityProperty(*, constraints=None, statistics=None)
Bases:
object
Data quality constraints and statistics for a model.
- Parameters:
constraints (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – Data quality constraints for a model.statistics (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – Data quality statistics for a model.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker model_data_quality_property = sagemaker.CfnModelPackage.ModelDataQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) )
Attributes
- constraints
Data quality constraints for a model.
- statistics
Data quality statistics for a model.
ModelInputProperty
- class CfnModelPackage.ModelInputProperty(*, data_input_config)
Bases:
object
Input object for the model.
- Parameters:
data_input_config (
str
) – The input configuration object for the model.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker model_input_property = sagemaker.CfnModelPackage.ModelInputProperty( data_input_config="dataInputConfig" )
Attributes
- data_input_config
The input configuration object for the model.
ModelMetricsProperty
- class CfnModelPackage.ModelMetricsProperty(*, bias=None, explainability=None, model_data_quality=None, model_quality=None)
Bases:
object
Contains metrics captured from a model.
- Parameters:
bias (
Union
[IResolvable
,BiasProperty
,Dict
[str
,Any
],None
]) – Metrics that measure bais in a model.explainability (
Union
[IResolvable
,ExplainabilityProperty
,Dict
[str
,Any
],None
]) – Metrics that help explain a model.model_data_quality (
Union
[IResolvable
,ModelDataQualityProperty
,Dict
[str
,Any
],None
]) – Metrics that measure the quality of the input data for a model.model_quality (
Union
[IResolvable
,ModelQualityProperty
,Dict
[str
,Any
],None
]) – Metrics that measure the quality of a model.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker model_metrics_property = sagemaker.CfnModelPackage.ModelMetricsProperty( bias=sagemaker.CfnModelPackage.BiasProperty( post_training_report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), pre_training_report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), explainability=sagemaker.CfnModelPackage.ExplainabilityProperty( report=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), model_data_quality=sagemaker.CfnModelPackage.ModelDataQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ), model_quality=sagemaker.CfnModelPackage.ModelQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) ) )
Attributes
- bias
Metrics that measure bais in a model.
- explainability
Metrics that help explain a model.
- model_data_quality
Metrics that measure the quality of the input data for a model.
- model_quality
Metrics that measure the quality of a model.
ModelPackageContainerDefinitionProperty
- class CfnModelPackage.ModelPackageContainerDefinitionProperty(*, image, container_hostname=None, environment=None, framework=None, framework_version=None, image_digest=None, model_data_url=None, model_input=None, nearest_model_name=None, product_id=None)
Bases:
object
Describes the Docker container for the model package.
- Parameters:
image (
str
) – The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored. If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must meet SageMaker requirements. SageMaker supports bothregistry/repository[:tag]
andregistry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker .container_hostname (
Optional
[str
]) – The DNS host name for the Docker container.environment (
Union
[IResolvable
,Mapping
[str
,str
],None
]) – The environment variables to set in the Docker container. Each key and value in theEnvironment
string to string map can have length of up to 1024. We support up to 16 entries in the map.framework (
Optional
[str
]) – The machine learning framework of the model package container image.framework_version (
Optional
[str
]) – The framework version of the Model Package Container Image.image_digest (
Optional
[str
]) – An MD5 hash of the training algorithm that identifies the Docker image used for training.model_data_url (
Optional
[str
]) – The Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point to a singlegzip
compressed tar archive (.tar.gz
suffix). .. epigraph:: The model artifacts must be in an S3 bucket that is in the same region as the model package.model_input (
Optional
[Any
]) – A structure with Model Input details.nearest_model_name (
Optional
[str
]) – The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that matches your model. You can find a list of benchmarked models by callingListModelMetadata
.product_id (
Optional
[str
]) – The AWS Marketplace product ID of the model package.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker # model_input: Any model_package_container_definition_property = sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty( image="image", # the properties below are optional container_hostname="containerHostname", environment={ "environment_key": "environment" }, framework="framework", framework_version="frameworkVersion", image_digest="imageDigest", model_data_url="modelDataUrl", model_input=model_input, nearest_model_name="nearestModelName", product_id="productId" )
Attributes
- container_hostname
The DNS host name for the Docker container.
- environment
The environment variables to set in the Docker container.
Each key and value in the
Environment
string to string map can have length of up to 1024. We support up to 16 entries in the map.
- framework
The machine learning framework of the model package container image.
- framework_version
The framework version of the Model Package Container Image.
- image
The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored.
If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must meet SageMaker requirements. SageMaker supports both
registry/repository[:tag]
andregistry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker .
- image_digest
An MD5 hash of the training algorithm that identifies the Docker image used for training.
- model_data_url
The Amazon S3 path where the model artifacts, which result from model training, are stored.
This path must point to a single
gzip
compressed tar archive (.tar.gz
suffix). .. epigraph:The model artifacts must be in an S3 bucket that is in the same region as the model package.
- model_input
A structure with Model Input details.
- nearest_model_name
The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that matches your model.
You can find a list of benchmarked models by calling
ListModelMetadata
.
- product_id
The AWS Marketplace product ID of the model package.
ModelPackageStatusDetailsProperty
- class CfnModelPackage.ModelPackageStatusDetailsProperty(*, validation_statuses, image_scan_statuses=None)
Bases:
object
Specifies the validation and image scan statuses of the model package.
- Parameters:
validation_statuses (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ModelPackageStatusItemProperty
,Dict
[str
,Any
]]]]) – The validation status of the model package.image_scan_statuses (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ModelPackageStatusItemProperty
,Dict
[str
,Any
]]],None
]) – The status of the scan of the Docker image container for the model package.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker model_package_status_details_property = sagemaker.CfnModelPackage.ModelPackageStatusDetailsProperty( validation_statuses=[sagemaker.CfnModelPackage.ModelPackageStatusItemProperty( name="name", status="status", # the properties below are optional failure_reason="failureReason" )], # the properties below are optional image_scan_statuses=[sagemaker.CfnModelPackage.ModelPackageStatusItemProperty( name="name", status="status", # the properties below are optional failure_reason="failureReason" )] )
Attributes
- image_scan_statuses
The status of the scan of the Docker image container for the model package.
- validation_statuses
The validation status of the model package.
ModelPackageStatusItemProperty
- class CfnModelPackage.ModelPackageStatusItemProperty(*, name, status, failure_reason=None)
Bases:
object
Represents the overall status of a model package.
- Parameters:
name (
str
) – The name of the model package for which the overall status is being reported.status (
str
) – The current status.failure_reason (
Optional
[str
]) – if the overall status isFailed
, the reason for the failure.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker model_package_status_item_property = sagemaker.CfnModelPackage.ModelPackageStatusItemProperty( name="name", status="status", # the properties below are optional failure_reason="failureReason" )
Attributes
- failure_reason
if the overall status is
Failed
, the reason for the failure.
- name
The name of the model package for which the overall status is being reported.
ModelQualityProperty
- class CfnModelPackage.ModelQualityProperty(*, constraints=None, statistics=None)
Bases:
object
Model quality statistics and constraints.
- Parameters:
constraints (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – Model quality constraints.statistics (
Union
[IResolvable
,MetricsSourceProperty
,Dict
[str
,Any
],None
]) – Model quality statistics.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker model_quality_property = sagemaker.CfnModelPackage.ModelQualityProperty( constraints=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ), statistics=sagemaker.CfnModelPackage.MetricsSourceProperty( content_type="contentType", s3_uri="s3Uri", # the properties below are optional content_digest="contentDigest" ) )
Attributes
- constraints
Model quality constraints.
- statistics
Model quality statistics.
S3DataSourceProperty
- class CfnModelPackage.S3DataSourceProperty(*, s3_data_type, s3_uri)
Bases:
object
Describes the S3 data source.
Your input bucket must be in the same AWS region as your training job.
- Parameters:
s3_data_type (
str
) – If you chooseS3Prefix
,S3Uri
identifies a key name prefix. SageMaker uses all objects that match the specified key name prefix for model training. If you chooseManifestFile
,S3Uri
identifies an object that is a manifest file containing a list of object keys that you want SageMaker to use for model training. If you chooseAugmentedManifestFile
, S3Uri identifies an object that is an augmented manifest file in JSON lines format. This file contains the data you want to use for model training.AugmentedManifestFile
can only be used if the Channel’s input mode isPipe
.s3_uri (
str
) – Depending on the value specified for theS3DataType
, identifies either a key name prefix or a manifest. For example: - A key name prefix might look like this:s3://bucketname/exampleprefix
- A manifest might look like this:s3://bucketname/example.manifest
A manifest is an S3 object which is a JSON file consisting of an array of elements. The first element is a prefix which is followed by one or more suffixes. SageMaker appends the suffix elements to the prefix to get a full set ofS3Uri
. Note that the prefix must be a valid non-emptyS3Uri
that precludes users from specifying a manifest whose individualS3Uri
is sourced from different S3 buckets. The following code example shows a valid manifest format:[ {"prefix": "s3://customer_bucket/some/prefix/"},
"relative/path/to/custdata-1",
"relative/path/custdata-2",
...
"relative/path/custdata-N"
]
This JSON is equivalent to the followingS3Uri
list:s3://customer_bucket/some/prefix/relative/path/to/custdata-1
s3://customer_bucket/some/prefix/relative/path/custdata-2
...
s3://customer_bucket/some/prefix/relative/path/custdata-N
The complete set ofS3Uri
in this manifest is the input data for the channel for this data source. The object that eachS3Uri
points to must be readable by the IAM role that SageMaker uses to perform tasks on your behalf. Your input bucket must be located in same AWS region as your training job.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker s3_data_source_property = sagemaker.CfnModelPackage.S3DataSourceProperty( s3_data_type="s3DataType", s3_uri="s3Uri" )
Attributes
- s3_data_type
If you choose
S3Prefix
,S3Uri
identifies a key name prefix.SageMaker uses all objects that match the specified key name prefix for model training.
If you choose
ManifestFile
,S3Uri
identifies an object that is a manifest file containing a list of object keys that you want SageMaker to use for model training.If you choose
AugmentedManifestFile
, S3Uri identifies an object that is an augmented manifest file in JSON lines format. This file contains the data you want to use for model training.AugmentedManifestFile
can only be used if the Channel’s input mode isPipe
.
- s3_uri
Depending on the value specified for the
S3DataType
, identifies either a key name prefix or a manifest.For example:
A key name prefix might look like this:
s3://bucketname/exampleprefix
A manifest might look like this:
s3://bucketname/example.manifest
A manifest is an S3 object which is a JSON file consisting of an array of elements. The first element is a prefix which is followed by one or more suffixes. SageMaker appends the suffix elements to the prefix to get a full set of
S3Uri
. Note that the prefix must be a valid non-emptyS3Uri
that precludes users from specifying a manifest whose individualS3Uri
is sourced from different S3 buckets.The following code example shows a valid manifest format:
[ {"prefix": "s3://customer_bucket/some/prefix/"},
"relative/path/to/custdata-1",
"relative/path/custdata-2",
...
"relative/path/custdata-N"
]
This JSON is equivalent to the following
S3Uri
list:s3://customer_bucket/some/prefix/relative/path/to/custdata-1
s3://customer_bucket/some/prefix/relative/path/custdata-2
...
s3://customer_bucket/some/prefix/relative/path/custdata-N
The complete set of
S3Uri
in this manifest is the input data for the channel for this data source. The object that eachS3Uri
points to must be readable by the IAM role that SageMaker uses to perform tasks on your behalf.Your input bucket must be located in same AWS region as your training job.
SourceAlgorithmProperty
- class CfnModelPackage.SourceAlgorithmProperty(*, algorithm_name, model_data_url=None)
Bases:
object
Specifies an algorithm that was used to create the model package.
The algorithm must be either an algorithm resource in your SageMaker account or an algorithm in AWS Marketplace that you are subscribed to.
- Parameters:
algorithm_name (
str
) – The name of an algorithm that was used to create the model package. The algorithm must be either an algorithm resource in your SageMaker account or an algorithm in AWS Marketplace that you are subscribed to.model_data_url (
Optional
[str
]) – The Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point to a singlegzip
compressed tar archive (.tar.gz
suffix). .. epigraph:: The model artifacts must be in an S3 bucket that is in the same AWS region as the algorithm.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker source_algorithm_property = sagemaker.CfnModelPackage.SourceAlgorithmProperty( algorithm_name="algorithmName", # the properties below are optional model_data_url="modelDataUrl" )
Attributes
- algorithm_name
The name of an algorithm that was used to create the model package.
The algorithm must be either an algorithm resource in your SageMaker account or an algorithm in AWS Marketplace that you are subscribed to.
- model_data_url
The Amazon S3 path where the model artifacts, which result from model training, are stored.
This path must point to a single
gzip
compressed tar archive (.tar.gz
suffix). .. epigraph:The model artifacts must be in an S3 bucket that is in the same AWS region as the algorithm.
SourceAlgorithmSpecificationProperty
- class CfnModelPackage.SourceAlgorithmSpecificationProperty(*, source_algorithms)
Bases:
object
A list of algorithms that were used to create a model package.
- Parameters:
source_algorithms (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,SourceAlgorithmProperty
,Dict
[str
,Any
]]]]) – A list of the algorithms that were used to create a model package.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker source_algorithm_specification_property = sagemaker.CfnModelPackage.SourceAlgorithmSpecificationProperty( source_algorithms=[sagemaker.CfnModelPackage.SourceAlgorithmProperty( algorithm_name="algorithmName", # the properties below are optional model_data_url="modelDataUrl" )] )
Attributes
- source_algorithms
A list of the algorithms that were used to create a model package.
TransformInputProperty
- class CfnModelPackage.TransformInputProperty(*, data_source, compression_type=None, content_type=None, split_type=None)
Bases:
object
Describes the input source of a transform job and the way the transform job consumes it.
- Parameters:
data_source (
Union
[IResolvable
,DataSourceProperty
,Dict
[str
,Any
]]) – Describes the location of the channel data, which is, the S3 location of the input data that the model can consume.compression_type (
Optional
[str
]) – If your transform data is compressed, specify the compression type. Amazon SageMaker automatically decompresses the data for the transform job accordingly. The default value isNone
.content_type (
Optional
[str
]) – The multipurpose internet mail extension (MIME) type of the data. Amazon SageMaker uses the MIME type with each http call to transfer data to the transform job.split_type (
Optional
[str
]) – The method to use to split the transform job’s data files into smaller batches. Splitting is necessary when the total size of each object is too large to fit in a single request. You can also use data splitting to improve performance by processing multiple concurrent mini-batches. The default value forSplitType
isNone
, which indicates that input data files are not split, and request payloads contain the entire contents of an input object. Set the value of this parameter toLine
to split records on a newline character boundary.SplitType
also supports a number of record-oriented binary data formats. Currently, the supported record formats are: - RecordIO - TFRecord When splitting is enabled, the size of a mini-batch depends on the values of theBatchStrategy
andMaxPayloadInMB
parameters. When the value ofBatchStrategy
isMultiRecord
, Amazon SageMaker sends the maximum number of records in each request, up to theMaxPayloadInMB
limit. If the value ofBatchStrategy
isSingleRecord
, Amazon SageMaker sends individual records in each request. .. epigraph:: Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting is applied to a binary data format, padding is removed if the value ofBatchStrategy
is set toSingleRecord
. Padding is not removed if the value ofBatchStrategy
is set toMultiRecord
. For more information aboutRecordIO
, see Create a Dataset Using RecordIO in the MXNet documentation. For more information aboutTFRecord
, see Consuming TFRecord data in the TensorFlow documentation.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker transform_input_property = sagemaker.CfnModelPackage.TransformInputProperty( data_source=sagemaker.CfnModelPackage.DataSourceProperty( s3_data_source=sagemaker.CfnModelPackage.S3DataSourceProperty( s3_data_type="s3DataType", s3_uri="s3Uri" ) ), # the properties below are optional compression_type="compressionType", content_type="contentType", split_type="splitType" )
Attributes
- compression_type
If your transform data is compressed, specify the compression type.
Amazon SageMaker automatically decompresses the data for the transform job accordingly. The default value is
None
.
- content_type
The multipurpose internet mail extension (MIME) type of the data.
Amazon SageMaker uses the MIME type with each http call to transfer data to the transform job.
- data_source
Describes the location of the channel data, which is, the S3 location of the input data that the model can consume.
- split_type
The method to use to split the transform job’s data files into smaller batches.
Splitting is necessary when the total size of each object is too large to fit in a single request. You can also use data splitting to improve performance by processing multiple concurrent mini-batches. The default value for
SplitType
isNone
, which indicates that input data files are not split, and request payloads contain the entire contents of an input object. Set the value of this parameter toLine
to split records on a newline character boundary.SplitType
also supports a number of record-oriented binary data formats. Currently, the supported record formats are:RecordIO
TFRecord
When splitting is enabled, the size of a mini-batch depends on the values of the
BatchStrategy
andMaxPayloadInMB
parameters. When the value ofBatchStrategy
isMultiRecord
, Amazon SageMaker sends the maximum number of records in each request, up to theMaxPayloadInMB
limit. If the value ofBatchStrategy
isSingleRecord
, Amazon SageMaker sends individual records in each request. .. epigraph:Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting is applied to a binary data format, padding is removed if the value of ``BatchStrategy`` is set to ``SingleRecord`` . Padding is not removed if the value of ``BatchStrategy`` is set to ``MultiRecord`` . For more information about ``RecordIO`` , see `Create a Dataset Using RecordIO <https://docs.aws.amazon.com/https://mxnet.apache.org/api/faq/recordio>`_ in the MXNet documentation. For more information about ``TFRecord`` , see `Consuming TFRecord data <https://docs.aws.amazon.com/https://www.tensorflow.org/guide/data#consuming_tfrecord_data>`_ in the TensorFlow documentation.
TransformJobDefinitionProperty
- class CfnModelPackage.TransformJobDefinitionProperty(*, transform_input, transform_output, transform_resources, batch_strategy=None, environment=None, max_concurrent_transforms=None, max_payload_in_mb=None)
Bases:
object
Defines the input needed to run a transform job using the inference specification specified in the algorithm.
- Parameters:
transform_input (
Union
[IResolvable
,TransformInputProperty
,Dict
[str
,Any
]]) – A description of the input source and the way the transform job consumes it.transform_output (
Union
[IResolvable
,TransformOutputProperty
,Dict
[str
,Any
]]) – Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform job.transform_resources (
Union
[IResolvable
,TransformResourcesProperty
,Dict
[str
,Any
]]) – Identifies the ML compute instances for the transform job.batch_strategy (
Optional
[str
]) – A string that determines the number of records included in a single mini-batch.SingleRecord
means only one record is used per mini-batch.MultiRecord
means a mini-batch is set to contain as many records that can fit within theMaxPayloadInMB
limit.environment (
Union
[IResolvable
,Mapping
[str
,str
],None
]) – The environment variables to set in the Docker container. We support up to 16 key and values entries in the map.max_concurrent_transforms (
Union
[int
,float
,None
]) – The maximum number of parallel requests that can be sent to each instance in a transform job. The default value is 1.max_payload_in_mb (
Union
[int
,float
,None
]) – The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata).
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker transform_job_definition_property = sagemaker.CfnModelPackage.TransformJobDefinitionProperty( transform_input=sagemaker.CfnModelPackage.TransformInputProperty( data_source=sagemaker.CfnModelPackage.DataSourceProperty( s3_data_source=sagemaker.CfnModelPackage.S3DataSourceProperty( s3_data_type="s3DataType", s3_uri="s3Uri" ) ), # the properties below are optional compression_type="compressionType", content_type="contentType", split_type="splitType" ), transform_output=sagemaker.CfnModelPackage.TransformOutputProperty( s3_output_path="s3OutputPath", # the properties below are optional accept="accept", assemble_with="assembleWith", kms_key_id="kmsKeyId" ), transform_resources=sagemaker.CfnModelPackage.TransformResourcesProperty( instance_count=123, instance_type="instanceType", # the properties below are optional volume_kms_key_id="volumeKmsKeyId" ), # the properties below are optional batch_strategy="batchStrategy", environment={ "environment_key": "environment" }, max_concurrent_transforms=123, max_payload_in_mb=123 )
Attributes
- batch_strategy
A string that determines the number of records included in a single mini-batch.
SingleRecord
means only one record is used per mini-batch.MultiRecord
means a mini-batch is set to contain as many records that can fit within theMaxPayloadInMB
limit.
- environment
The environment variables to set in the Docker container.
We support up to 16 key and values entries in the map.
- max_concurrent_transforms
The maximum number of parallel requests that can be sent to each instance in a transform job.
The default value is 1.
- max_payload_in_mb
The maximum payload size allowed, in MB.
A payload is the data portion of a record (without metadata).
- transform_input
A description of the input source and the way the transform job consumes it.
- transform_output
Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform job.
- transform_resources
Identifies the ML compute instances for the transform job.
TransformOutputProperty
- class CfnModelPackage.TransformOutputProperty(*, s3_output_path, accept=None, assemble_with=None, kms_key_id=None)
Bases:
object
Describes the results of a transform job.
- Parameters:
s3_output_path (
str
) – The Amazon S3 path where you want Amazon SageMaker to store the results of the transform job. For example,s3://bucket-name/key-name-prefix
. For every S3 object used as input for the transform job, batch transform stores the transformed data with an .out
suffix in a corresponding subfolder in the location in the output prefix. For example, for the input data stored ats3://bucket-name/input-name-prefix/dataset01/data.csv
, batch transform stores the transformed data ats3://bucket-name/output-name-prefix/input-name-prefix/data.csv.out
. Batch transform doesn’t upload partially processed objects. For an input S3 object that contains multiple records, it creates an .out
file only if the transform job succeeds on the entire file. When the input contains multiple S3 objects, the batch transform job processes the listed S3 objects and uploads only the output for successfully processed objects. If any object fails in the transform job batch transform marks the job as failed to prompt investigation.accept (
Optional
[str
]) – The MIME type used to specify the output data. Amazon SageMaker uses the MIME type with each http call to transfer data from the transform job.assemble_with (
Optional
[str
]) – Defines how to assemble the results of the transform job as a single S3 object. Choose a format that is most convenient to you. To concatenate the results in binary format, specifyNone
. To add a newline character at the end of every transformed record, specifyLine
.kms_key_id (
Optional
[str
]) – The AWS Key Management Service ( AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption. TheKmsKeyId
can be any of the following formats: - Key ID:1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
- Alias name:alias/ExampleAlias
- Alias name ARN:arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias
If you don’t provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role’s account. For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide. The KMS key policy must grant permission to the IAM role that you specify in your CreateModel request. For more information, see Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide .
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker transform_output_property = sagemaker.CfnModelPackage.TransformOutputProperty( s3_output_path="s3OutputPath", # the properties below are optional accept="accept", assemble_with="assembleWith", kms_key_id="kmsKeyId" )
Attributes
- accept
The MIME type used to specify the output data.
Amazon SageMaker uses the MIME type with each http call to transfer data from the transform job.
- assemble_with
Defines how to assemble the results of the transform job as a single S3 object.
Choose a format that is most convenient to you. To concatenate the results in binary format, specify
None
. To add a newline character at the end of every transformed record, specifyLine
.
- kms_key_id
The AWS Key Management Service ( AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.
The
KmsKeyId
can be any of the following formats:Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
Alias name:
alias/ExampleAlias
Alias name ARN:
arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias
If you don’t provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role’s account. For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide.
The KMS key policy must grant permission to the IAM role that you specify in your CreateModel request. For more information, see Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide .
- s3_output_path
The Amazon S3 path where you want Amazon SageMaker to store the results of the transform job.
For example,
s3://bucket-name/key-name-prefix
.For every S3 object used as input for the transform job, batch transform stores the transformed data with an .
out
suffix in a corresponding subfolder in the location in the output prefix. For example, for the input data stored ats3://bucket-name/input-name-prefix/dataset01/data.csv
, batch transform stores the transformed data ats3://bucket-name/output-name-prefix/input-name-prefix/data.csv.out
. Batch transform doesn’t upload partially processed objects. For an input S3 object that contains multiple records, it creates an .out
file only if the transform job succeeds on the entire file. When the input contains multiple S3 objects, the batch transform job processes the listed S3 objects and uploads only the output for successfully processed objects. If any object fails in the transform job batch transform marks the job as failed to prompt investigation.
TransformResourcesProperty
- class CfnModelPackage.TransformResourcesProperty(*, instance_count, instance_type, volume_kms_key_id=None)
Bases:
object
Describes the resources, including ML instance types and ML instance count, to use for transform job.
- Parameters:
instance_count (
Union
[int
,float
]) – The number of ML compute instances to use in the transform job. The default value is1
, and the maximum is100
. For distributed transform jobs, specify a value greater than1
.instance_type (
str
) – The ML compute instance type for the transform job. If you are using built-in algorithms to transform moderately sized datasets, we recommend using ml.m4.xlarge orml.m5.large
instance types.volume_kms_key_id (
Optional
[str
]) – The AWS Key Management Service ( AWS KMS) key that Amazon SageMaker uses to encrypt model data on the storage volume attached to the ML compute instance(s) that run the batch transform job. .. epigraph:: Certain Nitro-based instances include local storage, dependent on the instance type. Local storage volumes are encrypted using a hardware module on the instance. You can’t request aVolumeKmsKeyId
when using an instance type with local storage. For a list of instance types that support local instance storage, see Instance Store Volumes . For more information about local instance storage encryption, see SSD Instance Store Volumes . TheVolumeKmsKeyId
can be any of the following formats: - Key ID:1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
- Alias name:alias/ExampleAlias
- Alias name ARN:arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker transform_resources_property = sagemaker.CfnModelPackage.TransformResourcesProperty( instance_count=123, instance_type="instanceType", # the properties below are optional volume_kms_key_id="volumeKmsKeyId" )
Attributes
- instance_count
The number of ML compute instances to use in the transform job.
The default value is
1
, and the maximum is100
. For distributed transform jobs, specify a value greater than1
.
- instance_type
The ML compute instance type for the transform job.
If you are using built-in algorithms to transform moderately sized datasets, we recommend using ml.m4.xlarge or
ml.m5.large
instance types.
- volume_kms_key_id
The AWS Key Management Service ( AWS KMS) key that Amazon SageMaker uses to encrypt model data on the storage volume attached to the ML compute instance(s) that run the batch transform job.
Certain Nitro-based instances include local storage, dependent on the instance type. Local storage volumes are encrypted using a hardware module on the instance. You can’t request a
VolumeKmsKeyId
when using an instance type with local storage.For a list of instance types that support local instance storage, see Instance Store Volumes .
For more information about local instance storage encryption, see SSD Instance Store Volumes .
The
VolumeKmsKeyId
can be any of the following formats:Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
Alias name:
alias/ExampleAlias
Alias name ARN:
arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias
UserContextProperty
- class CfnModelPackage.UserContextProperty(*, domain_id=None, user_profile_arn=None, user_profile_name=None)
Bases:
object
Information about the user who created or modified an experiment, trial, trial component, lineage group, project, or model card.
- Parameters:
domain_id (
Optional
[str
]) – The domain associated with the user.user_profile_arn (
Optional
[str
]) – The Amazon Resource Name (ARN) of the user’s profile.user_profile_name (
Optional
[str
]) – The name of the user’s profile.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker user_context_property = sagemaker.CfnModelPackage.UserContextProperty( domain_id="domainId", user_profile_arn="userProfileArn", user_profile_name="userProfileName" )
Attributes
- domain_id
The domain associated with the user.
- user_profile_arn
The Amazon Resource Name (ARN) of the user’s profile.
- user_profile_name
The name of the user’s profile.
ValidationProfileProperty
- class CfnModelPackage.ValidationProfileProperty(*, profile_name, transform_job_definition)
Bases:
object
Contains data, such as the inputs and targeted instance types that are used in the process of validating the model package.
The data provided in the validation profile is made available to your buyers on AWS Marketplace.
- Parameters:
profile_name (
str
) – The name of the profile for the model package.transform_job_definition (
Union
[IResolvable
,TransformJobDefinitionProperty
,Dict
[str
,Any
]]) – TheTransformJobDefinition
object that describes the transform job used for the validation of the model package.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker validation_profile_property = sagemaker.CfnModelPackage.ValidationProfileProperty( profile_name="profileName", transform_job_definition=sagemaker.CfnModelPackage.TransformJobDefinitionProperty( transform_input=sagemaker.CfnModelPackage.TransformInputProperty( data_source=sagemaker.CfnModelPackage.DataSourceProperty( s3_data_source=sagemaker.CfnModelPackage.S3DataSourceProperty( s3_data_type="s3DataType", s3_uri="s3Uri" ) ), # the properties below are optional compression_type="compressionType", content_type="contentType", split_type="splitType" ), transform_output=sagemaker.CfnModelPackage.TransformOutputProperty( s3_output_path="s3OutputPath", # the properties below are optional accept="accept", assemble_with="assembleWith", kms_key_id="kmsKeyId" ), transform_resources=sagemaker.CfnModelPackage.TransformResourcesProperty( instance_count=123, instance_type="instanceType", # the properties below are optional volume_kms_key_id="volumeKmsKeyId" ), # the properties below are optional batch_strategy="batchStrategy", environment={ "environment_key": "environment" }, max_concurrent_transforms=123, max_payload_in_mb=123 ) )
Attributes
- profile_name
The name of the profile for the model package.
- transform_job_definition
The
TransformJobDefinition
object that describes the transform job used for the validation of the model package.
ValidationSpecificationProperty
- class CfnModelPackage.ValidationSpecificationProperty(*, validation_profiles, validation_role)
Bases:
object
Specifies batch transform jobs that SageMaker runs to validate your model package.
- Parameters:
validation_profiles (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ValidationProfileProperty
,Dict
[str
,Any
]]]]) – An array ofModelPackageValidationProfile
objects, each of which specifies a batch transform job that SageMaker runs to validate your model package.validation_role (
str
) – The IAM roles to be used for the validation of the model package.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker validation_specification_property = sagemaker.CfnModelPackage.ValidationSpecificationProperty( validation_profiles=[sagemaker.CfnModelPackage.ValidationProfileProperty( profile_name="profileName", transform_job_definition=sagemaker.CfnModelPackage.TransformJobDefinitionProperty( transform_input=sagemaker.CfnModelPackage.TransformInputProperty( data_source=sagemaker.CfnModelPackage.DataSourceProperty( s3_data_source=sagemaker.CfnModelPackage.S3DataSourceProperty( s3_data_type="s3DataType", s3_uri="s3Uri" ) ), # the properties below are optional compression_type="compressionType", content_type="contentType", split_type="splitType" ), transform_output=sagemaker.CfnModelPackage.TransformOutputProperty( s3_output_path="s3OutputPath", # the properties below are optional accept="accept", assemble_with="assembleWith", kms_key_id="kmsKeyId" ), transform_resources=sagemaker.CfnModelPackage.TransformResourcesProperty( instance_count=123, instance_type="instanceType", # the properties below are optional volume_kms_key_id="volumeKmsKeyId" ), # the properties below are optional batch_strategy="batchStrategy", environment={ "environment_key": "environment" }, max_concurrent_transforms=123, max_payload_in_mb=123 ) )], validation_role="validationRole" )
Attributes
- validation_profiles
An array of
ModelPackageValidationProfile
objects, each of which specifies a batch transform job that SageMaker runs to validate your model package.
- validation_role
The IAM roles to be used for the validation of the model package.