Anyone know if there's an aws-api for invoking an API Gateway endpoint that is secured with AWS_IAM (it needs all requests to be signed)?
Hmm, I'm pretty close to getting it to work...
(signers/v4-sign-http-request
{:metadata {:signingName "execute-api"}}
{:region "us-west-2"}
{:aws/access-key-id "..."
:aws/secret-access-key "..."}
{:method :post
:request-method :post
:uri invoke-url
:headers {"content-type" "application/json"
"host" "<http://execute-api.us-west-2.amazonaws.com|execute-api.us-west-2.amazonaws.com>"
"x-amz-date" (aws.util/format-date aws.util/x-amz-date-format (Date.))}}
:content-sha256-header? true)
The AWS response tells me "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.". I'm somewhat certain this has to do with the host header.disclaimer, that namespace is not public
and we will randomly break it
I know... After getting it to run through, I can pull the relevent pieces out 🙂
i'm surprised how bad these docs are