Module: Alephant::Harness::AWS

Defined in:
lib/alephant/harness/aws.rb

Class Method Summary collapse

Class Method Details

.config=(environment) ⇒ Object



13
14
15
# File 'lib/alephant/harness/aws.rb', line 13

def config=(environment)
  @environment = environment
end

.dynamo_configObject



33
34
35
36
37
38
39
# File 'lib/alephant/harness/aws.rb', line 33

def dynamo_config
  environment.select do |key, _|
    (ACCESS_CONFIG_KEYS + DYNAMO_CONFIG_KEYS).include?(key)
  end.map do |key, value|
    [key.to_s.gsub('dynamo_db_', '').to_sym, value]
  end.to_h
end

.environmentObject



9
10
11
# File 'lib/alephant/harness/aws.rb', line 9

def environment
  aws_properties_from(@environment || ENV)
end

.s3_configObject



17
18
19
20
21
22
23
# File 'lib/alephant/harness/aws.rb', line 17

def s3_config
  environment.select do |key, _|
    (ACCESS_CONFIG_KEYS + S3_CONFIG_KEYS).include?(key)
  end.map do |key, value|
    [key.to_s.gsub('s3_', '').to_sym, value]
  end.to_h
end

.sqs_configObject



25
26
27
28
29
30
31
# File 'lib/alephant/harness/aws.rb', line 25

def sqs_config
  environment.select do |key, _|
    (ACCESS_CONFIG_KEYS + SQS_CONFIG_KEYS).include?(key)
  end.map do |key, value|
    [key.to_s.gsub('sqs_', '').to_sym, value]
  end.to_h
end