Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Defer to default region provider chain rather than hardcoded us-east-1 #43

Open
adrian-baker opened this issue Sep 30, 2021 · 0 comments

Comments

@adrian-baker
Copy link

If no region is explicitly configured in com.gu.logback.appender.kinesis.BaseKinesisAppender#findRegion, then a hardcoded default of us-east-1 is used:

private Region findRegion() {
  boolean regionProvided = !Validator.isBlank(this.region);
  if(!regionProvided) {
    // Determine region from where application is running, or fall back to default region
    return Region.of(AppenderConstants.DEFAULT_REGION);
  }
  return Region.of(this.region);
}

It would be preferable to let the SDK default to the standard AWS region provider chain, which could be done simply by passing null into the client builder, by returning null, ie:

private Region findRegion() {
  return Validator.isBlank(this.region) ? null : Region.of(this.region); 
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant