Sha256: 9ff4aa629ba75ff2e0bb19afaf67aceaec6949cc723cd90d9f3a8011360f86fa

Contents?: true

Size: 565 Bytes

Versions: 139

Compression:

Stored size: 565 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 be 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

139 entries across 139 versions & 1 rubygems

Version Path
aws-sdk-ec2-1.493.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.492.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.491.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.490.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.489.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.488.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.487.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.486.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.485.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.484.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.483.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.482.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.481.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.480.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.479.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.478.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.477.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.476.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.475.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.474.0 lib/aws-sdk-ec2/plugins/region_validation.rb