AWSexit code > 0

An error occurred (AccessDenied)

$An error occurred (AccessDenied) when calling the ListBuckets operation: User: arn:aws:iam::123456789012:user/dev is not authorized to perform: s3:ListAllMyBuckets

Analysis

Your AWS credentials are valid, but the IAM user or role does not have permission to perform the requested action.

Common Triggers

  • Missing IAM policy for the specific operation.
  • Permission boundary or SCP (Service Control Policy) blocking the action.

Debug Checks

  • $Check the IAM policy attached to the user/role in the AWS Console.
  • $Verify if you are in the correct AWS account.

Resolution

1
Add the required permissions to the IAM policy.
2
Ensure the user has the correct role assumed.