Skip to content

Service specific endpoints don't work with SSO profiles #3538

Open
@drjaydenm

Description

@drjaydenm

Describe the bug

I'm seeing an issue where specifying service specific endpoints as per the documentation is not working when using a profile with SSO.

Regression Issue

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

Expected Behavior

Service specific configuration works correctly with SSO profiles.

Current Behavior

Service specific configuration like endpoint URL's aren't available to the client services (i.e. SQS) when setup on a profile using SSO.

Adding the service specific configuration to the default profile however works correctly.

Reproduction Steps

~/.aws/config file:

[default]
region = ap-southeast-2

[sso-session app-sso]
sso_start_url = https://appsso.awsapps.com/start
sso_region = ap-southeast-2

[profile app-dev]
sso_session = app-sso
sso_account_id = 1234565768
sso_role_name = AWSAdministratorAccess
services = app-services

[services app-services]
sqs = 
  endpoint_url = http://localhost:9324

appsettings.json file:

"AWS": {
  "Region": "ap-southeast-2",
  "Profile": "app-dev"
}

Program.cs file:

builder.Services.AddDefaultAWSOptions(builder.Configuration.GetAWSOptions());
builder.Services.AddAWSService<IAmazonSQS>();

Possible Solution

I've stepped through the SDK a bit and it seems like the SharedCredentialsFile for the app-dev profile initially loads (which has the services NestedProperties available), but then gets swapped to the default profile further down the line by the time it makes its way to the SQS client.

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Targeted .NET Platform

.NET 8

Operating System and version

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.credentialsp2This is a standard priority issuequeued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions