Class: Fog::AWS::KMS::Key

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#policy=(value) ⇒ Object (writeonly)

Sets the attribute policy

Parameters:

  • value

    the value to set the attribute policy to.



14
15
16
# File 'lib/fog/aws/models/kms/key.rb', line 14

def policy=(value)
  @policy = value
end

Instance Method Details

#reloadObject



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

def reload
  requires :identity

  data = service.describe_key(self.identity)
  merge_attributes(data.body['KeyMetadata'])

  self
end

#saveObject



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

def save
  data = service.create_key(@policy, description, usage)

  merge_attributes(data.body['KeyMetadata'])
  true
end