AWS SDK for .NET Documentation
Policy Class
AmazonAmazon.Auth.AccessControlPolicyPolicy Did this page help you?   Yes   No    Tell us about it...
An AWS access control policy is a object that acts as a container for one or more statements, which specify fine grained rules for allowing or denying various types of actions from being performed on your AWS resources.

By default, all requests to use your resource coming from anyone but you are denied. Access control polices can override that by allowing different types of access to your resources, or by explicitly denying different types of access.

Each statement in an AWS access control policy takes the form: "A has permission to do B to C where D applies".

A is the prinicpal
The AWS account that is making a request to access or modify one of your AWS resources.
B is the action
the way in which your AWS resource is being accessed or modified, such as sending a message to an Amazon SQS queue, or storing an object in an Amazon S3 bucket.
C is the resource
your AWS entity that the principal wants to access, such as an Amazon SQS queue, or an object stored in Amazon S3.
D is the set of conditions
optional constraints that specify when to allow or deny access for the principal to access your resource. Many expressive conditions are available, some specific to each service. For example you can use date conditions to allow access to your resources only after or before a specific time.

Note that an AWS access control policy should not be confused with the similarly named "POST form policy" concept used in Amazon S3.

Declaration Syntax
C#
public class Policy
Members
All MembersConstructorsMethodsProperties



IconMemberDescription
Policy()()()()
Constructs an empty AWS access control policy ready to be populated with statements.

Policy(String)
Constructs a new AWS access control policy with the specified policy ID. The policy ID is a user specified string that serves to help developers keep track of multiple polices. Policy IDs are often used as a human readable name for a policy.

Policy(String, IList<(Of <<'(Statement>)>>))
Constructs a new AWS access control policy with the specified policy ID and collection of statements. The policy ID is a user specified string that serves to help developers keep track of multiple polices. Policy IDs are often used as a human readable name for a policy.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
FromJson(String)
Parses a JSON document of a policy and creates a Policy object.

GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()()
Gets the type of the current instance.
(Inherited from Object.)
Id
Gets and Sets the policy ID for this policy. Policy IDs serve to help developers keep track of multiple policies, and are often used as human readable name for a policy.

Statements
Gets and Sets the collection of statements contained by this policy. Individual statements in a policy are what specify the rules that enable or disable access to your AWS resources.

ToJson()()()()
Returns a JSON string representation of this AWS access control policy, suitable to be sent to an AWS service as part of a request to set an access control policy.

ToJson(Boolean)
Returns a JSON string representation of this AWS access control policy, suitable to be sent to an AWS service as part of a request to set an access control policy.

ToString()()()()
Returns a string that represents the current object.
(Inherited from Object.)
Version
Gets the version of this AWS policy.

WithId(String) Obsolete.
Sets the policy ID for this policy and returns the updated policy so that multiple calls can be chained together.

Policy IDs serve to help developers keep track of multiple policies, and are often used as human readable name for a policy.


WithStatements(array<Statement>[]()[][]) Obsolete.
Sets the collection of statements contained by this policy and returns this policy object so that additional method calls can be chained together.

Individual statements in a policy are what specify the rules that enable or disable access to your AWS resources.


Inheritance Hierarchy
Object
Policy

Assembly: AWSSDK (Module: AWSSDK) Version: 1.5.60.0 (1.5.60.0)