Method: Awspec::Type::AccountAttribute#resource_via_client

Defined in:
lib/awspec/type/account_attribute.rb

#resource_via_clientObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/awspec/type/account_attribute.rb', line 7

def resource_via_client
  attributes = nil
  Awspec::Helper::Type::ACCOUNT_ATTRIBUTES.each do |type|
    key = type.gsub(Awspec::Type::Account::REMOVE_SUFFIX_RE, '').to_sym
    next unless key == @key
    if key == 'ses'
      # https://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html
      next unless ['us-east-1', 'us-west-2', 'eu-west-1'].include?(Aws.config[:region])
    end
    eval "attributes = Awspec::Type::#{type.camelize}.new.resource_via_client"
  end
  @resource_via_client ||= attributes
end