![](/img/trans.png)
[英]How do you resolve an "Access Denied" error when invoking `image_uris.retrieve()` in AWS Sagemaker JumpStart?
[英]Calling AWS Location API from Sagemaker: Access Denied Exception Error
我一直在嘗試在 AWS Sagemaker 中運行以下代碼
location = boto3.client('location', region_name='us-east-1')
Response = location.search_place_index_for_text(IndexName = 'explore.place', Text = 'Boston, MA')
print(Response)
但我收到以下錯誤
AccessDeniedException:調用 SearchPlaceIndexForText 操作時發生錯誤 (AccessDeniedException):用戶:arn:aws:sts::713361781863:assumed-role/AmazonSageMaker-ExecutionRole-20220208T112132/SageMaker 無權執行:geo:SearchPlaceIndexForText 資源:arn: aws:geo:us-east-1:713361781863:place-index/explore.place
如果我從本地 python 運行相同的代碼,我會得到正確的響應。 我想是將 Sagemaker 連接到 AWS 位置服務的權限問題——我如何授予對 sagemaker 的訪問權限/更新我的 IAM?
謝謝!
您可以將內聯策略添加到AmazonSageMaker-ExecutionRole-20220208T112132
角色:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "geo:SearchPlaceIndexForText",
"Resource": "arn:aws:geo:us-east-1:713361781863:place-index/explore.place"
}
]
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.