interface AddToResourcePolicyResult
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.IAM.AddToResourcePolicyResult |
Java | software.amazon.awscdk.services.iam.AddToResourcePolicyResult |
Python | aws_cdk.aws_iam.AddToResourcePolicyResult |
TypeScript (source) | @aws-cdk/aws-iam » AddToResourcePolicyResult |
Obtainable from
Repository
.addToResourcePolicy()
, Repository
.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', 'bucket-name');
// 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.