Last active
May 4, 2024 08:54
-
-
Save ran-isenberg/1457d12a7e1d35df85122c0c48e291f2 to your computer and use it in GitHub Desktop.
sigv4.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import requests | |
from aws_requests_auth.aws_auth import AWSRequestsAuth | |
session = boto3.Session() | |
credentials = session.get_credentials() | |
auth = AWSRequestsAuth( | |
aws_access_key=credentials.access_key, | |
aws_secret_access_key=credentials.secret_key, | |
aws_token=credentials.token, | |
aws_host='[Service C API GW host]', | |
aws_region=session.region_name, | |
aws_service='execute-api', | |
) | |
requests.get('[service C API url]', timeout=10, auth=auth) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment