Class: Fog::AWS::IAM::InstanceProfile

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/iam/instance_profile.rb

Instance Method Summary collapse

Instance Method Details

#add_role(role_name) ⇒ Object



13
14
15
16
17
# File 'lib/fog/aws/models/iam/instance_profile.rb', line 13

def add_role(role_name)
  requires :identity
  service.add_role_to_instance_profile(role_name, self.name)
  true
end

#destroyObject



25
26
27
28
29
# File 'lib/fog/aws/models/iam/instance_profile.rb', line 25

def destroy
  requires :identity
  service.delete_instance_profile(self.identity)
  true
end

#remove_role(role_name) ⇒ Object



19
20
21
22
23
# File 'lib/fog/aws/models/iam/instance_profile.rb', line 19

def remove_role(role_name)
  requires :identity
  service.remove_role_from_instance_profile(role_name, self.name)
  true
end

#saveObject



31
32
33
34
35
36
# File 'lib/fog/aws/models/iam/instance_profile.rb', line 31

def save
  requires :identity

  data = service.create_instance_profile(self.name, self.path).body['InstanceProfile']
  merge_attributes(data)
end