Class GrantWithResourceOptions
Options for a grant operation.
Inheritance
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class GrantWithResourceOptions : Object, IGrantWithResourceOptions, ICommonGrantOptions
Syntax (vb)
Public Class GrantWithResourceOptions
Inherits Object
Implements IGrantWithResourceOptions, 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;
var conditions;
IGrantable grantable;
IResourceWithPolicy resourceWithPolicy;
var grantWithResourceOptions = new GrantWithResourceOptions {
Actions = new [] { "actions" },
Grantee = grantable,
Resource = resourceWithPolicy,
ResourceArns = new [] { "resourceArns" },
// the properties below are optional
Conditions = new Dictionary<string, IDictionary<string, object>> {
{ "conditionsKey", new Dictionary<string, object> {
{ "conditionsKey", conditions }
} }
},
ResourceSelfArns = new [] { "resourceSelfArns" }
};
Synopsis
Constructors
GrantWithResourceOptions() |
Properties
Actions | The actions to grant. |
Conditions | Any conditions to attach to the grant. |
Grantee | The principal to grant to. |
Resource | The resource with a resource policy. |
ResourceArns | The resource ARNs to grant to. |
ResourceSelfArns | When referring to the resource in a resource policy, use this as ARN. |
Constructors
GrantWithResourceOptions()
public GrantWithResourceOptions()
Properties
Actions
The actions to grant.
public string[] Actions { get; set; }
Property Value
System.String[]
Conditions
Any conditions to attach to the grant.
public IDictionary<string, IDictionary<string, object>> Conditions { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IDictionary<System.String, System.Object>>
Remarks
Default: - No conditions
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 be added to the resource policy if it couldn't be added to the principal policy.
ResourceArns
The resource ARNs to grant to.
public string[] ResourceArns { get; set; }
Property Value
System.String[]
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