Created
February 24, 2023 12:30
-
-
Save alessandrobologna/7a80f740f906cde982d52a7caba193c7 to your computer and use it in GitHub Desktop.
sigv4 sample
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 | |
from botocore.auth import SigV4Auth | |
from botocore.awsrequest import AWSRequest | |
session = boto3.Session() | |
credentials = session.get_credentials().get_frozen_credentials() | |
def make_signed_request(method, url, service_name, region, data=None, params=None, headers=None): | |
request = AWSRequest(method=method, url=url, data=data, params=params, headers=headers) | |
SigV4Auth(credentials, service_name, region).add_auth(request) | |
return request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment