Module: CfnCli::CfnClient

Included in:
CloudFormation, Stack
Defined in:
lib/cfncli/cfn_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#retry_backoffObject

Returns the value of attribute retry_backoff.



8
9
10
# File 'lib/cfncli/cfn_client.rb', line 8

def retry_backoff
  @retry_backoff
end

#retry_limitObject

Returns the value of attribute retry_limit.



7
8
9
# File 'lib/cfncli/cfn_client.rb', line 7

def retry_limit
  @retry_limit
end

#stub_responsesObject

Returns the value of attribute stub_responses.



6
7
8
# File 'lib/cfncli/cfn_client.rb', line 6

def stub_responses
  @stub_responses
end

Instance Method Details

#cfnObject

Note:

this uses a class variable for the client and the resource so they can share

Clouformation Resource This is used to interact with the CloudFormation API the stubbed responses in the unit tests.



25
26
27
28
# File 'lib/cfncli/cfn_client.rb', line 25

def cfn
  @@resource ||= Aws::CloudFormation::Resource.new(client: cfn_client)
  @@resource
end

#cfn_clientObject

CloudFormation client



12
13
14
15
16
17
18
# File 'lib/cfncli/cfn_client.rb', line 12

def cfn_client
  options ||= {}
  options[:retry_limit] = @retry_limit if @retry_limit
  options[:retry_backoff] = @retry_backoff if @retry_backoff
  options[:stub_responses] = @stub_responses || false
  @@client ||= Aws::CloudFormation::Client.new(**options)
end