Class: RenderCFN::InstanceProfile

Inherits:
AwsObject
  • Object
show all
Defined in:
lib/renderCFN/instanceProfile.rb

Instance Method Summary collapse

Methods inherited from AwsObject

#get, #name

Constructor Details

#initialize(name) ⇒ InstanceProfile

Returns a new instance of InstanceProfile.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/renderCFN/instanceProfile.rb', line 5

def initialize( name)
  @name = "#{name}InstanceProfile"
  @awsObject = { 
    @name => {
      'Type' => 'AWS::IAM::InstanceProfile',
      'Properties' => {
        'Path' => '/',
        'Roles' => Array.new
      },
    'DependsOn' => []
    }
  }
end

Instance Method Details

#addRole(name) ⇒ Object



19
20
21
# File 'lib/renderCFN/instanceProfile.rb', line 19

def addRole( name)
  @awsObject[@name]['Properties']['Roles'].push( 'Ref' => name)
end