如何在SageMaker Studio手动将SageMaker管道/作业关联至指定项目?
将现有SageMaker管道手动关联至特定Studio项目(无需Code Commit)
核心原理
SageMaker通过专属项目标签关联资源与项目,只需为管道添加对应项目的aws:sagemaker:project-name和aws:sagemaker:project-id标签,即可完成关联。
步骤1:获取目标项目的标签信息
- 打开SageMaker Studio,进入项目列表,选中目标项目进入详情页
- 切换到标签页,记录以下两个关键标签的键和值:
- 键:
aws:sagemaker:project-name→ 值为你的项目名称 - 键:
aws:sagemaker:project-id→ 值为项目ID(格式如p-xxxxxxxxxxxx)
- 键:
步骤2:为管道添加项目标签(两种手动方式)
方式一:通过SageMaker Studio界面操作
- 在Studio左侧导航栏打开管道列表,找到目标管道
- 点击管道右侧的三点菜单,选择编辑标签
- 在标签编辑窗口点击添加标签,分别添加:
- 键:
aws:sagemaker:project-name,值填步骤1记录的项目名称 - 键:
aws:sagemaker:project-id,值填步骤1记录的项目ID
- 键:
- 点击保存完成关联
方式二:通过AWS CLI手动执行
- 确保本地AWS CLI已配置对应权限,执行以下命令(替换占位符为实际信息):
aws sagemaker add-tags \ --resource-arn arn:aws:sagemaker:<你的AWS区域>:<你的AWS账号ID>:pipeline/<你的管道名称> \ --tags Key=aws:sagemaker:project-name,Value=<目标项目名称> Key=aws:sagemaker:project-id,Value=<目标项目ID>
- 验证标签添加结果:
aws sagemaker list-tags --resource-arn arn:aws:sagemaker:<你的AWS区域>:<你的AWS账号ID>:pipeline/<你的管道名称>
验证关联效果
添加标签后,回到项目详情页,切换到关联资源标签页(刷新页面),即可看到该管道已被关联至当前项目。
内容的提问来源于stack exchange,提问作者V K
相关产品推荐
相关产品推荐

