Injecting credentials into C++ S3 CRT SDK

0

I want to specify a credentials file for the S3 CRT SDK to use that is not in the default location. I do not have access to change environment variables on the host machine. Is there a way to override the AWS_SHARED_CREDENTIALS_FILE variable in code or otherwise specify where to find the credentials so the SDK will find the credentials file I want?

1 Risposta
0
Risposta accettata

It turns out that there is a constructor for the S3CrtClient that accepts a credentials argument. Looks like that is the way to go.

S3CrtClient(const Aws::Auth::AWSCredentials& credentials, const Aws::S3Crt::ClientConfiguration& clientConfiguration = Aws::S3Crt::ClientConfiguration(), Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy signPayloads = Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never, bool useVirtualAddressing = true, Aws::S3Crt::US_EAST_1_REGIONAL_ENDPOINT_OPTION USEast1RegionalEndPointOption = Aws::S3Crt::US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET);
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande