Class: Bosh::AwsCliPlugin::AwsProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh_cli_plugin_aws/aws_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials) ⇒ AwsProvider

Returns a new instance of AwsProvider.



6
7
8
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 6

def initialize(credentials)
  @credentials = credentials
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



4
5
6
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 4

def credentials
  @credentials
end

Instance Method Details

#ec2Object



10
11
12
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 10

def ec2
  @ec2 ||= ::AWS::EC2.new(credentials.merge('ec2_endpoint' => ec2_endpoint))
end

#elbObject



14
15
16
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 14

def elb
  @elb ||= ::AWS::ELB.new(credentials.merge('elb_endpoint' => elb_endpoint))
end

#iamObject



18
19
20
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 18

def iam
  @iam ||= ::AWS::IAM.new(credentials)
end

#rdsObject



22
23
24
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 22

def rds
  @rds ||= ::AWS::RDS.new(credentials.merge('rds_endpoint' => rds_endpoint))
end

#rds_clientObject



26
27
28
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 26

def rds_client
  @rds_client ||= ::AWS::RDS::Client.new(credentials.merge('rds_endpoint' => rds_endpoint))
end

#regionObject



34
35
36
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 34

def region
  credentials['region']
end

#route53Object



30
31
32
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 30

def route53
  @aws_route53 ||= ::AWS::Route53.new(credentials)
end

#s3Object



38
39
40
# File 'lib/bosh_cli_plugin_aws/aws_provider.rb', line 38

def s3
  @s3 ||= ::AWS::S3.new(credentials)
end