Skip to main content

contexts

Creates, updates, deletes, gets or lists a contexts resource.

Overview

Namecontexts
TypeResource
Idaws.sagemaker.contexts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
context_arnstringThe Amazon Resource Name (ARN) of the context. (pattern: <code>arn:aws[a-z-]:sagemaker:[a-z0-9-]:[0-9]{12}:context/.*</code>)
context_namestringThe name of the context. (pattern: <code>[a-zA-Z0-9]([-_]*[a-zA-Z0-9]){0,119}</code>)
context_typestringThe type of the context.
created_byobjectInformation about the user who created or modified a SageMaker resource.
creation_timestring (date-time)When the context was created.
descriptionstringThe description of the context. (pattern: <code>.*</code>)
last_modified_byobjectInformation about the user who created or modified a SageMaker resource.
last_modified_timestring (date-time)When the context was last modified.
lineage_group_arnstringThe Amazon Resource Name (ARN) of the lineage group. (pattern: <code>arn:aws[a-z-]:sagemaker:[a-z0-9-]:[0-9]{12}:lineage-group/.*</code>)
propertiesobjectA list of the context's properties.
sourceobjectThe source of the context.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_contextselectregionDescribes a context.
list_contextsselectregionLists the contexts in your account and their properties.
create_contextinsertregion, ContextName, ContextTypeCreates a context. A context is a lineage tracking entity that represents a logical grouping of other tracking or experiment entities. Some examples are an endpoint and a model package. For more information, see Amazon SageMaker ML Lineage Tracking.
update_contextupdateregion, ContextNameUpdates a context.
delete_contextdeleteregionDeletes an context.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Describes a context.

SELECT
context_arn,
context_name,
context_type,
created_by,
creation_time,
description,
last_modified_by,
last_modified_time,
lineage_group_arn,
properties,
source
FROM aws.sagemaker.contexts
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a context. A context is a lineage tracking entity that represents a logical grouping of other tracking or experiment entities. Some examples are an endpoint and a model package. For more information, see Amazon SageMaker ML Lineage Tracking.

INSERT INTO aws.sagemaker.contexts (
ContextName,
Source,
ContextType,
Description,
Properties,
Tags,
region
)
SELECT
'{{ ContextName }}' /* required */,
'{{ Source }}',
'{{ ContextType }}' /* required */,
'{{ Description }}',
'{{ Properties }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
context_arn
;

UPDATE examples

Updates a context.

UPDATE aws.sagemaker.contexts
SET
ContextName = '{{ ContextName }}',
Description = '{{ Description }}',
Properties = '{{ Properties }}',
PropertiesToRemove = '{{ PropertiesToRemove }}'
WHERE
region = '{{ region }}' --required
AND ContextName = '{{ ContextName }}' --required
RETURNING
context_arn;

DELETE examples

Deletes an context.

DELETE FROM aws.sagemaker.contexts
WHERE region = '{{ region }}' --required
;