How to send gatling request with AWS Signature Version 4.

Hi,

I am trying to automate a scenario where I need to generate load on Pods which are hosted on AWS. They require authentication with “AWS Signature Version 4”.
I am not sure how to send a request with “AWS Signature Version 4” via Gatling Tried to google it but found nothing.
AWS Signature Version 4 takes these values.

1.) AccessKey
2.) SecretKey
3.) AWS Region
4.) Service Name

Returns
“X-Amz-Date”:
“Authorization”: "AWS4-HMAC-SHA256 Credential=AccessKey/us-east-1/apigateway/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature=“somevalue”,

Does giving all the values like this will help?

.exec(http("")
.post(“url”)
.header(“Content-Type”, “application/x-www-form-urlencoded”)
.formParam(“AccessKey”, “${AccessKey}”)

.formParam(“SecretKey”, “${SecretKey}”)

.formParam(“AWS Region”, “”)
.formParam(“Service Name”, “”)
.check(regex(“Signature”).find.exists.saveAs(“Token_ID”))

.check(status.is(200)))

I found a github project on scala for aws sign 4: https://github.com/jkugiya/aws-v4-signer-scala
So adding the dependency in pom.xml is not helping in import the classes.

Tried another way I created Authorization signature in java and sending the request like this and I am able to get the response. Now need to figure out how to create Authorization in scala.

.exec(http(“RESTGetOAuthToken”)
.post("")
.header(“Content-Type”, “application/x-www-form-urlencoded”)
.header(“Content-Type”, “application/json”)
.header(“X-Amz-Date”, “”)
.header(“Authorization”, “”)
.header(“Cache-Control”, “no-cache”)
.body(StringBody("""{
“orders”: [
]
}
]