question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python - UnrecognizedClientException : The security token included in the request is invalid

See original GitHub issue

I am following the tutorial of the DynamoDB of Amazon using the Python boto3 :

https://boto3.amazonaws.com/v1/documentation/api/latest/guide/dynamodb.html

Before that, I have installed Dynamo DB Locally and Running the Dynamo DB (Windows 7)-

image https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html

Configuration File has been created using the AWS CLI -

aws configure image Followed the following documentation also - https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html#configuring-credentials

Now, DynomoDB Local is configured and Running along with the Credentials configured through “aws configure” and config, credentials files created with “default” profile. Now i am running the sample program -

` import boto3

#Get the service resource. dynamodb = boto3.resource( ‘dynamodb’, aws_access_key_id=‘foo’, aws_secret_access_key=‘bar’, )

#Create the DynamoDB table. table = dynamodb.create_table( TableName=‘users1’, KeySchema=[ { ‘AttributeName’: ‘username’, ‘KeyType’: ‘HASH’ }, { ‘AttributeName’: ‘last_name’, ‘KeyType’: ‘RANGE’ } ], AttributeDefinitions=[ { ‘AttributeName’: ‘username’, ‘AttributeType’: ‘S’ }, { ‘AttributeName’: ‘last_name’, ‘AttributeType’: ‘S’ },

],
ProvisionedThroughput={
    'ReadCapacityUnits': 5,
    'WriteCapacityUnits': 5
}

)

#Wait until the table exists. table.meta.client.get_waiter(‘table_exists’).wait(TableName=‘users1’)

#Print out some data about the table. print(table.item_count)

But i am getting the following error -

An error occurred (UnrecognizedClientException) when calling the CreateTable operation: The security token included in the request is invalid.

Is there any problem with settings in the boto3 even though i have configured the credentials, config files are having the right data ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kcsekhar14commented, Sep 6, 2018

@jschwarzwalder Yes. Thankyou. I have tried it and working.

dynamodb = boto3.resource(
    'dynamodb',
    endpoint_url='http://localhost:8000',   
    aws_access_key_id='foo',
    aws_secret_access_key='bar',
    verify=False)
0reactions
jschwarzwaldercommented, Sep 5, 2018

It looks like if you want to access the local repo you need to add the flag --endpoint-url http://localhost:8000

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Boto3: The security token included in the request is invalid
ClientError : An error occurred (UnrecognizedClientException) when calling the SendCommand operation: The security token included in the request ...
Read more >
The security token included in the request is invalid - Seed.run
This happens when the AWS credentials used for your Serverless command are invalid. Or if they have not been configured on your machine....
Read more >
Resolve "The security token included in the request is expired ...
My Java applications using the AWS SDK for Java on an Amazon Elastic Compute Cloud (Amazon EC2) instance receive an exception similar to...
Read more >
Terraform + localstack : Cloudwatch logs Error ...
Terraform + localstack : Cloudwatch logs Error: UnrecognizedClientException: The security token included in the request is invalid.
Read more >
The security token included in the request is invalid.
[This thread is closed.] Hi, some of the email send from woocommerce like reset password/password changed and I will get invalid error. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found