AWS Braket Python SDK:无权在量子设备上执行用户
我已经安装了Boto3,AWS CLI和Python-Braket-SDK。我已经运行 aws配置
,并与我的IAM用户进行配置。我的IAM用户不是root用户,但是它具有 abtifyAccess
, amazonbraketfullaccess
, amazynbraketjobsexecutionpolicypolicy
策略。
但是,如果我试图通过此命令获取一些量子设备: aws braket get-device-device-arn arn:aws:aws:braket ::: device/qpu/qpu/ionq/ionqdevice
error:
An error occurred (AccessDeniedException) when calling the GetDevice operation: User: arn:aws:iam::178363055402:user/hblab-rnd is not authorized to perform: braket:GetDevice on resource: arn:aws:braket :: 178363055402:设备/qpu/ionq/ionq/ionqdevice,具有显式拒绝
,
如果我从此链接下方在python下运行相同的 python#用法“ rel =” nofollow noreferrer“> https://github.com/aws/amazon-braket-sdk-python#usage ,它也返回类似的错误:
import boto3
from braket.aws import AwsDevice
from braket.circuits import Circuit
device = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
bell = Circuit().h(0).cnot(0, 1)
task = device.run(bell, shots=100)
print(task.result().measurement_counts)
错误输出:
AccessDeniedException: An error occurred (AccessDeniedException) when calling the GetDevice
operation: User: arn:aws:iam::178363055402:user/hblab-rnd is not authorized to perform:
braket:GetDevice on resource: arn:aws:braket::178363055402:device/quantum-simulator/amazon/sv1
with an explicit deny
我已经添加架设,但我无法弄清楚此错误的原因。请帮助
系统信息
- aws cli :aws-cli/2.7.11 python/3.9.11 Windows/10 exe/amd64提示/off
- :1.25.2
- 亚马逊式架构:1.10.0
- Amazon Braket默认模拟器:1.6.2
- Python版本:3.8.13
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了答案。我已经在我的帐户上激活了MFA授权,但是在我的
aws cli
中,我不设置它。因此,我需要通过没有MFA的新帐户设置aws cli
,或为我的aws cli
设置MFA。谢谢大家的帮助I have found the answer. I have activated MFA authorization on my account, but in my
aws cli
, I don't setup it. So I need to setup myaws cli
by a new account without MFA, or set up MFA for myaws cli
. Thank you everyone for help