Module: Elb::Helper

Included in:
Deploy
Defined in:
lib/elb/helper.rb

Constant Summary collapse

@@setup_aws =
nil

Instance Method Summary collapse

Instance Method Details

#asObject



32
33
34
# File 'lib/elb/helper.rb', line 32

def as
  @as ||= AWS::AutoScaling.new
end

#cfnObject



24
25
26
# File 'lib/elb/helper.rb', line 24

def cfn
  @cfn ||= AWS::CloudFormation.new
end

#ec2Object



20
21
22
# File 'lib/elb/helper.rb', line 20

def ec2
  @ec2 ||= AWS::EC2.new
end

#r53Object



36
37
38
# File 'lib/elb/helper.rb', line 36

def r53
  @r53 ||= AWS::Route53.new
end

#rdsObject



28
29
30
# File 'lib/elb/helper.rb', line 28

def rds
  @rds ||= AWS::RDS.new
end

#setup_aws(region = 'us-east-1', options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/elb/helper.rb', line 6

def setup_aws(region='us-east-1', options={})
  return if @@setup_aws
  path = Elb::Settings.new.aws_path
  if File.exist?(path)
    @config = YAML.load(IO.read(path))
    AWS.config(
      :http_wire_trace => options[:debug],
      :access_key_id => @config[:aws_access_key_id], 
      :secret_access_key => @config[:aws_secret_access_key]
    )
  end
  @@setup_aws = true
end