.net 8 WEB API calling AWS aws_signing_helper and aws sts assume-role in Linux / Rancher assistance

33 Views Asked by At

Good day all,

I am running in circles to try and determine if I am following the correct way using the aws resources in my.net WEB API application. The application will run in the Rancher platform once deployed. On my Windows machine, I managed to get the following steps to work

  1. In my application I created function to call an external .bat file to call the aws_signing_helper
`aws_signing_helper credential-process --certificate cert/certificate.pem --private-key cert/decrypted_key.pem`

The data return from the .bat is stored in a class

[enablement]
aws_access_key_id =ASIAQGQQB
aws_secret_access_key = gPQBKIepb/ChpjRJddSwSWPH0bwN0k1O
aws_session_token = IQoJb3JpZ2luX2VjECsa
region=af-south-1
  1. Next I call another .bat file to assume a role.
aws sts assume-role --role-arn arn: .................
  1. Now with my temporary credentials I am able to sign my http header and call the AWS API.

All if this is working fine in Windows.

My questions are.

  1. Is there an alternative to skip steps 1 and 2 by using the aws sdk to pass my local certificates?
  2. If there is no alternative way, how do you call the aws_signing_helper in Linux?

When trying to call the aws_signing_helper in a batch file

aws_signing_helper credential-process --certificate cert/certificate.pem --private-key cert/decrypted_key.pem 

I am getting the below error.

An error occurred trying to start process '/usr/src/app/my_script.sh' with working directory '/usr/src/app'. No such file or directory

Or when I try to execute it

/usr/src/app # aws_signing_helper /bin/sh: aws_signing_helper: not found

I get the above error

0

There are 0 best solutions below