Class: SDM::AWSConnector

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_ids: nil, description: nil, exclude_tags: nil, id: nil, include_tags: nil, name: nil, role_name: nil, scan_period: nil, services: nil) ⇒ AWSConnector

Returns a new instance of AWSConnector.



907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
# File 'lib/models/porcelain.rb', line 907

def initialize(
  account_ids: nil,
  description: nil,
  exclude_tags: nil,
  id: nil,
  include_tags: nil,
  name: nil,
  role_name: nil,
  scan_period: nil,
  services: nil
)
  @account_ids =  == nil ? [] : 
  @description = description == nil ? "" : description
  @exclude_tags = exclude_tags == nil ? [] : exclude_tags
  @id = id == nil ? "" : id
  @include_tags = include_tags == nil ? [] : include_tags
  @name = name == nil ? "" : name
  @role_name = role_name == nil ? "" : role_name
  @scan_period = scan_period == nil ? "" : scan_period
  @services = services == nil ? [] : services
end

Instance Attribute Details

#account_idsObject

AccountIds is the list of AWS Accounts to scan



887
888
889
# File 'lib/models/porcelain.rb', line 887

def 
  @account_ids
end

#descriptionObject

Description of the Connector.



889
890
891
# File 'lib/models/porcelain.rb', line 889

def description
  @description
end

#exclude_tagsObject

ExcludeTags filters out discovered resources that have the tag and value. We do allow duplicate tag names for ExcludeTags to support multiple excluded values for the tag.



892
893
894
# File 'lib/models/porcelain.rb', line 892

def exclude_tags
  @exclude_tags
end

#idObject

Unique identifier of the Connector.



894
895
896
# File 'lib/models/porcelain.rb', line 894

def id
  @id
end

#include_tagsObject

IncludeTags only discovers cloud resources that have one of the included tags. We do not allow duplicate tag names for IncludeTags



897
898
899
# File 'lib/models/porcelain.rb', line 897

def include_tags
  @include_tags
end

#nameObject

Unique human-readable name of the Connector.



899
900
901
# File 'lib/models/porcelain.rb', line 899

def name
  @name
end

#role_nameObject

RoleName is the Role we're assuming into for an account



901
902
903
# File 'lib/models/porcelain.rb', line 901

def role_name
  @role_name
end

#scan_periodObject

ScanPeriod identifies which remote system this Connector discovers



903
904
905
# File 'lib/models/porcelain.rb', line 903

def scan_period
  @scan_period
end

#servicesObject

Services is a list of services this connector should scan.



905
906
907
# File 'lib/models/porcelain.rb', line 905

def services
  @services
end

Instance Method Details

#to_json(options = {}) ⇒ Object



929
930
931
932
933
934
935
# File 'lib/models/porcelain.rb', line 929

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end