Class: AwsStack::CfnTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/awsstack/cfntemplate.rb

Overview

AWS CFN template file handling

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CfnTemplate

Returns a new instance of CfnTemplate.



7
8
9
10
11
12
13
14
# File 'lib/awsstack/cfntemplate.rb', line 7

def initialize(options)
  @credentials = options[:credentials]
  @templatefile = options[:templatefile]
  @stackname = options[:stackname]
  @bucket_name = 'awsstack.cloudformation.templates'
  @bucket_template_filename = "#{@stackname}_#{File.basename(@templatefile)}"
  template
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/awsstack/cfntemplate.rb', line 6

def body
  @body
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/awsstack/cfntemplate.rb', line 6

def url
  @url
end

Instance Method Details

#delete_templateObject



16
17
18
19
20
21
# File 'lib/awsstack/cfntemplate.rb', line 16

def delete_template
  s3.delete_object(
    bucket: @bucket_name,
    key: @bucket_template_filename
  )
end