Class: Fog::AWS::IAM::Role

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

Instance Method Summary collapse

Instance Method Details

#destroyObject



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

def destroy
  requires :rolename

  service.delete_role(rolename)
  true
end

#saveObject

Raises:

  • (Fog::Errors::Error)


15
16
17
18
19
20
21
22
23
# File 'lib/fog/aws/models/iam/role.rb', line 15

def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
  requires :rolename
  requires :assume_role_policy_document

  data = service.create_role(rolename, assume_role_policy_document).body["Role"]
  merge_attributes(data)
  true
end