AWS Glue Image issue
I have created AWS glue container using aws glue image . When I am logging into docker using bash command I can see aws credentials are set in docker . When I am running aws s3 ls from docker it s providing me list of s3 buckets.
I have written small code to test to connection to aws but it is giving error .
import os import boto3 boto3.__version__ client = boto3.client('sts') response=client.get_caller_identity()
error I am getting is : An error was encountered: An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid. Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/botocore/client.py", line 314, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/local/lib/python3.6/site-packages/botocore/client.py", line 612, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid.
I have tried unset the existing credentials and set new still getting same issue
I am using 1.0 glue image.
Looks like some issue with your credentials or configuration.
Below steps worked fine for me:
docker pull amazon/aws-glue-libs:glue_libs_1.0.0_image_01 docker run -it amazon/aws-glue-libs:glue_libs_1.0.0_image_01 bash root@98c197939c1b:/# aws configure root@98c197939c1b:/# aws sts get-caller-identity --no-cli-pager root@98c197939c1b:/# python --version Python 3.6.15 root@98c197939c1b:/# python Python 3.6.15 (default, Dec 3 2021, 03:07:35) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os,boto3 >>> print(boto3.__version__) 1.8.9 >>> client = boto3.client('sts') >>> print(client.get_caller_identity())
[1. Configuring AWS CLI ] (https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)
[2. GetCallerIdentity api call] (https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html)
AWS Glue 3.0 Docker Image - cannot install Jupyter NBExtensions
Getting AWS Credentials into a Docker Container without Hardcoding Itasked a day ago
AWS Glue 3.0 Docker Image - can we increase SPARK configurations ?
AWS Sns Publish method is not working when application deployed using docker containerasked 4 months ago
One-shot docker containers using Docker composeasked 5 months ago
AWS Lightsail plugin not found when using push-container-imageasked 5 months ago
aws-glue-libs:glue_libs_3.0.0_image_01 image issueAccepted Answer
Testing Crawlers with Glue 3.0 Docker imageasked 3 months ago
How can i run SQL statements in my AWS Glue Scriptasked 2 months ago
AWS Glue Image issue