-1

I have installed boto3, aws cli, and python-braket-sdk. I have run aws configure, and config with my IAM user. My IAM user isn't root user, but it has AdministratorAccess, AmazonBraketFullAccess, AmazonBraketJobsExecutionPolicy policies.

But if I tried to get some quantum device by this command:aws braket get-device --device-arn arn:aws:braket:::device/qpu/ionq/ionQdevice, it always return this 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:device/qpu/ionq/ionQdevice with an explicit deny

If I run same below python from this link: https://github.com/aws/amazon-braket-sdk-python#usage, it also return similar error:

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)

Error output:

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

I have already added permissions for Braket, but I can not figure the reason for this bug. Please help

System information

  • aws cli: aws-cli/2.7.11 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
  • Amazon Braket Python SDK version: 1.25.2
  • Amazon Braket schemas: 1.10.0
  • Amazon Braket default simulator: 1.6.2
  • Python version: 3.8.13
voxter
  • 853
  • 2
  • 14
  • 30
  • *Something* is denying the action, either an attached policy, a SCP, a permission boundary or a resources policy. – luk2302 Jun 28 '22 at 10:57
  • @luk2302 when I tried to run this command with my root account, everything is fine. I don't know what is problem with IAM account. So I need to re-check everything about permission in my project ? – voxter Jun 29 '22 at 02:41
  • Not that difficult and complex but yes, go the IAM console and check all the things I mentioned. If braket has resource policies check them as well. – luk2302 Jun 29 '22 at 05:53

1 Answers1

0

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 my aws cli by a new account without MFA, or set up MFA for my aws cli. Thank you everyone for help

voxter
  • 853
  • 2
  • 14
  • 30