python - Create endpoint url for boto3 using API Gateway -


at moment application uses boto3 access aws resources. i'd instead use api gateway front aws services used funnelled through api gateway instead of directly services.

i have api gateway working, how can tell boto3 use new endpoint because api gateway endpoints setup on per action basis. i.e., there's 1 listqueues , createqueue.

using boto3 endpoint-url parameter gives me error:

botocore.parsers.responseparsererror: unable parse response (not well-formed (invalid token): line 1, column 0), invalid xml received: {"message":"credential should scoped correct service: 'execute-api'. "}

when creating client, can pass keyword parameter endpoint_url lets override default url botocore construct target service otherwise.

import boto3  client = boto3.client('sqs', endpoint_url="https://your.api.gateway.url.here") 

you need management here since sounds have read-only api gateway endpoints, , have write capabilities.


Comments