Class: Cucloud::CfnUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/cucloud/cfn_utils.rb

Overview

CFNUtils - Utilities for CloudFormation

Defined Under Namespace

Classes: UnknownServiceError

Instance Method Summary collapse

Constructor Details

#initialize(cfn = Aws::CloudFormation::Client.new) ⇒ CfnUtils

Returns a new instance of CfnUtils.



8
9
10
# File 'lib/cucloud/cfn_utils.rb', line 8

def initialize(cfn = Aws::CloudFormation::Client.new)
  @cfn = cfn
end

Instance Method Details

#create_stack(stack_name, template_json) ⇒ String

Create cloud formation stack from template

Parameters:

  • stack_name (string)

    name of the the cfn stack

  • template_json (string)

    file path to cfn template json

Returns:

  • (String)

    representing the stack events from the run



16
17
18
# File 'lib/cucloud/cfn_utils.rb', line 16

def create_stack(stack_name, template_json)
  manage_stack(stack_name, template_json)
end

#update_stack(stack_name, template_json) ⇒ String

Update cloud formation stack from template

Parameters:

  • stack_name (string)

    name of the the cfn stack

  • template_json (string)

    file path to cfn template json

Returns:

  • (String)

    representing the stack events from the run



24
25
26
# File 'lib/cucloud/cfn_utils.rb', line 24

def update_stack(stack_name, template_json)
  manage_stack(stack_name, template_json, :update_stack)
end