Abhik Chakraborty
Abhik Chakraborty

Reputation: 11

AWS Boto3: The security token included in the request is invalid for AWS FORECAST

I am trying to query forecast arn in aws but getting the following error :

import boto3 
client = boto3.client('forecastquery')
response = client.query_forecast(
    ForecastArn=' ',
    StartDate='2018-12-31T00:00:00',
    EndDate='2019-12-31T23:00:00',
    Filters={
        'item_id':' '
    }
    )
print(response)

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

Upvotes: 1

Views: 1815

Answers (1)

Harsh Wardhan Gupta
Harsh Wardhan Gupta

Reputation: 393

Check the region which you are using. There are few region which required to be enabled. Below regions need to be enable first before using them. Africa (Cape Town) - af-south-1, Asia Pacific (Hong Kong) - ap-east-1, Europe (Milan) - eu-south-1, Middle East (Bahrain) - me-south-1.

While forecasting these regions might also coming into consideration but as these regions are disabled by default therefore you are getting an error. check out document - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions

Upvotes: 0

Related Questions