AWS Glue Image issue
Team,
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.
Hello,
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())
Ref docs:
[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)
Relevant questions
AWS Glue 3.0 Docker Image - cannot install Jupyter NBExtensions
asked a month agoGetting AWS Credentials into a Docker Container without Hardcoding It
asked a day agoAWS Glue 3.0 Docker Image - can we increase SPARK configurations ?
asked a month agoAWS Sns Publish method is not working when application deployed using docker container
asked 4 months agoOne-shot docker containers using Docker compose
asked 5 months agoAWS Lightsail plugin not found when using push-container-image
asked 5 months agoaws-glue-libs:glue_libs_3.0.0_image_01 image issue
Accepted Answerasked 2 months agoTesting Crawlers with Glue 3.0 Docker image
asked 3 months agoHow can i run SQL statements in my AWS Glue Script
asked 2 months agoAWS Glue Image issue
asked 2 months ago