Add option to AWSConfigs to only use ec2 instance profile role for AWSCredentials #3461
Labels
credentials
feature-request
A feature should be added or improved.
p2
This is a standard priority issue
queued
Describe the feature
Allow specifying which
AWSCredentials
source to use so that we can ensure our application only uses credentials from one source (instance profile).Use Case
We are currently using
InstanceProfileAWSCredentials
to make sure we only get credentials from the instance profile. This has the downside that if the instance profile associated with the EC2 instance is changed, then the .NET application will still attempt to retrieve credentials for the old instance profile and fail. The new instance profile is only picked up after the application is restarted.We want to prevent any other credential source from being used but still automatically refresh the instance profile after a different instance profile is associated with the EC2 instance. (Skip to the last entry (Amazon EC2 instance metadata) in the Credential and profile resolution)
Proposed Solution
Add an option to
AWSConfigs
likeAWSProfileOnlyInstanceProfile
so that we can use the default way to get/refresh credentials but still prevent credentials from different sources from accidentally being used.Other Information
Error message trying to
s3:PutObject
usingInstanceProfileAWSCredentials
after a different instance profile is associated with the EC2 instanceAcknowledgements
AWS .NET SDK and/or Package version used
AWSSDK.Core 3.7.0.17
Targeted .NET Platform
.NET framework 4.7.2
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: