@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.756Z") @Stability(value=Stable) public class Grant extends software.amazon.jsii.JsiiObject implements software.constructs.IDependable
This class is not instantiable by consumers on purpose, so that they will be required to call the Grant factory functions.
Example:
// Example automatically generated from non-compiling source. May contain errors. Instance instance; Volume volume; Grant attachGrant = volume.grantAttachVolumeByResourceTag(instance.getGrantPrincipal(), List.of(instance)); Grant detachGrant = volume.grantDetachVolumeByResourceTag(instance.getGrantPrincipal(), List.of(instance));
| Modifier | Constructor and Description |
|---|---|
protected |
Grant(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Grant(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static Grant |
addToPrincipal(GrantOnPrincipalOptions options)
Try to grant the given permissions to the given principal.
|
static Grant |
addToPrincipalAndResource(GrantOnPrincipalAndResourceOptions options)
Add a grant both on the principal and on the resource.
|
static Grant |
addToPrincipalOrResource(GrantWithResourceOptions options)
Grant the given permissions to the principal.
|
void |
applyBefore(software.constructs.IConstruct... constructs)
Make sure this grant is applied before the given constructs are deployed.
|
void |
assertSuccess()
Throw an error if this grant wasn't successful.
|
static Grant |
drop(IGrantable grantee,
String _intent)
Returns a "no-op" `Grant` object which represents a "dropped grant".
|
PolicyStatement |
getPrincipalStatement()
The statement that was added to the principal's policy.
|
PolicyStatement |
getResourceStatement()
The statement that was added to the resource policy.
|
Boolean |
getSuccess()
Whether the grant operation was successful.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Grant(software.amazon.jsii.JsiiObjectRef objRef)
protected Grant(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) @NotNull public static Grant addToPrincipal(@NotNull GrantOnPrincipalOptions options)
Absence of a principal leads to a warning, but failing to add the permissions to a present principal is not an error.
options - This parameter is required.@Stability(value=Stable) @NotNull public static Grant addToPrincipalAndResource(@NotNull GrantOnPrincipalAndResourceOptions options)
As long as any principal is given, granting on the principal may fail (in case of a non-identity principal), but granting on the resource will never fail.
Statement will be the resource statement.
options - This parameter is required.@Stability(value=Stable) @NotNull public static Grant addToPrincipalOrResource(@NotNull GrantWithResourceOptions options)
The permissions will be added to the principal policy primarily, falling back to the resource policy if necessary. The permissions must be granted somewhere.
options - This parameter is required.@Stability(value=Stable) @NotNull public static Grant drop(@NotNull IGrantable grantee, @NotNull String _intent)
This can be used for e.g. imported resources where you may not be able to modify the resource's policy or some underlying policy which you don't know about.
grantee - The intended grantee. This parameter is required._intent - The user's intent (will be ignored at the moment). This parameter is required.@Stability(value=Stable)
public void applyBefore(@NotNull
software.constructs.IConstruct... constructs)
The same as construct.node.addDependency(grant), but slightly nicer to read.
constructs - This parameter is required.@Stability(value=Stable) public void assertSuccess()
@Stability(value=Stable) @NotNull public Boolean getSuccess()
@Stability(value=Stable) @Nullable public PolicyStatement getPrincipalStatement()
Can be accessed to (e.g.) add additional conditions to the statement.
@Stability(value=Stable) @Nullable public PolicyStatement getResourceStatement()
Can be accessed to (e.g.) add additional conditions to the statement.
Copyright © 2022. All rights reserved.