Class PolicyStatementProps.Builder
java.lang.Object
software.amazon.awscdk.services.iam.PolicyStatementProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<PolicyStatementProps>
- Enclosing interface:
- PolicyStatementProps
@Stability(Stable)
public static final class PolicyStatementProps.Builder
extends Object
implements software.amazon.jsii.Builder<PolicyStatementProps>
A builder for
PolicyStatementProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofPolicyStatementProps.getActions()
build()
Builds the configured instance.conditions
(Map<String, ? extends Object> conditions) Sets the value ofPolicyStatementProps.getConditions()
Sets the value ofPolicyStatementProps.getEffect()
notActions
(List<String> notActions) Sets the value ofPolicyStatementProps.getNotActions()
notPrincipals
(List<? extends IPrincipal> notPrincipals) Sets the value ofPolicyStatementProps.getNotPrincipals()
notResources
(List<String> notResources) Sets the value ofPolicyStatementProps.getNotResources()
principals
(List<? extends IPrincipal> principals) Sets the value ofPolicyStatementProps.getPrincipals()
Sets the value ofPolicyStatementProps.getResources()
Sets the value ofPolicyStatementProps.getSid()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
actions
Sets the value ofPolicyStatementProps.getActions()
- Parameters:
actions
- List of actions to add to the statement.- Returns:
this
-
conditions
@Stability(Stable) public PolicyStatementProps.Builder conditions(Map<String, ? extends Object> conditions) Sets the value ofPolicyStatementProps.getConditions()
- Parameters:
conditions
- Conditions to add to the statement.- Returns:
this
-
effect
Sets the value ofPolicyStatementProps.getEffect()
- Parameters:
effect
- Whether to allow or deny the actions in this statement.- Returns:
this
-
notActions
Sets the value ofPolicyStatementProps.getNotActions()
- Parameters:
notActions
- List of not actions to add to the statement.- Returns:
this
-
notPrincipals
@Stability(Stable) public PolicyStatementProps.Builder notPrincipals(List<? extends IPrincipal> notPrincipals) Sets the value ofPolicyStatementProps.getNotPrincipals()
- Parameters:
notPrincipals
- List of not principals to add to the statement.- Returns:
this
-
notResources
Sets the value ofPolicyStatementProps.getNotResources()
- Parameters:
notResources
- NotResource ARNs to add to the statement.- Returns:
this
-
principals
@Stability(Stable) public PolicyStatementProps.Builder principals(List<? extends IPrincipal> principals) Sets the value ofPolicyStatementProps.getPrincipals()
- Parameters:
principals
- List of principals to add to the statement.- Returns:
this
-
resources
Sets the value ofPolicyStatementProps.getResources()
- Parameters:
resources
- Resource ARNs to add to the statement.- Returns:
this
-
sid
Sets the value ofPolicyStatementProps.getSid()
- Parameters:
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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PolicyStatementProps>
- Returns:
- a new instance of
PolicyStatementProps
- Throws:
NullPointerException
- if any required attribute was not provided
-