Class GrantOnPrincipalAndResourceOptions.Builder
java.lang.Object
software.amazon.awscdk.services.iam.GrantOnPrincipalAndResourceOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<GrantOnPrincipalAndResourceOptions>
- Enclosing interface:
GrantOnPrincipalAndResourceOptions
@Stability(Stable)
public static final class GrantOnPrincipalAndResourceOptions.Builder
extends Object
implements software.amazon.jsii.Builder<GrantOnPrincipalAndResourceOptions>
A builder for
GrantOnPrincipalAndResourceOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofCommonGrantOptions.getActions()
build()
Builds the configured instance.Sets the value ofCommonGrantOptions.getConditions()
grantee
(IGrantable grantee) Sets the value ofCommonGrantOptions.getGrantee()
resource
(IResourceWithPolicy resource) Sets the value ofGrantOnPrincipalAndResourceOptions.getResource()
resourceArns
(List<String> resourceArns) Sets the value ofCommonGrantOptions.getResourceArns()
resourcePolicyPrincipal
(IPrincipal resourcePolicyPrincipal) Sets the value ofGrantOnPrincipalAndResourceOptions.getResourcePolicyPrincipal()
resourceSelfArns
(List<String> resourceSelfArns) Sets the value ofGrantOnPrincipalAndResourceOptions.getResourceSelfArns()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
resource
@Stability(Stable) public GrantOnPrincipalAndResourceOptions.Builder resource(IResourceWithPolicy resource) Sets the value ofGrantOnPrincipalAndResourceOptions.getResource()
- Parameters:
resource
- The resource with a resource policy. This parameter is required. The statement will always be added to the resource policy.- Returns:
this
-
resourcePolicyPrincipal
@Stability(Stable) public GrantOnPrincipalAndResourceOptions.Builder resourcePolicyPrincipal(IPrincipal resourcePolicyPrincipal) Sets the value ofGrantOnPrincipalAndResourceOptions.getResourcePolicyPrincipal()
- Parameters:
resourcePolicyPrincipal
- The principal to use in the statement for the resource policy.- Returns:
this
-
resourceSelfArns
@Stability(Stable) public GrantOnPrincipalAndResourceOptions.Builder resourceSelfArns(List<String> resourceSelfArns) Sets the value ofGrantOnPrincipalAndResourceOptions.getResourceSelfArns()
- Parameters:
resourceSelfArns
- When referring to the resource in a resource policy, use this as ARN. (Depending on the resource type, this needs to be '*' in a resource policy).- Returns:
this
-
actions
Sets the value ofCommonGrantOptions.getActions()
- Parameters:
actions
- The actions to grant. This parameter is required.- Returns:
this
-
grantee
Sets the value ofCommonGrantOptions.getGrantee()
- Parameters:
grantee
- The principal to grant to. This parameter is required.- Returns:
this
-
resourceArns
@Stability(Stable) public GrantOnPrincipalAndResourceOptions.Builder resourceArns(List<String> resourceArns) Sets the value ofCommonGrantOptions.getResourceArns()
- Parameters:
resourceArns
- The resource ARNs to grant to. This parameter is required.- Returns:
this
-
conditions
@Stability(Stable) public GrantOnPrincipalAndResourceOptions.Builder conditions(Map<String, ? extends Map<String, ? extends Object>> conditions) Sets the value ofCommonGrantOptions.getConditions()
- Parameters:
conditions
- Any conditions to attach to the grant.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<GrantOnPrincipalAndResourceOptions>
- Returns:
- a new instance of
GrantOnPrincipalAndResourceOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-