1

Trying to add mapping for an integration to pass the websocket connectionId to my http backend. Below command works fine in cloud shell but fails in AWS CLI on Windows.

aws apigatewayv2 update-integration --integration-id foobar --api-id fooapi --request-parameters 'integration.request.header.connectionId'='context.connectionId'

This is the error message

Error parsing parameter '--request-parameters': Expected: '=', received: ''' for input:
'integration.request.header.connectionId'='context.connectionId'

Does anyone know the right syntax to issue in CLI? I tried escaping and double escaping the single quotes. No luck. Making it double quotes will execute but the intended result (the mapping being created) does not happen

Stubborn
  • 290
  • 2
  • 17
  • does this help https://stackoverflow.com/a/61973520/13126651 – Jatin Mehrotra Aug 25 '22 at 06:28
  • Unfortunately it didn't. That was about escaping double quotes in json. I did try escaping these, but no luck – Stubborn Aug 25 '22 at 23:01
  • Similar to: [AWS API Gateway WebSocket: Request Templates body of request after transformations is missing in integration backend](https://stackoverflow.com/a/70742479/174777) – John Rotenstein Aug 25 '22 at 23:03
  • Does this answer your question? [Mongoexport error parsing query](https://stackoverflow.com/questions/21456714/mongoexport-error-parsing-query) (The title is different but the topic is attempting to nest quotes which is a common FAQ.) – tripleee Aug 26 '22 at 07:39

2 Answers2

1

I discovered that simply using double quotes instead of single quotes worked:

--request-parameters "integration.request.header.connectionId"="context.connectionId"
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Stubborn
  • 290
  • 2
  • 17
0

Please Don't use ' in between of '; you used there four times '.

you can write this command like this

--request-parameters 'integration.request.header.connectionId=context.connectionId'

because you are using here argument --request-parameters

Ali
  • 922
  • 1
  • 9
  • 24