簡體   English   中英

AWS timestream-write 獲取“調用 DescribeEndpoints 操作時發生錯誤 (AccessDeniedException):不允許執行此操作。”

[英]AWS timestream-write gets "An error occurred (AccessDeniedException) when calling the DescribeEndpoints operation: This operation is not allowed."

我正在為 python 試驗 AWS SDK 以訪問 Timestream。 我從存儲庫中嘗試了他們的內部示例代碼,並編寫了自己的代碼來創建數據庫:

import boto3
from botocore.config import Config

client = boto3.client('timestream-write')

response = client.create_database(DatabaseName='test')

示例代碼和我自己的代碼都出現了以下錯誤:

AccessDeniedException:調用 DescribeEndpoints 操作時發生錯誤(AccessDeniedException):不允許執行此操作。

我用谷歌搜索了一下,但找不到有關它的任何信息。 謝謝!

Timestream 目前僅在少數幾個地區可用。 確保 boto3 區域配置將正確的區域設置為符合條件的區域。

您用於與 Timestream 交互的憑證應使用 IAM 角色,該角色具有 AWS 托管策略或允許您調用 timestream:DescribeEndpoints 的自定義策略。 有關示例,請參見此頁面: https://docs.aws.amazon.com/timestream/latest/developerguide/security_iam_id-based-policy-examples.html

假設您將環境配置為使用 AWS CLI 並運行aws configure ,那么與這些憑證綁定的 IAM 用戶應該被授予 timestream:DescribeEndpoints。 https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html

您可能會收到此權限錯誤,因為您缺少 TableName,這是一個必需的參數。 https://docs.aws.amazon.com/timestream/latest/developerguide/API_CreateTable.html

在您的 iam 角色中添加此權限策略

{
"Version": "2012-10-17",
"Statement": [
    {
        "Sid": "VisualEditor0",
        "Effect": "Allow",
        "Action": [
            "timestream:DescribeEndpoints"
        ],
        "Resource": "*"
    }
] }

DescribeEndpoints 稱為 bt sdk,以防您在 vpc query-cell2.timestream..amazonaws.com 中定義這樣的端點接口。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM