digest.awsv4_hmac

STRINGdigest.awsv4_hmacSTRINGkeySTRINGdate_stampSTRINGregionSTRINGserviceSTRINGs

Available in all subroutines.

Returns an AWSv4 message authentication code based on the supplied key and input, signing the string s. The key is automatically prepended with the requisite "AWS", and should not be added by the caller.

This function does not support binary data for its secret_key or string to sign s parameters.

Example

declare local var.signature STRING;
set var.signature = digest.awsv4_hmac(
"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY",
"20120215",
"us-east-1",
"iam",
"hello");

Try it out

digest.awsv4_hmac is used in the following solution recipes, which show real world use cases. Click RUN to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

AWS S3 bucket origin (private)

Use AWS authenticated requests (signature version 2) to protect communication between your Fastly service and AWS.

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.