Interface GrantOnPrincipalAndResourceOptions
- All Superinterfaces:
CommonGrantOptions,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
GrantOnPrincipalAndResourceOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:37.898Z")
@Stability(Stable)
public interface GrantOnPrincipalAndResourceOptions
extends software.amazon.jsii.JsiiSerializable, CommonGrantOptions
Options for a grant operation to both identity and resource.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iam.*;
Object conditions;
IGrantable grantable;
IPrincipal principal;
IResourceWithPolicyV2 resourceWithPolicyV2;
GrantOnPrincipalAndResourceOptions grantOnPrincipalAndResourceOptions = GrantOnPrincipalAndResourceOptions.builder()
.actions(List.of("actions"))
.grantee(grantable)
.resource(resourceWithPolicyV2)
.resourceArns(List.of("resourceArns"))
// the properties below are optional
.conditions(Map.of(
"conditionsKey", Map.of(
"conditionsKey", conditions)))
.resourcePolicyPrincipal(principal)
.resourceSelfArns(List.of("resourceSelfArns"))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forGrantOnPrincipalAndResourceOptionsstatic final classAn implementation forGrantOnPrincipalAndResourceOptions -
Method Summary
Modifier and TypeMethodDescriptionbuilder()The resource with a resource policy.default IPrincipalThe principal to use in the statement for the resource policy.When referring to the resource in a resource policy, use this as ARN.Methods inherited from interface software.amazon.awscdk.services.iam.CommonGrantOptions
getActions, getConditions, getGrantee, getResourceArnsMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getResource
The resource with a resource policy.The statement will always be added to the resource policy.
-
getResourcePolicyPrincipal
The principal to use in the statement for the resource policy.Default: - the principal of the grantee will be used
-
getResourceSelfArns
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).
Default: Same as regular resource ARNs
-
builder
-