Class CfnUser

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:24.678Z") @Stability(Stable) public class CfnUser extends CfnResource implements IInspectable, 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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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)
      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

      @Stability(Stable) public CfnUser(@NotNull software.constructs.Construct scope, @NotNull String id)
      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

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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 class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      Returns the Amazon Resource Name (ARN) for the specified AWS::IAM::User resource.

      For example: arn:aws:iam::123456789012:user/mystack-myuser-1CCXAFG2H2U4D .

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getGroups

      @Stability(Stable) @Nullable public List<String> getGroups()
      A list of group names to which you want to add the user.
    • setGroups

      @Stability(Stable) public void setGroups(@Nullable List<String> value)
      A list of group names to which you want to add the user.
    • getLoginProfile

      @Stability(Stable) @Nullable public Object getLoginProfile()
      Creates a password for the specified IAM user.
    • setLoginProfile

      @Stability(Stable) public void setLoginProfile(@Nullable IResolvable value)
      Creates a password for the specified IAM user.
    • setLoginProfile

      @Stability(Stable) public void setLoginProfile(@Nullable CfnUser.LoginProfileProperty value)
      Creates a password for the specified IAM user.
    • getManagedPolicyArns

      @Stability(Stable) @Nullable public List<String> getManagedPolicyArns()
      A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the user.
    • setManagedPolicyArns

      @Stability(Stable) public void setManagedPolicyArns(@Nullable List<String> value)
      A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the user.
    • getPath

      @Stability(Stable) @Nullable public String getPath()
      The path for the user name.
    • setPath

      @Stability(Stable) public void setPath(@Nullable String value)
      The path for the user name.
    • getPermissionsBoundary

      @Stability(Stable) @Nullable public String getPermissionsBoundary()
      The ARN of the managed policy that is used to set the permissions boundary for the user.
    • setPermissionsBoundary

      @Stability(Stable) public void setPermissionsBoundary(@Nullable String value)
      The ARN of the managed policy that is used to set the permissions boundary for the user.
    • getPolicies

      @Stability(Stable) @Nullable public Object getPolicies()
      Adds or updates an inline policy document that is embedded in the specified IAM user.
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable IResolvable value)
      Adds or updates an inline policy document that is embedded in the specified IAM user.
    • setPolicies

      @Stability(Stable) public void setPolicies(@Nullable List<Object> value)
      Adds or updates an inline policy document that is embedded in the specified IAM user.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      A list of tags that you want to attach to the new user.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      A list of tags that you want to attach to the new user.
    • getUserName

      @Stability(Stable) @Nullable public String getUserName()
      The name of the user to create.

      Do not include the path in this value.

    • setUserName

      @Stability(Stable) public void setUserName(@Nullable String value)
      The name of the user to create.

      Do not include the path in this value.