Class GrantOnPrincipalAndResourceOptions
Options for a grant operation to both identity and resource.
Inheritance
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.AWS.IAM.dll
Syntax (csharp)
public class GrantOnPrincipalAndResourceOptions : Object, IGrantOnPrincipalAndResourceOptions, ICommonGrantOptions
Syntax (vb)
Public Class GrantOnPrincipalAndResourceOptions
Inherits Object
Implements IGrantOnPrincipalAndResourceOptions, ICommonGrantOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
IGrantable grantable;
IPrincipal principal;
IResourceWithPolicy resourceWithPolicy;
var grantOnPrincipalAndResourceOptions = new GrantOnPrincipalAndResourceOptions {
Actions = new [] { "actions" },
Grantee = grantable,
Resource = resourceWithPolicy,
ResourceArns = new [] { "resourceArns" },
// the properties below are optional
ResourcePolicyPrincipal = principal,
ResourceSelfArns = new [] { "resourceSelfArns" }
};
Synopsis
Constructors
GrantOnPrincipalAndResourceOptions() |
Properties
Actions | The actions to grant. |
Grantee | The principal to grant to. |
Resource | The resource with a resource policy. |
ResourceArns | The resource ARNs to grant to. |
ResourcePolicyPrincipal | The principal to use in the statement for the resource policy. |
ResourceSelfArns | When referring to the resource in a resource policy, use this as ARN. |
Constructors
GrantOnPrincipalAndResourceOptions()
public GrantOnPrincipalAndResourceOptions()
Properties
Actions
The actions to grant.
public string[] Actions { get; set; }
Property Value
System.String[]
Grantee
The principal to grant to.
public IGrantable Grantee { get; set; }
Property Value
Remarks
Default: if principal is undefined, no work is done.
Resource
The resource with a resource policy.
public IResourceWithPolicy Resource { get; set; }
Property Value
Remarks
The statement will always be added to the resource policy.
ResourceArns
The resource ARNs to grant to.
public string[] ResourceArns { get; set; }
Property Value
System.String[]
ResourcePolicyPrincipal
The principal to use in the statement for the resource policy.
public IPrincipal ResourcePolicyPrincipal { get; set; }
Property Value
Remarks
Default: - the principal of the grantee will be used
ResourceSelfArns
When referring to the resource in a resource policy, use this as ARN.
public string[] ResourceSelfArns { get; set; }
Property Value
System.String[]
Remarks
(Depending on the resource type, this needs to be '*' in a resource policy).
Default: Same as regular resource ARNs