Closed ghosalya closed 2 years ago
Hi @ghosalya thanks for reaching out. Can you confirm that your credentials are set correctly in ~/.aws/credentials
and that you have the necessary IAM permissions assigned?
@tim-finnigan Hello, thank you for the quick response!
Hi @ghosalya thanks for reaching out. Can you confirm that your credentials are set correctly in
~/.aws/credentials
Yes, confirmed by running sts.get_caller_identity()
and that you have the necessary IAM permissions assigned?
Ah, I should've mentioned this earlier. I'm currently using lakeformation:*
in my policy because from the IAM UI, I wasn't able to find GetTemporaryGlueTableCredentials
under Lake Formation or Glue.
Hi @ghosalya thanks for following up. I was trying to find the API documentation for GetTemporaryGlueTableCredentials but was directed to a broken link. I created a ticket here in our shared SDK repository for that: https://github.com/aws/aws-sdk/issues/196
I’m not sure which IAM permissions you need but the examples in this documentation might help: https://docs.aws.amazon.com/glue/latest/dg/using-identity-based-policies.html. Have you tried adding "glue:GetTable"
and "glue:GetTables"
permissions?
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.
@ghosalya this API is reserved for registered third party query engines only. It must be called by an IAM role with a session tag registered to Lake Formation. See the following documentation pages:
One piece of information I find missing from the documentation, is how Lake Formation authorizes the IAM role against the TableArn parameter. LF table permissions are used.
Describe the bug
I'm trying to get a temporary credential that have access to a table's underlying S3 location. The endpoint get_temporary_glue_table_credentials looks like this will do just that, but when I try to use boto3 it raises
AccessDeniedException
without further explanation.Steps to reproduce
The following is a simple call to
get_temporary_glue_table_credentials
, where the TableArn is pointing towards a valid Glue table. I've tried this with both Lake Formation atus-east-1
andap-northeast-1
.Expected behavior An AWS temporary credential is returned as part of
response
(e.g. Access Key, Secret Key)Debug logs
The method returns
AccessDeniedException
without further explanation.It seems like the endpoint is returning http error 400 (see Full Stack Trace).
Full Stack Trace
``` 2022-02-28 12:46:45,383 - botocore.hooks - DEBUG - Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane 2022-02-28 12:46:45,385 - botocore.hooks - DEBUG - Changing event name from before-call.apigateway to before-call.api-gateway 2022-02-28 12:46:45,386 - botocore.hooks - DEBUG - Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict 2022-02-28 12:46:45,387 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration 2022-02-28 12:46:45,388 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.route53 to before-parameter-build.route-53 2022-02-28 12:46:45,388 - botocore.hooks - DEBUG - Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search 2022-02-28 12:46:45,389 - botocore.hooks - DEBUG - Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section 2022-02-28 12:46:45,391 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask 2022-02-28 12:46:45,391 - botocore.hooks - DEBUG - Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section 2022-02-28 12:46:45,391 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search 2022-02-28 12:46:45,391 - botocore.hooks - DEBUG - Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section 2022-02-28 12:46:45,399 - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/ 2022-02-28 12:46:45,400 - botocore.credentials - DEBUG - Looking for credentials via: env 2022-02-28 12:46:45,401 - botocore.credentials - DEBUG - Looking for credentials via: assume-role 2022-02-28 12:46:45,401 - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity 2022-02-28 12:46:45,401 - botocore.credentials - DEBUG - Looking for credentials via: sso 2022-02-28 12:46:45,401 - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file 2022-02-28 12:46:45,401 - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials 2022-02-28 12:46:45,402 - botocore.loaders - DEBUG - Loading JSON file: /home/gede/work/tra/acme-c360-api/.direnv/python-3.7.3/lib/python3.7/site-packages/botocore/data/endpoints.json 2022-02-28 12:46:45,411 - botocore.loaders - DEBUG - Loading JSON file: /home/gede/work/tra/acme-c360-api/.direnv/python-3.7.3/lib/python3.7/site-packages/botocore/data/sdk-default-configuration.json 2022-02-28 12:46:45,411 - botocore.hooks - DEBUG - Event choose-service-name: calling handler