0

When ever I run a command to get DeviceFarm projects or Schedule a run I get errors stating that I do not have permissions to run the commands and that there is an explicit deny on my user.

I am in the role settings and cannot find any policy to add to enable me to run these commands.

What policy do I need to add?

The command: aws devicefarm schedule-run <options>

The error: User: arn:<user arn> is not authorized to perform: devicefarm:ScheduleRun on resource: <resource arn> with an explicit deny

pnizzle
  • 6,243
  • 4
  • 52
  • 81
  • Please Edit your question to show the commands that are failing and the _exact_ error message. – John Rotenstein Jul 29 '21 at 00:03
  • @JohnRotenstein I've added requested details – pnizzle Jul 29 '21 at 00:08
  • 2
    Normally, I would say that you could add the `AWSDeviceFarmFullAccess` policy on your IAM User, but the **explicit** deny suggests that something is intentionally prohibiting such access. Are you using an AWS Account that is part of an AWS Organizations hierarchy? If so, it is possible that a [Service control policy](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html) is blocking use of the Device Farm service in the account. – John Rotenstein Jul 29 '21 at 00:11
  • @JohnRotenstein I already have AWSDeviceFarmFullAccess listed on my role. And yes, device farm as part of a bigger aws suite of stuff. – pnizzle Jul 29 '21 at 00:22
  • 2
    If your account is a sub-account within AWS Organizations, please talk with your company's AWS administrators to check whether any SCPs are blocking your use of Device Farm. – John Rotenstein Jul 29 '21 at 00:26
  • @JohnRotenstein will do and let you know – pnizzle Jul 29 '21 at 00:26
  • @JohnRotenstein is there a way to specify what role to use as part of the command? – pnizzle Jul 29 '21 at 00:28
  • An IAM Role needs to be 'assumed' rather than 'passed' to a command. If you have permission to assume a role, you can add it to the AWS CLI configuration file and it will assume the role for you. See: [Using an IAM role in the AWS CLI - AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html) – John Rotenstein Jul 29 '21 at 00:50
  • @JohnRotenstein can you add the details about "adding devicefarm policy and something else causing my issue" as an answer so I can mark it as correct please? – pnizzle Aug 15 '21 at 22:34

2 Answers2

0

Precede your commands with sudo. That will enable you to run the commands with an elevated privilege and you should not encounter some of the challenges you are encountering.

Charles
  • 349
  • 3
  • 9
0

Normally, I would say that you could add the AWSDeviceFarmFullAccess policy on your IAM User, but the explicit deny suggests that something is intentionally prohibiting such access.

If you are using an AWS Account that is part of an AWS Organizations hierarchy, it is possible that a Service control policy is blocking use of the Device Farm service in the account.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470