Sha256: 5464557702db5a0ce650d2fd25df3644c2182067def10befd2e36a51e7f4a0da

Contents?: true

Size: 562 Bytes

Versions: 181

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

module Aws
  module EC2
    module Plugins
      # @api private
      class RegionValidation < Seahorse::Client::Plugin

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

Version data entries

181 entries across 181 versions & 1 rubygems

Version Path
aws-sdk-ec2-1.351.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.350.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.349.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.348.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.347.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.346.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.345.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.344.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.343.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.342.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.341.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.340.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.339.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.338.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.337.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.336.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.335.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.334.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.333.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.332.0 lib/aws-sdk-ec2/plugins/region_validation.rb