Class PolicyStatement.Builder
java.lang.Object
software.amazon.awscdk.services.iam.PolicyStatement.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<PolicyStatement>
- Enclosing class:
- PolicyStatement
@Stability(Stable)
public static final class PolicyStatement.Builder
extends Object
implements software.amazon.jsii.Builder<PolicyStatement>
A fluent builder for
PolicyStatement
.-
Method Summary
Modifier and TypeMethodDescriptionList of actions to add to the statement.build()
conditions
(Map<String, ? extends Object> conditions) Conditions to add to the statement.static PolicyStatement.Builder
create()
Whether to allow or deny the actions in this statement.notActions
(List<String> notActions) List of not actions to add to the statement.notPrincipals
(List<? extends IPrincipal> notPrincipals) List of not principals to add to the statement.notResources
(List<String> notResources) NotResource ARNs to add to the statement.principals
(List<? extends IPrincipal> principals) List of principals to add to the statement.Resource ARNs to add to the statement.The Sid (statement ID) is an optional identifier that you provide for the policy statement.
-
Method Details
-
create
- Returns:
- a new instance of
PolicyStatement.Builder
.
-
actions
List of actions to add to the statement.Default: - no actions
- Parameters:
actions
- List of actions to add to the statement. This parameter is required.- Returns:
this
-
conditions
@Stability(Stable) public PolicyStatement.Builder conditions(Map<String, ? extends Object> conditions) Conditions to add to the statement.Default: - no condition
- Parameters:
conditions
- Conditions to add to the statement. This parameter is required.- Returns:
this
-
effect
Whether to allow or deny the actions in this statement.Default: Effect.ALLOW
- Parameters:
effect
- Whether to allow or deny the actions in this statement. This parameter is required.- Returns:
this
-
notActions
List of not actions to add to the statement.Default: - no not-actions
- Parameters:
notActions
- List of not actions to add to the statement. This parameter is required.- Returns:
this
-
notPrincipals
@Stability(Stable) public PolicyStatement.Builder notPrincipals(List<? extends IPrincipal> notPrincipals) List of not principals to add to the statement.Default: - no not principals
- Parameters:
notPrincipals
- List of not principals to add to the statement. This parameter is required.- Returns:
this
-
notResources
NotResource ARNs to add to the statement.Default: - no not-resources
- Parameters:
notResources
- NotResource ARNs to add to the statement. This parameter is required.- Returns:
this
-
principals
List of principals to add to the statement.Default: - no principals
- Parameters:
principals
- List of principals to add to the statement. This parameter is required.- Returns:
this
-
resources
Resource ARNs to add to the statement.Default: - no resources
- Parameters:
resources
- Resource ARNs to add to the statement. This parameter is required.- Returns:
this
-
sid
The Sid (statement ID) is an optional identifier that you provide for the policy statement.You can assign a Sid value to each statement in a statement array. In services that let you specify an ID element, such as SQS and SNS, the Sid value is just a sub-ID of the policy document's ID. In IAM, the Sid value must be unique within a JSON policy.
Default: - no sid
- Parameters:
sid
- The Sid (statement ID) is an optional identifier that you provide for the policy statement. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PolicyStatement>
- Returns:
- a newly built instance of
PolicyStatement
.
-