Implentation of calculating a signature for signing AWS API requests. Specifically, this script invalidates all files (/*
) in a Cloudfront distribution via a signed API request.
To run it, edit the .sh file by settting AWS_ACCESS_KEY
, AWS_SECRET_KEY
, and DISTRIBUTION_ID
with your values, and source the file in a shell:
source signedAWSRequest.sh
This script uses openssl
, xxd
, and other standard UNIX commands (such as awk
).
If you would like invalidate a single file, then change the path value in the Path element (currently it's set to /*
).
You can find more information on how to calculate the required signature here: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html#signing-request-intro