GrantOnPrincipalAndResourceOptions Struct
Options for a grant operation to both identity and resource.
Example
ts
// 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';
declare const conditions: any;
declare const grantable: iam.IGrantable;
declare const principal: iam.IPrincipal;
declare const resourceWithPolicyV2: iam.IResourceWithPolicyV2;
const grantOnPrincipalAndResourceOptions: iam.GrantOnPrincipalAndResourceOptions = {
actions: ['actions'],
grantee: grantable,
resource: resourceWithPolicyV2,
resourceArns: ['resourceArns'],
// the properties below are optional
conditions: {
conditionsKey: {
conditionsKey: conditions,
},
},
resourcePolicyPrincipal: principal,
resourceSelfArns: ['resourceSelfArns'],
};
Properties
The actions to grant.
conditionsoptional{ [key: string]: { [key: string]: any } }conditionsoptionaltyping.Mapping[str, typing.Mapping[str, Any]]conditionsoptionalMap<String, Map<String, Object>>ConditionsoptionalIDictionary<string, IDictionary<string, object>>Conditionsoptional*map[string]*map[string]interface{}#Any conditions to attach to the grant.
Default: No conditions
The principal to grant to.
Default: if principal is undefined, no work is done.
resourceIResourceWithPolicyV2resourceIResourceWithPolicyV2resourceIResourceWithPolicyV2ResourceIResourceWithPolicyV2ResourceIResourceWithPolicyV2required#The resource with a resource policy.
The statement will always be added to the resource policy.
resourceArnsstring[]resource_arnstyping.List[str]resourceArnsList<String>ResourceArnsstring[]ResourceArns*[]*stringrequired#The resource ARNs to grant to.
resourcePolicyPrincipaloptionalIPrincipalresource_policy_principaloptionalIPrincipalresourcePolicyPrincipaloptionalIPrincipalResourcePolicyPrincipaloptionalIPrincipalResourcePolicyPrincipaloptionalIPrincipal#The principal to use in the statement for the resource policy.
Default: the principal of the grantee will be used
resourceSelfArnsoptionalstring[]resource_self_arnsoptionaltyping.List[str]resourceSelfArnsoptionalList<String>ResourceSelfArnsoptionalstring[]ResourceSelfArnsoptional*[]*string#When referring to the resource in a resource policy, use this as ARN.
Default: Same as regular resource ARNs
(Depending on the resource type, this needs to be '*' in a resource policy).