You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Extract region from instance metadata instead of parsing availability zone
Extract region from instance metadata instead of parsing availability zone and updated tests accordingly
# Why is this change needed?
Information about region is available from instance metadata. Use it instead of unreliable availability zone name parsing
# How does it address the issue?
Extract region from instance metadata
# How was this tested ?
```
bb release
```
cr https://code.amazon.com/reviews/CR-17976878
raiseInstanceMetadata::InstanceMetadataError.new('Not an EC2 instance and region not provided in the environment variable AWS_REGION. Please specify your region using environment variable AWS_REGION.')
25
-
end
26
-
27
-
raise"Invalid availability zone name: #{az}"unless
assert_raised_with_message('Not an EC2 instance and region not provided in the environment variable AWS_REGION. Please specify your region using environment variable AWS_REGION.',InstanceMetadata::InstanceMetadataError)do
97
-
InstanceMetadata.region
98
-
end
99
-
end
100
-
101
-
should'raise InstanceMetadataError if http open times out'do
assert_raised_with_message('Not an EC2 instance and region not provided in the environment variable AWS_REGION. Please specify your region using environment variable AWS_REGION.',InstanceMetadata::InstanceMetadataError)do
106
-
InstanceMetadata.region
107
-
end
108
-
end
109
-
110
-
should'raise an error if the response is not an AZ'do
0 commit comments