Generates an AWS signature version 4 signed request.
Creates a signed request following the AWS Signature Version 4 process, which
provides secure authentication for AWS API calls. The process includes creating
canonical request strings, calculating signatures using the AWS credentials, and
building proper authorization headers.
aws_credentials (Hash) โ The AWS security credentials with the following keys:
@option aws_credentials [String] :access_key_id The AWS access key ID
@option aws_credentials [String] :secret_access_key The AWS secret access key
@option aws_credentials [String, nil] :session_token Optional AWS session token
original_request (Hash) โ The request to sign with the following keys:
@option original_request [String] :url The AWS service URL (must be HTTPS)
@option original_request [String] :method The HTTP method (GET, POST, etc.)
@option original_request [Hash, nil] :headers Optional request headers
@option original_request [String, nil] :data Optional request payload
Returns
(Hash) โ
The signed request with the following keys:
:url - The original URL as a string
:headers - A hash of headers with the authorization header added
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# googleauth - Class Google::Auth::ExternalAccount::AwsRequestSigner (v1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/ruby/docs/reference/googleauth/latest/Google-Auth-ExternalAccount-AwsRequestSigner)\n- [1.14.0](/ruby/docs/reference/googleauth/1.14.0/Google-Auth-ExternalAccount-AwsRequestSigner)\n- [1.13.1](/ruby/docs/reference/googleauth/1.13.1/Google-Auth-ExternalAccount-AwsRequestSigner)\n- [1.12.2](/ruby/docs/reference/googleauth/1.12.2/Google-Auth-ExternalAccount-AwsRequestSigner) \nReference documentation and code samples for the googleauth class Google::Auth::ExternalAccount::AwsRequestSigner.\n\nImplements an AWS request signer based on the AWS Signature Version 4 signing process.\n\u003chttps://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\u003e \n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### #generate_signed_request\n\n def generate_signed_request(aws_credentials, original_request) -\u003e Hash\n\nGenerates an AWS signature version 4 signed request.\n\n\nCreates a signed request following the AWS Signature Version 4 process, which\nprovides secure authentication for AWS API calls. The process includes creating\ncanonical request strings, calculating signatures using the AWS credentials, and\nbuilding proper authorization headers.\n\n\u003cbr /\u003e\n\nFor detailed information on the signing process, see:\n\u003chttps://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html\u003e \n**Parameters**\n\n- **aws_credentials** (Hash) --- The AWS security credentials with the following keys: @option aws_credentials \\[String\\] :access_key_id The AWS access key ID @option aws_credentials \\[String\\] :secret_access_key The AWS secret access key @option aws_credentials \\[String, nil\\] :session_token Optional AWS session token\n- **original_request** (Hash) --- The request to sign with the following keys: @option original_request \\[String\\] :url The AWS service URL (must be HTTPS) @option original_request \\[String\\] :method The HTTP method (GET, POST, etc.) @option original_request \\[Hash, nil\\] :headers Optional request headers @option original_request \\[String, nil\\] :data Optional request payload \n**Returns**\n\n- (Hash) --- The signed request with the following keys:\n\n - :url - The original URL as a string\n - :headers - A hash of headers with the authorization header added\n - :method - The HTTP method\n- :data - The request payload (if present) \n**Raises**\n\n- ([Google::Auth::CredentialsError](./Google-Auth-CredentialsError)) --- If the AWS service URL is invalid\n\n### #initialize\n\n def initialize(region_name) -\u003e AwsRequestSigner\n\nInstantiates an AWS request signer used to compute authenticated signed requests to AWS APIs based on the AWS\nSignature Version 4 signing process. \n**Parameter**\n\n- **region_name** (string) --- The AWS region to use. \n**Returns**\n\n- ([AwsRequestSigner](./Google-Auth-ExternalAccount-AwsRequestSigner)) --- a new instance of AwsRequestSigner"]]