Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amazonka timestream query prefix results in 404 #985

Open
jappeace opened this issue Apr 18, 2024 · 0 comments
Open

amazonka timestream query prefix results in 404 #985

jappeace opened this issue Apr 18, 2024 · 0 comments

Comments

@jappeace
Copy link

jappeace commented Apr 18, 2024

the current implementation of default service returns a 404:

[2024-04-18 10:39:44][beacon-locator.amazonka][Info][14c503cab06d][PID 1][ThreadId 19] [Client Response] {
  status  = 404 Not Found
  headers = x-amzn-requestid: 81b0faa1-aca7-4b91-a44f-7b066609e2f5; content-type: application/x-amz-json-1.0; content-length: 63; date: Thu, 18 Apr 2024 10:39:43 GMT
}
[2024-04-18 10:39:44][beacon-locator.amazonka][Debug][14c503cab06d][PID 1][ThreadId 19] [Raw Response Body] {
{"__type":"com.amazon.coral.service#UnknownOperationException"}
}
[2024-04-18 10:39:44][beacon-locator.amazonka][Error][14c503cab06d][PID 1][ThreadId 19] [ServiceError] {
  service    = TimeStreamQuery
  status     = 404 Not Found
  code       = UnknownOperation
  message    = Nothing
  request-id = Just 81b0faa1-aca7-4b91-a44f-7b066609e2f5
}

It should be changed to:

defaultService =
  Core.Service
    { Core.endpointPrefix = "query-cell1.timestream",
    ...
    }

you can verify this by running describe endpoints:

aws timestream-query describe-endpoints --region eu-west-1
{
    "Endpoints": [
        {
            "Address": "query-cell1.timestream.eu-west-1.amazonaws.com",
            "CachePeriodInMinutes": 1440
        }
    ]
}

to work around this issue is kinda difficult because by defeault the prefix field get's ignored by the instances,
you've to also override the endpoint generation function:

setEndpoint :: Service -> Service
setEndpoint y = let z = y{
  endpointPrefix = "query-cell1.timestream",
  endpoint = Core.defaultEndpoint z
  }
  in z

which you now can use to modify your enviroment:

envMod :: Env -> Env
envMod x = x{overrides = setEndpoint}
main =   runResourceT $ do
    runConduit $
      paginate (envMod env) query
      .| sinkList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant