Skip to content

AWSSecurityTokenServiceClientBuilder in aws-java-sdk-sts does not use the region endpoint when supplied region #2362

@dlabey

Description

@dlabey

When using the AWSSecurityTokenServiceClientBuilder and supplying a region (withRegion), the STS global endpoint is still used (sts.amazonaws.com). The region endpoint should be used when supplied with a region so the client detects the VPC Interface Endpoint if the account is configured for one in that region.

Describe the bug

Constructed a client with the region of US-WEST-2 for STS and the global endpoint is still used.
return AWSSecurityTokenServiceClientBuilder.standard() .withRegion(Regions.US_WEST_2) .build();

Expected Behavior

Region endpoint is used (sts.us-west-2.amazonaws.com).

Current Behavior

Global endpoint is used (sts.amazonaws.com).

Steps to Reproduce

Constructor and STS client and see the global endpoint being used.
return AWSSecurityTokenServiceClientBuilder.standard() .withRegion(Regions.US_WEST_2) .build();

Possible Solution

Fix the SDK so the regional endpoint is used.

Context

Regional endpoint has to manually be used, which is what is needed to use VPC Interface Endpoint.

Your Environment

Java 8, AWS Lambda

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.documentationThis is a problem with documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions