interface AddToResourcePolicyResult
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.IAM.AddToResourcePolicyResult |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsiam#AddToResourcePolicyResult |
Java | software.amazon.awscdk.services.iam.AddToResourcePolicyResult |
Python | aws_cdk.aws_iam.AddToResourcePolicyResult |
TypeScript (source) | aws-cdk-lib » aws_iam » AddToResourcePolicyResult |
Obtainable from
Table
.addToResourcePolicy()
, Table
.addToResourcePolicy()
, Repository
.addToResourcePolicy()
, Repository
.addToResourcePolicy()
, File
.addToResourcePolicy()
, Event
.addToResourcePolicy()
, Stream
.addToResourcePolicy()
, Alias
.addToResourcePolicy()
, Key
.addToResourcePolicy()
, Log
.addToResourcePolicy()
, Bucket
.addToResourcePolicy()
, Secret
.addToResourcePolicy()
, Secret
.addToResourcePolicy()
, Topic
.addToResourcePolicy()
, Queue
.addToResourcePolicy()
Result of calling addToResourcePolicy.
Example
const bucket = s3.Bucket.fromBucketName(this, 'existingBucket', 'amzn-s3-demo-bucket');
// No policy statement will be added to the resource
const result = bucket.addToResourcePolicy(
new iam.PolicyStatement({
actions: ['s3:GetObject'],
resources: [bucket.arnForObjects('file.txt')],
principals: [new iam.AccountRootPrincipal()],
})
);
Properties
Name | Type | Description |
---|---|---|
statement | boolean | Whether the statement was added. |
policy | IDependable | Dependable which allows depending on the policy change being applied. |
statementAdded
Type:
boolean
Whether the statement was added.
policyDependable?
Type:
IDependable
(optional, default: If statementAdded
is true, the resource object itself.
Otherwise, no dependable.)
Dependable which allows depending on the policy change being applied.