@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-13T01:13:32.012Z") public class ResourcePolicy extends Resource
Policies define the operations that are allowed on this resource.
You almost never need to define this construct directly.
All AWS resources that support resource policies have a method called
addToResourcePolicy()
, which will automatically create a new resource
policy if one doesn't exist yet, otherwise it will add to the existing
policy.
Prefer to use addToResourcePolicy()
instead.
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.*; import software.amazon.awscdk.services.logs.*; PolicyStatement policyStatement; ResourcePolicy resourcePolicy = ResourcePolicy.Builder.create(this, "MyResourcePolicy") .policyStatements(List.of(policyStatement)) .resourcePolicyName("resourcePolicyName") .build();
Modifier and Type | Class and Description |
---|---|
static class |
ResourcePolicy.Builder
A fluent builder for
ResourcePolicy . |
IResource.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
ResourcePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ResourcePolicy(software.amazon.jsii.JsiiObjectRef objRef) |
|
ResourcePolicy(software.constructs.Construct scope,
java.lang.String id) |
|
ResourcePolicy(software.constructs.Construct scope,
java.lang.String id,
ResourcePolicyProps props) |
Modifier and Type | Method and Description |
---|---|
PolicyDocument |
getDocument()
The IAM policy document for this resource policy.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNode
protected ResourcePolicy(software.amazon.jsii.JsiiObjectRef objRef)
protected ResourcePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public ResourcePolicy(software.constructs.Construct scope, java.lang.String id, ResourcePolicyProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public ResourcePolicy(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public PolicyDocument getDocument()