aws4-axios icon indicating copy to clipboard operation
aws4-axios copied to clipboard

signQuery results in error: Cannot set properties of undefined (setting 'X-Amz-Security-Token')

Open frtelg opened this issue 1 year ago • 2 comments

I am using the aws4-axios interceptor to be able to call cache invalidation in API Gateway from a lambda. I have the following configuration:

    const interceptor = aws4Interceptor({
        options: {
            signQuery: true, // Use query string signing to avoid clash with the Authorization header
            region: process.env.AWS_REGION,
            service: 'execute-api',
        },
    });

As stated in the comment in the code snippet, I need to use signedQuery in order to be able to make the signed call, because the API Gateway call has a required Authorization header. When I do this however, I get the following error: Cannot set properties of undefined (setting 'X-Amz-Security-Token').

Did I miss anything in my config or is this a bug maybe?

frtelg avatar Oct 16 '24 08:10 frtelg