Class CfnRole
Creates a new role for your AWS account .
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnRole : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnRole
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
For more information about roles, see IAM roles in the IAM User Guide . For information about quotas for role names and the number of roles you can create, see IAM and AWS STS quotas in the IAM User Guide .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html
CloudformationResource: AWS::IAM::Role
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 assumeRolePolicyDocument;
var policyDocument;
var cfnRole = new CfnRole(this, "MyCfnRole", new CfnRoleProps {
AssumeRolePolicyDocument = assumeRolePolicyDocument,
// the properties below are optional
Description = "description",
ManagedPolicyArns = new [] { "managedPolicyArns" },
MaxSessionDuration = 123,
Path = "path",
PermissionsBoundary = "permissionsBoundary",
Policies = new [] { new PolicyProperty {
PolicyDocument = policyDocument,
PolicyName = "policyName"
} },
RoleName = "roleName",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnRole(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnRole(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnRole(Construct, String, ICfnRoleProps) |
Properties
AssumeRolePolicyDocument | The trust policy that is associated with this role. |
AttrArn | Returns the Amazon Resource Name (ARN) for the role. For example:. |
AttrRoleId | Returns the stable and unique string identifying the role. For example, |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
Description | A description of the role that you provide. |
ManagedPolicyArns | A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. |
MaxSessionDuration | The maximum session duration (in seconds) that you want to set for the specified role. |
Path | The path to the role. |
PermissionsBoundary | The ARN of the policy used to set the permissions boundary for the role. |
Policies | Adds or updates an inline policy document that is embedded in the specified IAM role. |
RoleName | A name for the IAM role, up to 64 characters in length. |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | A list of tags that are attached to the role. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnRole(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnRole(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnRole(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnRole(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnRole(Construct, String, ICfnRoleProps)
public CfnRole(Construct scope, string id, ICfnRoleProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnRoleProps
Resource properties.
Properties
AssumeRolePolicyDocument
The trust policy that is associated with this role.
public virtual object AssumeRolePolicyDocument { get; set; }
Property Value
System.Object
AttrArn
Returns the Amazon Resource Name (ARN) for the role. For example:.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
{"Fn::GetAtt" : ["MyRole", "Arn"] }
This will return a value such as arn:aws:iam::1234567890:role/MyRole-AJJHDSKSDF
.
CloudformationAttribute: Arn
AttrRoleId
Returns the stable and unique string identifying the role. For example, AIDAJQABLZS4A3QDU576Q
.
public virtual string AttrRoleId { get; }
Property Value
System.String
Remarks
For more information about IDs, see IAM Identifiers in the IAM User Guide .
CloudformationAttribute: RoleId
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
Description
A description of the role that you provide.
public virtual string Description { get; set; }
Property Value
System.String
ManagedPolicyArns
A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role.
public virtual string[] ManagedPolicyArns { get; set; }
Property Value
System.String[]
MaxSessionDuration
The maximum session duration (in seconds) that you want to set for the specified role.
public virtual Nullable<double> MaxSessionDuration { get; set; }
Property Value
System.Nullable<System.Double>
Path
The path to the role.
public virtual string Path { get; set; }
Property Value
System.String
Remarks
For more information about paths, see IAM Identifiers in the IAM User Guide .
PermissionsBoundary
The ARN of the policy used to set the permissions boundary for the role.
public virtual string PermissionsBoundary { get; set; }
Property Value
System.String
Policies
Adds or updates an inline policy document that is embedded in the specified IAM role.
public virtual object Policies { get; set; }
Property Value
System.Object
RoleName
A name for the IAM role, up to 64 characters in length.
public virtual string RoleName { get; set; }
Property Value
System.String
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
A list of tags that are attached to the role.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>