Method: Fog::CDN::AWS::Real#initialize
- Defined in:
- lib/fog/aws/cdn.rb
permalink #initialize(options = {}) ⇒ Real
Initialize connection to Cloudfront
Notes
options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection
Examples
cdn = Fog::AWS::CDN.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 {}.
Returns
-
cdn object with connection to aws.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/fog/aws/cdn.rb', line 147 def initialize(={}) require 'fog/core/parser' @use_iam_profile = [:use_iam_profile] setup_credentials() @connection_options = [:connection_options] || {} @host = [:host] || 'cloudfront.amazonaws.com' @path = [:path] || '/' @persistent = .fetch(:persistent, true) @port = [:port] || 443 @scheme = [:scheme] || 'https' @version = [:version] || '2010-11-01' @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) end |