AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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".
Note that an AWS access control policy should not be confused with the similarly named "POST form policy" concept used in Amazon S3.
Namespace: Amazon.Auth.AccessControlPolicy
Assembly: AWSSDK.dll
Version: (assembly version)
public class Policy : Object
The Policy type exposes the following members
Name | Description | |
---|---|---|
![]() |
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<Statement>) |
Name | Type | Description | |
---|---|---|---|
![]() |
Id | System.String | 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 | System.Collections.Generic.IList<Amazon.Auth.AccessControlPolicy.Statement> | 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. |
![]() |
Version | System.String | Gets and sets the version of this AWS policy. |
Name | Description | |
---|---|---|
![]() |
CheckIfStatementExists(Statement) | Checks to see if the permissions set in the statement are already set by another statement in the policy. |
![]() ![]() |
FromJson(string) | Parses a JSON document of a policy and creates a Policy object. |
![]() |
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(bool) | 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. |
![]() |
WithId(string) |
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(Statement[]) |
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. |
.NET Framework:
Supported in: 4.5, 4.0, 3.5