Show / Hide Table of Contents

Class Policy

The AWS::IAM::Policy resource associates an IAM policy with IAM users, roles, or groups.

Inheritance
System.Object
Construct
Resource
Policy
Implements
IPolicy
IResource
IConstruct
Constructs.IConstruct
IDependable
Inherited Members
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Node
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

The policy document.

public virtual PolicyDocument Document { get; }
Property Value

PolicyDocument

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)

Attaches this policy to a role.

public virtual void AttachToRole(IRole role)
Parameters
role IRole

AttachToUser(IUser)

Attaches this policy to a user.

public virtual void AttachToUser(IUser user)
Parameters
user 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

IPolicy

Validate()

Validate the current construct.

protected override string[] Validate()
Returns

System.String[]

Overrides
Construct.Validate()
Remarks

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

Implements

IPolicy
IResource
IConstruct
Constructs.IConstruct
IDependable
Back to top Generated by DocFX