I have multiple AspNetCore
applications running on a Windows Server 2016
EC2. All these applications require to assume different IAM roles based on their permissions.
These applications run under the local system account and since the profile file location C:\Users\<user>\.aws\config
is not applicable to the system user, it's not clear from the docs how to specify the role profile name per application. Without specifying the role profile, the applications will assume the EC2 instance profile role which is not what I want.
If I was running the application as a local user, following configuration works
Credentials file C:\Users\<user>\.aws\credentials
[applicationuser]
aws_access_key_id = xxxxxxxx
aws_secret_access_key = yyyyyyyy
Profile config file C:\Users\<user>\.aws\config
[profile ApplicationA]
role_arn = arn:aws:iam::11111111111:role/ApplicationA
source_profile = applicationuser
[profile ApplicationB]
role_arn = arn:aws:iam::11111111111:role/ApplicationB
source_profile = applicationuser
Any ideas on how this can be achieved when the applications are run under local system account in an EC2 which has an instance profile?