Class: Aws::EC2::Plugins::RegionValidation Private

Inherits:
Seahorse::Client::Plugin
  • Object
show all
Defined in:
lib/aws-sdk-ec2/plugins/region_validation.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#after_initialize(client) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
12
13
14
15
16
17
# File 'lib/aws-sdk-ec2/plugins/region_validation.rb', line 9

def after_initialize(client)
  if region = client.config.region
    if matches = region.match(/^(\w+-\w+-\d+)[a-z]$/)
      msg = ":region option must be a region name, not an availability "\
            "zone name; try `#{matches[1]}' instead of `#{matches[0]}'"
      raise ArgumentError, msg
    end
  end
end