繁体   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