I have an AWS API Gateway that I would like to secure using IAM Roles .
I am looking for a package to help me accessing it using Python. I am trying to avoid implementin
You can use aws-requests-auth to generate the signature for your request to API Gateway with execute-api as the service name.
import requests
from aws_requests_auth.aws_auth import AWSRequestsAuth
auth = AWSRequestsAuth(aws_access_key='YOURKEY',
aws_secret_access_key='YOURSECRET',
aws_host='restapiid.execute-api.us-east-1.amazonaws.com',
aws_region='us-east-1',
aws_service='execute-api')
headers = {'params': 'ABC'}
response = requests.get('https://restapiid.execute-api.us-east-1.amazonaws.com/stage/resource_path',
auth=auth, headers=headers)