Class Policy
The AWS::IAM::Policy resource associates an IAM policy with IAM users, roles, or groups.
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.AWS.IAM.dll
Syntax (csharp)
public class Policy : Resource, IPolicy, IResource, IConstruct, IConstruct, IDependable
Syntax (vb)
Public Class Policy
Inherits Resource
Implements IPolicy, IResource, IConstruct, IConstruct, IDependable
Remarks
For more information about IAM policies, see Overview of IAM Policies in the IAM User Guide guide.
Synopsis
Constructors
Policy(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Policy(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Policy(Construct, String, IPolicyProps) |
Properties
Document | The policy document. |
PolicyName | The name of this policy. |
Methods
AddStatements(PolicyStatement[]) | Adds a statement to the policy document. |
AttachToGroup(IGroup) | Attaches this policy to a group. |
AttachToRole(IRole) | Attaches this policy to a role. |
AttachToUser(IUser) | Attaches this policy to a user. |
FromPolicyName(Construct, String, String) | Import a policy in this app based on its name. |
Validate() | Validate the current construct. |
Constructors
Policy(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Policy(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Policy(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Policy(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Policy(Construct, String, IPolicyProps)
public Policy(Construct scope, string id, IPolicyProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IPolicyProps
Properties
Document
PolicyName
The name of this policy.
public virtual string PolicyName { get; }
Property Value
System.String
Remarks
Attribute: true
Methods
AddStatements(PolicyStatement[])
Adds a statement to the policy document.
public virtual void AddStatements(params PolicyStatement[] statement)
Parameters
- statement PolicyStatement[]
AttachToGroup(IGroup)
Attaches this policy to a group.
public virtual void AttachToGroup(IGroup group)
Parameters
- group IGroup
AttachToRole(IRole)
AttachToUser(IUser)
FromPolicyName(Construct, String, String)
Import a policy in this app based on its name.
public static IPolicy FromPolicyName(Construct scope, string id, string policyName)
Parameters
- scope Constructs.Construct
- id System.String
- policyName System.String
Returns
Validate()
Validate the current construct.
protected override string[] Validate()
Returns
System.String[]
Overrides
Remarks
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.