Interface IGrantOnPrincipalAndResourceOptions
Options for a grant operation to both identity and resource.
public interface IGrantOnPrincipalAndResourceOptions : ICommonGrantOptions
- Inherited Members
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" }
};
Remarks
ExampleMetadata: fixture=_generated
Properties
Resource
The resource with a resource policy.
IResourceWithPolicy Resource { get; }
Property Value
Remarks
The statement will always be added to the resource policy.
ResourcePolicyPrincipal
The principal to use in the statement for the resource policy.
IPrincipal? ResourcePolicyPrincipal { get; }
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.
string[]? ResourceSelfArns { get; }
Property Value
- string[]
Remarks
(Depending on the resource type, this needs to be '*' in a resource policy).
Default: Same as regular resource ARNs