Presigned URL request java backend

My S3 presigned URL request tries to point to AWS S3 and not localstack even when I use “test” as my aws credentials. Here is my presign request method: (Scrollable)

protected URL generatePresignedURL(String objectKey) {

        S3Presigner presigner = S3Presigner.create();

        GetObjectRequest objectRequest = buildGetRequest(objectKey);
        GetObjectPresignRequest presignedRequest = buildPresignedGetRequest(objectRequest);
        PresignedGetObjectRequest presignedGetObjectRequest =

        System.out.println("Presigned URL: " + presignedGetObjectRequest.url());
        return presignedGetObjectRequest.url();

    protected GetObjectRequest buildGetRequest(String objectKey) {
        return GetObjectRequest.builder()

    protected GetObjectPresignRequest buildPresignedGetRequest(GetObjectRequest objectRequest) {

        // Create a GetObjectPresignRequest to specify the signature duration ( 5 minute )
        return GetObjectPresignRequest.builder()

Do I need extra configuration on my presign request to explicitly point to my local instance of S3?
My upload file method works perfectly fine on my LocalStack S3 instance.

Thank you.