Interface IamStatement
-
- All Superinterfaces:
ToCopyableBuilder<IamStatement.Builder,IamStatement>
- All Known Implementing Classes:
DefaultIamStatement
@ThreadSafe public interface IamStatement extends ToCopyableBuilder<IamStatement.Builder,IamStatement>
A statement is the formal description of a single permission, and is always contained within a policy object.A statement describes a rule for allowing or denying access to a specific AWS resource based on how the resource is being accessed, and who is attempting to access the resource. Statements can also optionally contain a list of conditions that specify when a statement is to be honored.
For example, consider a statement that:
- allows access (the effect)
- for a list of specific AWS account IDs (the principals)
- when accessing an SQS queue (the resource)
- using the SendMessage operation (the action)
- and the request occurs before a specific date (a condition)
Statements takes the form: "A has permission to do B to C where D applies".
- A is the principal - 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.
There are many resources and conditions available for use in statements, and you can combine them to form fine grained custom access control polices.
Statements are typically attached to a
IamPolicy.For more information, see The IAM User guide
Usage Examples
Create an identity-based policy statement that allows a role to write items to an Amazon DynamoDB table.Create a resource-based policy statement that denies access to all users.
- See Also:
IamPolicy, Statement user guide
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIamStatement.Builder
-
Method Summary
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy, toBuilder
-
-
-
-
Method Detail
-
builder
static IamStatement.Builder builder()
Create aIamStatement.Builderfor anIamStatement.
-
sid
String sid()
Retrieve the value set byIamStatement.Builder.sid(String).
-
effect
IamEffect effect()
Retrieve the value set byIamStatement.Builder.effect(IamEffect).
-
principals
List<IamPrincipal> principals()
Retrieve the value set byIamStatement.Builder.principals(Collection).
-
notPrincipals
List<IamPrincipal> notPrincipals()
Retrieve the value set byIamStatement.Builder.notPrincipals(Collection).
-
actions
List<IamAction> actions()
Retrieve the value set byIamStatement.Builder.actions(Collection).
-
notActions
List<IamAction> notActions()
Retrieve the value set byIamStatement.Builder.notActions(Collection).
-
resources
List<IamResource> resources()
Retrieve the value set byIamStatement.Builder.resources(Collection).
-
notResources
List<IamResource> notResources()
Retrieve the value set byIamStatement.Builder.notResources(Collection).
-
conditions
List<IamCondition> conditions()
Retrieve the value set byIamStatement.Builder.conditions(Collection).
-
-