Class UserProps.Builder
java.lang.Object
software.amazon.awscdk.services.iam.UserProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<UserProps>
- Enclosing interface:
- UserProps
@Stability(Stable)
public static final class UserProps.Builder
extends Object
implements software.amazon.jsii.Builder<UserProps>
A builder for
UserProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofUserProps.getGroups()
managedPolicies
(List<? extends IManagedPolicy> managedPolicies) Sets the value ofUserProps.getManagedPolicies()
password
(SecretValue password) Sets the value ofUserProps.getPassword()
passwordResetRequired
(Boolean passwordResetRequired) Sets the value ofUserProps.getPasswordResetRequired()
Sets the value ofUserProps.getPath()
permissionsBoundary
(IManagedPolicy permissionsBoundary) Sets the value ofUserProps.getPermissionsBoundary()
Sets the value ofUserProps.getUserName()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
groups
Sets the value ofUserProps.getGroups()
- Parameters:
groups
- Groups to add this user to. You can also useaddToGroup
to add this user to a group.- Returns:
this
-
managedPolicies
@Stability(Stable) public UserProps.Builder managedPolicies(List<? extends IManagedPolicy> managedPolicies) Sets the value ofUserProps.getManagedPolicies()
- Parameters:
managedPolicies
- A list of managed policies associated with this role. You can add managed policies later usingaddManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName(policyName))
.- Returns:
this
-
password
Sets the value ofUserProps.getPassword()
- Parameters:
password
- The password for the user. This is required so the user can access the AWS Management Console. You can useSecretValue.unsafePlainText
to specify a password in plain text or usesecretsmanager.Secret.fromSecretAttributes
to reference a secret in Secrets Manager.- Returns:
this
-
passwordResetRequired
Sets the value ofUserProps.getPasswordResetRequired()
- Parameters:
passwordResetRequired
- Specifies whether the user is required to set a new password the next time the user logs in to the AWS Management Console. If this is set to 'true', you must also specify "initialPassword".- Returns:
this
-
path
Sets the value ofUserProps.getPath()
- Parameters:
path
- The path for the user name. For more information about paths, see IAM Identifiers in the IAM User Guide.- Returns:
this
-
permissionsBoundary
Sets the value ofUserProps.getPermissionsBoundary()
- Parameters:
permissionsBoundary
- AWS supports permissions boundaries for IAM entities (users or roles). A permissions boundary is an advanced feature for using a managed policy to set the maximum permissions that an identity-based policy can grant to an IAM entity. An entity's permissions boundary allows it to perform only the actions that are allowed by both its identity-based policies and its permissions boundaries.- Returns:
this
-
userName
Sets the value ofUserProps.getUserName()
- Parameters:
userName
- A name for the IAM user. For valid values, see the UserName parameter for the CreateUser action in the IAM API Reference. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the user name.If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<UserProps>
- Returns:
- a new instance of
UserProps
- Throws:
NullPointerException
- if any required attribute was not provided
-