Skip to content

AWSSDK.SecretsManager 4.x has Broken Compatibility in .NET 8 #3825

Open
@jvetter713

Description

@jvetter713

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

  • Select this option if this issue appears to be a regression.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.closing-soonThis issue will automatically close in 4 days unless further comments are made.credentialsneeds-reproductionThis issue needs reproduction.p2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions