Class: AWS::STS::Policy
- Inherits:
-
Core::Policy
- Object
- Core::Policy
- AWS::STS::Policy
- Defined in:
- lib/aws/sts/policy.rb
Overview
Represents an access policy for AWS operations and resources. For example:
policy = Policy.new
policy.allow(
:actions => ['s3:PutObject'],
:resources => "arn:aws:s3:::mybucket/mykey/*",
:principals => :any
).where(:acl).is("public-read")
policy.to_json # => '{ "Version":"2008-10-17", ...'
Instance Attribute Summary
Attributes inherited from Core::Policy
Instance Method Summary collapse
-
#to_h ⇒ Hash
Returns a hash representation of the policy.
Methods inherited from Core::Policy
#==, #allow, #deny, from_json, #initialize, #to_json
Constructor Details
This class inherits a constructor from AWS::Core::Policy
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of the policy. The following statements are equivalent:
policy.to_h.to_json
policy.to_json
21 22 23 24 25 |
# File 'lib/aws/sts/policy.rb', line 21 def to_h h = super h.delete("Id") h end |