Class CfnUser
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.CfnUser
- All Implemented Interfaces:
IInspectable,IUserRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:37.871Z")
@Stability(Stable)
public class CfnUser
extends CfnResource
implements IInspectable, IUserRef, ITaggable
Creates a new IAM user for your AWS account .
For information about quotas for the number of IAM users 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 policyDocument;
CfnUser cfnUser = CfnUser.Builder.create(this, "MyCfnUser")
.groups(List.of("groups"))
.loginProfile(LoginProfileProperty.builder()
.password("password")
// the properties below are optional
.passwordResetRequired(false)
.build())
.managedPolicyArns(List.of("managedPolicyArns"))
.path("path")
.permissionsBoundary("permissionsBoundary")
.policies(List.of(PolicyProperty.builder()
.policyDocument(policyDocument)
.policyName("policyName")
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.userName("userName")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnUser.static interfaceCreates a password for the specified user, giving the user the ability to access AWS services through the AWS Management Console .static interfaceContains information about an attached policy.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.iam.IUserRef
IUserRef.Jsii$Default, IUserRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnUser(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnUser(software.amazon.jsii.JsiiObjectRef objRef) Create a newAWS::IAM::User.CfnUser(software.constructs.Construct scope, String id, CfnUserProps props) Create a newAWS::IAM::User. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForUser(IUserRef resource) Returns the Amazon Resource Name (ARN) for the specifiedAWS::IAM::Userresource.A list of group names to which you want to add the user.Creates a password for the specified IAM user.A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the user.getPath()The path for the user name.The ARN of the managed policy that is used to set the permissions boundary for the user.Adds or updates an inline policy document that is embedded in the specified IAM user.getTags()Tag Manager which manages the tags for this resource.A list of tags that you want to attach to the new user.The name of the user to create.A reference to a User resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnUser.renderProperties(Map<String, Object> props) voidA list of group names to which you want to add the user.voidsetLoginProfile(IResolvable value) Creates a password for the specified IAM user.voidCreates a password for the specified IAM user.voidsetManagedPolicyArns(List<String> value) A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the user.voidThe path for the user name.voidsetPermissionsBoundary(String value) The ARN of the managed policy that is used to set the permissions boundary for the user.voidsetPolicies(List<Object> value) Adds or updates an inline policy document that is embedded in the specified IAM user.voidsetPolicies(IResolvable value) Adds or updates an inline policy document that is embedded in the specified IAM user.voidsetTagsRaw(List<CfnTag> value) A list of tags that you want to attach to the new user.voidsetUserName(String value) The name of the user to create.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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
-
CfnUser
protected CfnUser(software.amazon.jsii.JsiiObjectRef objRef) -
CfnUser
protected CfnUser(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnUser
@Stability(Stable) public CfnUser(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnUserProps props) Create a newAWS::IAM::User.- 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.
-
CfnUser
Create a newAWS::IAM::User.- 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.
-
-
Method Details
-
arnForUser
- Parameters:
resource- This parameter is required.
-
isCfnUser
Checks whether the given object is a CfnUser.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
Returns the Amazon Resource Name (ARN) for the specifiedAWS::IAM::Userresource.For example:
arn:aws:iam::123456789012:user/mystack-myuser-1CCXAFG2H2U4D. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getUserRef
A reference to a User resource.- Specified by:
getUserRefin interfaceIUserRef
-
getGroups
A list of group names to which you want to add the user. -
setGroups
A list of group names to which you want to add the user. -
getLoginProfile
Creates a password for the specified IAM user.Returns union: either
IResolvableorCfnUser.LoginProfileProperty -
setLoginProfile
Creates a password for the specified IAM user. -
setLoginProfile
Creates a password for the specified IAM user. -
getManagedPolicyArns
A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the user. -
setManagedPolicyArns
A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the user. -
getPath
The path for the user name. -
setPath
The path for the user name. -
getPermissionsBoundary
The ARN of the managed policy that is used to set the permissions boundary for the user. -
setPermissionsBoundary
The ARN of the managed policy that is used to set the permissions boundary for the user. -
getPolicies
Adds or updates an inline policy document that is embedded in the specified IAM user.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnUser.PolicyProperty> -
setPolicies
Adds or updates an inline policy document that is embedded in the specified IAM user. -
setPolicies
Adds or updates an inline policy document that is embedded in the specified IAM user. -
getTagsRaw
A list of tags that you want to attach to the new user. -
setTagsRaw
A list of tags that you want to attach to the new user. -
getUserName
The name of the user to create.Do not include the path in this value.
-
setUserName
The name of the user to create.Do not include the path in this value.
-