-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Region detection #1455
Comments
We haven't implemented region fetching from the EC2 instance metadata service yet, no. Adding this as a feature request. |
Thanks @awood45! |
+1 |
Adding to feature request backlog. |
Reopening - deprecating usage of Feature Requests backlog markdown file. |
@mullermp Currently when I pull a single EC2 instance metadata, it has given instance data and it's availability zone information but no region information included in the response. Can we considered availability zone as current region information? |
Hi @sivagollapalli -- If I recall correctly, this was put aside because there were changes coming to the IMDS API and we didn't want to include any potential breakage from before and after that change. I can check back in with the EC2 team after the holidays and see if that's still the case. Last I looked, I believe there is a region field or some way to get the region (using the AZ as you said). |
@mullermp Any update on this? |
Right now there's no good way to get the region docs: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html Unfortunately this has been long requested, I will try to make a stink on it somewhere: https://forums.aws.amazon.com/thread.jspa?threadID=77228 The best thing we can do is query for |
added PR @mullermp |
|
Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue. |
looks like there's already code to query the metadata service for the region - https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-core/lib/aws-defaults/defaults_mode_config_resolver.rb#L65-L86 Setting |
The defaults mode is cross SDK behavior and the application region detection is used to determine only whether to use in-region or cross-region defaults (mostly http timeout defaults) and wasn't intended to be used to set client region. But that being said - providing region detection as part of client region resolution is still a feature request we are planning on. |
Doing so in the current major version I think is risky and can cause errors (changes configuration in a minor version). If you agree, I think we should label this as major version only. |
The precedence is already environment then profile. I don't see how having the metadata service be the lowest priority (and match how credentials are resolved) is a breaking change. especially since it's how it works in both v1 and v2 |
Since |
Ah yeah that makes sense, if it's last. We have very aggressive timeouts for "testing" if we are on an ec2 host. I suppose we only have to do that once in both the region config chain (new concept) and credential provider chain if we use some client class variable or something like that. |
Is there currently a way too detect the current region like is available in the Java SDK for example https://aws.amazon.com/blogs/developer/determining-an-applications-current-region/
At the moment I am having to set the AWS_REGION environment variable manually which I was hoping to avoid.
The text was updated successfully, but these errors were encountered: