-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed and improved region detection within queue url #403
Conversation
} | ||
} | ||
} | ||
return "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this lead to an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if they do end up changing the queue urls or something, maybe we should at least log here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a debug log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh and to answer the first question, yes it will lead to an aws sdk error that the region is undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
func getRegionFromQueueURL(queueURL string) string { | ||
for _, partition := range endpoints.DefaultPartitions() { | ||
for regionID := range partition.Regions() { | ||
if strings.Contains(queueURL, regionID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not likely; but if someone named their queue us-west-2
when it was actually in e.g. ap-southeast-1
then this could have a false positive.
Issue #, if available:
#390
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.