AWSSDK.SecretsManager 4.x has Broken Compatibility in .NET 8 #3825
Labels
bug
This issue is a bug.
credentials
needs-reproduction
This issue needs reproduction.
p2
This is a standard priority issue
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
Upgrading from 3.x to 4.x has broken compatibility.
The migration guide only talks about .NET Framework, not .NET Core
Regression Issue
Expected Behavior
I expected nothing to suddenly break.
Current Behavior
Exception 1 of 4: The environment variables AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN were not set with AWS credentials.
Exception 2 of 4: The webIdentityTokenFile must be an absolute path. (Parameter 'webIdentityTokenFile')
Exception 3 of 4: Unable to find the "default" profile.
Exception 4 of 4: Failed to connect to EC2 instance metadata to retrieve credentials: Unable to get IAM security credentials from EC2 Instance Metadata Service..
Reproduction Steps
.NET 8 Minimal Web API
Existing Code example:
private SomeSecretClassOfMine LoadCloudSecrets(string environment)
{
var awsSecretsManagerUrl = Environment.GetEnvironmentVariable("{Secret Env Variable Name}");
var secretId = Environment.GetEnvironmentVariable("{Secret Env Variable Name}");
var secretsManagerConfig = new AmazonSecretsManagerConfig
{
ServiceURL = awsSecretsManagerUrl
};
var secretsManagerClient = new AmazonSecretsManagerClient(secretsManagerConfig);
var secretsRequest = new GetSecretValueRequest
{
SecretId = secretId,
VersionStage = "AWSCURRENT"
};
var secretsResponse = secretsManagerClient.GetSecretValueAsync(secretsRequest).Result;
var secrets = JsonSerializer.Deserialize(secretsResponse.SecretString, JsonSerializerOptions)!;
secrets.Environment = environment;
return secrets;
}
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.SecretsManager 3.7.400.152.
Upgrading to any of the 4.x will reproduce
Targeted .NET Platform
.NET 8
Operating System and version
Linux
The text was updated successfully, but these errors were encountered: