Unable to perform actions with AWS Timestream (Endpoint Discovery failed)

0

I unable to perform any actions with Timestream (us-west-2), including querying/ingesting data into tables, listing tables, and creating new databases. All of them give me "Endpoint discovery failed to refresh the required endpoints" error. I have tried performing these commands through Python's boto3 and through AWS CLI. I have tried using an IAM user with admin permissions and a role with all Timestream permissions. Everything gives me the same error. I am able to perform all these actions in the console.

  • Hi there,

    Which boto3 and botocore are you using? Can you try to upgrade them to the latest version? Also Is it possible to post a code snapshot of your Python code and AWS CLI?

  • I am using v1.24.19 for boto3 and v1.27.19 botocore. I tried upgrading them to the latest version (v1.24.21 and v1.27.21) but I get the same error.

    Below is my client creation code. I have used the same code to assume a different role with a different profile for S3 before and it worked fine. session = boto3.Session() roleClient = session.client('sts') assumedRole = roleClient.assume_role(RoleArn=roleARN, RoleSessionName='role') credentials = assumedRole['Credentials'] awsKey = credentials['AccessKeyId'] awsSecretKey = credentials['SecretAccessKey'] awsSessionToken = credentials['SessionToken'] client = boto3.client( 'timestream-write', aws_access_key_id=awsKey, aws_secret_access_key=awsSecretKey, aws_session_token=awsSessionToken, )

    For writing it's just the one line of code for testing:

    result = self.client.write_records(DatabaseName=self.database, TableName=self.table, Records=records, CommonAttributes={})

    I tried setting the database and table names to empty strings and it gives the same error so it's failing before it gets to check those variables. For the AWS CLI, I used the example from the docs:

    aws timestream-write create-database --database-name myFirstDatabase

gefragt vor 2 Jahren367 Aufrufe
1 Antwort
1
Akzeptierte Antwort

Maybe it's looking for the Timestream endpoint in the wrong region by default. Try passing region_name=us-west-2 in the config parameter when creating a client

--Syd

profile picture
Syd
beantwortet vor 2 Jahren
  • Working fine now that I added the region_name to the config in client creation, thanks!

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen