create_login_profile
¶
create_login_profile(
*,
config_overrides: Optional[IAMClientConfig] = None,
user_name: Optional[userNameType] = None,
password: Optional[passwordType] = None,
password_reset_required: Optional[booleanType] = None,
max_signin_session_duration: Optional[maxSigninSessionDurationType] = None,
) -> CreateLoginProfileResponse
Creates a password for the specified IAM user. A password allows an IAM user to access Amazon Web Services services through the Amazon Web Services Management Console.
You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to create a password for any IAM user. Use ChangePassword to update your own existing password in the My Security Credentials page in the Amazon Web Services Management Console.
For more information about managing passwords, see Managing passwords in the IAM User Guide.
Parameters:
-
user_name(Optional[userNameType], default:None) –The name of the IAM user to create a password for. The user must already exist.
This parameter is optional. If no user name is included, it defaults to the principal making the request. When you make this request with root user credentials, you must use an AssumeRoot session to omit the user name.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
-
password(Optional[passwordType], default:None) –The new password for the user.
This parameter must be omitted when you make the request with an AssumeRoot session. It is required in all other cases.
The regex pattern that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (
\u0020) through the end of the ASCII character range (\u00FF). You can also include the tab (\u0009), line feed (\u000A), and carriage return (\u000D) characters. Any of these characters are valid in a password. However, many tools, such as the Amazon Web Services Management Console, might restrict the ability to type certain characters because they have special meaning within that tool. -
password_reset_required(Optional[booleanType], default:None) –Specifies whether the user is required to set a new password on next sign-in.
-
max_signin_session_duration(Optional[maxSigninSessionDurationType], default:None) –The maximum duration (in seconds) of an Amazon Web Services Sign-In session that uses this login profile, which is the IAM user's user name and password. This setting can have a value from 1 hour (3600 seconds) to 90 days (7776000 seconds), inclusive. If you do not specify a value, the setting remains unset and the existing sign-in session behavior applies.
This setting applies only to sessions created through OAuth-based flows (
signin:CreateOAuth2Token). It does not affect Amazon Web Services Management Console browser sessions or traditional STS sessions.This setting is not supported for the root user.
Raises:
-
EntityAlreadyExistsException–The request was rejected because it attempted to create a resource that already exists.
-
LimitExceededException–The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.
-
NoSuchEntityException–The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
-
PasswordPolicyViolationException–The request was rejected because the provided password did not meet the requirements imposed by the account password policy.
-
ServiceFailureException–The request processing has failed because of an unknown error, exception or failure.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create an instance profile The following command changes IAM user Bob's password and sets the flag that required Bob to change the password the next time he signs in.
>>> client.create_login_profile(user_name='Bob', password='h]6EszR}vJ*m', password_reset_required=True)
Source code in docs_src/capo_iam/_services/iam.py
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 | |