Class CfnRole
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.iam.CfnRole
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-05T03:43:44.388Z")
@Stability(Stable)
public class CfnRole
extends CfnResource
implements IInspectable, ITaggable
Creates a new role for your AWS account .
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 .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.iam.*; Object assumeRolePolicyDocument; Object policyDocument; CfnRole cfnRole = CfnRole.Builder.create(this, "MyCfnRole") .assumeRolePolicyDocument(assumeRolePolicyDocument) // the properties below are optional .description("description") .managedPolicyArns(List.of("managedPolicyArns")) .maxSessionDuration(123) .path("path") .permissionsBoundary("permissionsBoundary") .policies(List.of(PolicyProperty.builder() .policyDocument(policyDocument) .policyName("policyName") .build())) .roleName("roleName") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnRole
.static interface
Contains information about an attached policy.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnRole
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnRole
(software.amazon.jsii.JsiiObjectRef objRef) CfnRole
(software.constructs.Construct scope, String id, CfnRoleProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe trust policy that is associated with this role.Returns the Amazon Resource Name (ARN) for the role.Returns the stable and unique string identifying the role.A description of the role that you provide.A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role.The maximum session duration (in seconds) that you want to set for the specified role.getPath()
The path to the role.The ARN of the policy used to set the permissions boundary for the role.Adds or updates an inline policy document that is embedded in the specified IAM role.A name for the IAM role, up to 64 characters in length.getTags()
Tag Manager which manages the tags for this resource.A list of tags that are attached to the role.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
The trust policy that is associated with this role.void
setDescription
(String value) A description of the role that you provide.void
setManagedPolicyArns
(List<String> value) A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role.void
setMaxSessionDuration
(Number value) The maximum session duration (in seconds) that you want to set for the specified role.void
The path to the role.void
setPermissionsBoundary
(String value) The ARN of the policy used to set the permissions boundary for the role.void
setPolicies
(List<Object> value) Adds or updates an inline policy document that is embedded in the specified IAM role.void
setPolicies
(IResolvable value) Adds or updates an inline policy document that is embedded in the specified IAM role.void
setRoleName
(String value) A name for the IAM role, up to 64 characters in length.void
setTagsRaw
(List<CfnTag> value) A list of tags that are attached to the role.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnRole
protected CfnRole(software.amazon.jsii.JsiiObjectRef objRef) -
CfnRole
protected CfnRole(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnRole
@Stability(Stable) public CfnRole(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnRoleProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
Returns the Amazon Resource Name (ARN) for the role. For example:.{"Fn::GetAtt" : ["MyRole", "Arn"] }
This will return a value such as
arn:aws:iam::1234567890:role/MyRole-AJJHDSKSDF
. -
getAttrRoleId
Returns the stable and unique string identifying the role. For example,AIDAJQABLZS4A3QDU576Q
.For more information about IDs, see IAM Identifiers in the IAM User Guide .
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getAssumeRolePolicyDocument
The trust policy that is associated with this role. -
setAssumeRolePolicyDocument
The trust policy that is associated with this role. -
getDescription
A description of the role that you provide. -
setDescription
A description of the role that you provide. -
getManagedPolicyArns
A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. -
setManagedPolicyArns
A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. -
getMaxSessionDuration
The maximum session duration (in seconds) that you want to set for the specified role. -
setMaxSessionDuration
The maximum session duration (in seconds) that you want to set for the specified role. -
getPath
The path to the role.For more information about paths, see IAM Identifiers in the IAM User Guide .
-
setPath
The path to the role.For more information about paths, see IAM Identifiers in the IAM User Guide .
-
getPermissionsBoundary
The ARN of the policy used to set the permissions boundary for the role. -
setPermissionsBoundary
The ARN of the policy used to set the permissions boundary for the role. -
getPolicies
Adds or updates an inline policy document that is embedded in the specified IAM role. -
setPolicies
Adds or updates an inline policy document that is embedded in the specified IAM role. -
setPolicies
Adds or updates an inline policy document that is embedded in the specified IAM role. -
getRoleName
A name for the IAM role, up to 64 characters in length. -
setRoleName
A name for the IAM role, up to 64 characters in length. -
getTagsRaw
A list of tags that are attached to the role. -
setTagsRaw
A list of tags that are attached to the role.
-