Using multiple AWSProfileNames simultaneously in your .Net Application

I am building a .Net application which needs to access AWS SQS and S3.
So far, I have defined the AWS credentials for a single account using AWS' preferred method (putting them in a credentials file).

So, my credentials file which lives at:


looks like this:

aws_access_key_id = ACCESS_KEY_01
aws_secret_access_key = SECRET_KEY_01

And my App.Config file looks like this:

    <add key="AWSProfileName" value="default" />
    <add key="AWSProfilesLocation" value="C:\aws_service_credentials\credentials" />

This works quite well and I can initialize my clients in code directly such as:

var sqsClient = new AmazonSQSClient(Amazon.RegionEndpoint.USEast1);

The Problem
Now, I have been told that the S3 credentials will belong to a separate client account -- Say Client01 and the SQS credentials will belong to another account -- Client02.

These two client accounts are not under the same AWS account and are totally separate.

The Question
Is it possible to achieve this scenario using the credentials file?

I know I can create multiple profiles in the Credentials file. For eg:

aws_access_key_id = ACCESS_KEY_01
aws_secret_access_key = SECRET_KEY_01

aws_access_key_id = ACCESS_KEY_02
aws_secret_access_key = SECRET_KEY_02

But how can I switch this programmatically at runtime?

It would be great to be able to do something like this:


    <add key="AWSProfilesLocation" value="C:\aws_service_credentials\credentials" />


var sqsClient = new AmazonSQSClient("client02", Amazon.RegionEndpoint.USEast1);
var s3Client = new AmazonSQSClient("client01", Amazon.RegionEndpoint.USEast1);

My current solution in mind is to define the keys & secrets directly in a config file which I will then access programmatically and pass the values to the clients during initialization -- but I am looking to avoid that.

Any ideas? Thanks!