Method: Fog::AWS::CloudWatch::Real#initialize
- Defined in:
- lib/fog/aws/cloud_watch.rb
permalink #initialize(options = {}) ⇒ Real
Initialize connection to Cloudwatch
Notes
options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection
Examples
elb = CloudWatch.new(
:aws_access_key_id => your_aws_access_key_id,
:aws_secret_access_key => your_aws_secret_access_key
)
Parameters
-
options<~Hash> - config arguments for connection. Defaults to {}.
-
region<~String> - optional region to use. For instance, ‘eu-west-1’, ‘us-east-1’, etc.
-
Returns
-
CloudWatch object with connection to AWS.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/fog/aws/cloud_watch.rb', line 92 def initialize(={}) @use_iam_profile = [:use_iam_profile] setup_credentials() @connection_options = [:connection_options] || {} @instrumentor = [:instrumentor] @instrumentor_name = [:instrumentor_name] || 'fog.aws.cloud_watch' [:region] ||= 'us-east-1' @host = [:host] || "monitoring.#{[:region]}.amazonaws.com" @path = [:path] || '/' @persistent = [:persistent] || false @port = [:port] || 443 @scheme = [:scheme] || 'https' @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) end |