You don't have define the correct endpoint in your bucket S3 in your code.
Can you modify by this :
S3Client s3 = S3Client.builder() .region(Region.of("eu-west-1)) // Use the region obtained from the command .build();