Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Notebook Instance Metadata

Focus mode
Notebook Instance Metadata - Amazon SageMaker AI

When you create a notebook instance, Amazon SageMaker AI creates a JSON file on the instance at the location /opt/ml/metadata/resource-metadata.json that contains the ResourceName and ResourceArn of the notebook instance. You can access this metadata from anywhere within the notebook instance, including in lifecycle configurations. For information about notebook instance lifecycle configurations, see Customization of a SageMaker notebook instance using an LCC script.

Note

The resource-metadata.json file can be modified with root access.

The resource-metadata.json file has the following structure:

{ "ResourceArn": "NotebookInstanceArn", "ResourceName": "NotebookInstanceName" }

You can use this metadata from within the notebook instance to get other information about the notebook instance. For example, the following commands get the tags associated with the notebook instance:

NOTEBOOK_ARN=$(jq '.ResourceArn' /opt/ml/metadata/resource-metadata.json --raw-output) aws sagemaker list-tags --resource-arn $NOTEBOOK_ARN

The output looks like the following:

{ "Tags": [ { "Key": "test", "Value": "true" } ] }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.