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.473.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.472.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.471.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.470.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.469.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.468.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.467.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.466.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.465.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.464.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.463.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.462.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.461.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.460.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.459.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.455.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.454.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.453.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.452.0 lib/aws-sdk-ec2/plugins/region_validation.rb
aws-sdk-ec2-1.451.0 lib/aws-sdk-ec2/plugins/region_validation.rb