aws-cdk-lib.aws_iam.GrantOnPrincipalOptions

interface GrantOnPrincipalOptions

LanguageType name
.NETAmazon.CDK.AWS.IAM.GrantOnPrincipalOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsiam#GrantOnPrincipalOptions
Javasoftware.amazon.awscdk.services.iam.GrantOnPrincipalOptions
Pythonaws_cdk.aws_iam.GrantOnPrincipalOptions
TypeScript (source)aws-cdk-lib » aws_iam » GrantOnPrincipalOptions

Options for a grant operation that only applies to principals.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iam as iam } from 'aws-cdk-lib';
import * as constructs from 'constructs';

declare const conditions: any;
declare const construct: constructs.Construct;
declare const grantable: iam.IGrantable;
const grantOnPrincipalOptions: iam.GrantOnPrincipalOptions = {
  actions: ['actions'],
  grantee: grantable,
  resourceArns: ['resourceArns'],

  // the properties below are optional
  conditions: {
    conditionsKey: {
      conditionsKey: conditions,
    },
  },
  scope: construct,
};

Properties

NameTypeDescription
actionsstring[]The actions to grant.
granteeIGrantableThe principal to grant to.
resourceArnsstring[]The resource ARNs to grant to.
conditions?{ [string]: { [string]: any } }Any conditions to attach to the grant.
scope?IConstructConstruct to report warnings on in case grant could not be registered.

actions

Type: string[]

The actions to grant.


grantee

Type: IGrantable

The principal to grant to.


resourceArns

Type: string[]

The resource ARNs to grant to.


conditions?

Type: { [string]: { [string]: any } } (optional, default: No conditions)

Any conditions to attach to the grant.


scope?

Type: IConstruct (optional, default: the construct in which this construct is defined)

Construct to report warnings on in case grant could not be registered.