https://pulumi.com logo
Title
e

echoing-actor-55539

11/04/2021, 10:22 PM
does anybody have a recipe for using apiKeyRequired on a route with an aws websocket api-gateway? i dont see any way to setup a usage plan or specify the key
l

little-cartoon-10569

11/04/2021, 10:24 PM
The key is provided in the API request, not in the route configuration. There's a trivial example here (bullet 4): https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-wscat.html
To configure which key is used, there is the
routeKey
arg, which is mandatory, so presumably you're already providing that?
e

echoing-actor-55539

11/04/2021, 10:26 PM
i am not referring to routing keys, but the header "X-API-Key'"
l

little-cartoon-10569

11/04/2021, 10:27 PM
Ah. Afaik, apiKeyRequired controls routing keys, not headers...
e

echoing-actor-55539

11/04/2021, 10:28 PM
what about this
the docs refer to the normal api-key header i mentioned above being the default place to get the key from the request
l

little-cartoon-10569

11/04/2021, 10:31 PM
Then I'm afraid we've gone beyond my knowledge 😞
e

echoing-actor-55539

11/04/2021, 10:31 PM
np, thank you for trying
figured it out, had to use awsx.apigateway.createAssociatedAPIKeys
🎉 2