Skip to content

Access Denied for ATHENA

0

Hi team, Getting this error while runninng query in athena

com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: DN9ZNSDSC5ESES3Z; S3 Extended Request ID: FWdDoyX4RXGKTzwAB+5IGvOIlGQRiIuOPznGB5HQ4leHUWC7PBoge6GD9YFbaV5I6hD7WWM9pK8=; Proxy: null), S3 Extended Request ID: FWdDoyX4RXGKTzwAB+5IGvOIlGQRiIuOPznGB5HQ4leHUWC7PBoge6GD9YFbaV5I6hD7WWM9pK8= (Bucket: cairns-unpartitioned-empty-table-bucket, Key: 24e7d286-cb41-48c5-999b-ae4aa56aa99d)

Using same IAM role and policy previously it worked fine

1 Answer
0

It's impossible to understand or help without additional info, it would be really helpful if you can post the policy configured in the role, and the cloudtrail error (remove info like account numbers).

Thanks!

AWS
answered a year ago
EXPERT
reviewed a year ago
  • This the service role policy which is created when we create resource for subscription

    { "Version": "2012-10-17", "Statement": [ { "Action": [ "lakeformation:BatchGrantPermissions", "lakeformation:BatchRevokePermissions", "lakeformation:DeregisterResource", "lakeformation:DescribeResource", "lakeformation:GetDataAccess", "lakeformation:GetDataLakeSettings", "lakeformation:GetEffectivePermissionsForPath", "lakeformation:GrantPermissions", "lakeformation:ListPermissions", "lakeformation:ListResources", "lakeformation:RegisterResource", "lakeformation:RevokePermissions", "lakeformation:UpdateResource", "ram:AcceptResourceShareInvitation", "ram:GetResourceShareInvitations", "ram:ListPendingInvitationResources" ], "Resource": "*", "Effect": "Allow" },

  • { "Action": [ "kms:GenerateDataKey*", "kms:CreateKey*", "kms:CreateAlias", "kms:DescribeKey", "glue:CreateDatabase", "glue:DeleteDatabase", "glue:GetDatabase", "glue:GetDatabases", "glue:UpdateDatabase", "glue:CreateTable", "glue:DeleteTable", "glue:BatchDeleteTable", "glue:UpdateTable", "glue:GetTable", "glue:GetTables", "glue:BatchCreatePartition", "glue:CreatePartition", "glue:DeletePartition", "glue:BatchDeletePartition", "glue:UpdatePartition", "glue:GetPartition", "glue:GetPartitions", "glue:BatchGetPartition", "redshift:DescribeClusters", "redshift:ModifyClusterIamRoles" ], "Resource": "", "Effect": "Allow" }, { "Action": [ "s3:" ], "Resource": "arn:aws:s3:::bdt-glue-bucket-34c8f298-82ba-e3ac-db5e-7262641084db/*", "Effect": "Allow" }, { "Action": [ "s3:ListBucket" ], "Resource": "arn:aws:s3:::bdt-glue-bucket-34c8f298-82ba-e3ac-db5e-7262641084db", "Effect": "Allow" },

  • { "Action": [ "redshift:RejectDataShare", "redshift:AuthorizeDataShare", "redshift:DeauthorizeDataShare", "redshift:AssociateDataShareConsumer", "redshift:DisassociateDataShareConsumer" ], "Resource": "arn:aws:redshift:::datashare:/", "Effect": "Allow" }, { "Action": [ "redshift-data:BatchExecuteStatement", "redshift-data:ExecuteStatement" ], "Resource": [ "arn:aws:redshift:us-east-1:accountId:cluster:", "arn:aws:redshift-serverless:us-east-1:accountId:workgroup/" ], "Effect": "Allow" }, { "Action": [ "redshift:GetClusterCredentials" ], "Resource": [ "arn:aws:redshift:us-east-1:accountId:dbuser:/", "arn:aws:redshift:us-east-1:accountId:dbname:/" ], "Effect": "Allow" }, { "Action": [ "redshift-serverless:GetCredentials", "redshift-serverless:ListWorkgroups", "redshift-serverless:GetNamespace", "redshift-data:CancelStatement", "redshift-data:DescribeStatement", "redshift-data:GetStatementResult", "redshift-data:ListStatements", "redshift-data:ListDatabases", "redshift:DescribeDataShares", "redshift:DescribeDataSharesForProducer", "redshift:DescribeDataSharesForConsumer" ], "Resource": "*", "Effect": "Allow" }, { "Action": [ "iam:PassRole", "iam:GetRole", "iam:GetRolePolicy" ], "Resource": "arn:aws:iam::accountId:role/bdt-glue-role-us-east-1", "Effect": "Allow" } ] }

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.