Skip to content

/AWS1/IF_IAM=>CREATELOGINPROFILE()

About CreateLoginProfile

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.

Method Signature

METHODS /AWS1/IF_IAM~CREATELOGINPROFILE
  IMPORTING
    !IV_USERNAME TYPE /AWS1/IAMUSERNAMETYPE OPTIONAL
    !IV_PASSWORD TYPE /AWS1/IAMPASSWORDTYPE OPTIONAL
    !IV_PASSWORDRESETREQUIRED TYPE /AWS1/IAMBOOLEANTYPE OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_iamcreateloginpflrsp
  RAISING
    /AWS1/CX_IAMENTITYALRDYEXEX
    /AWS1/CX_IAMLIMITEXCEEDEDEX
    /AWS1/CX_IAMNOSUCHENTITYEX
    /AWS1/CX_IAMPASSWORDPLYVIOEX
    /AWS1/CX_IAMSERVICEFAILUREEX
    /AWS1/CX_IAMCLIENTEXC
    /AWS1/CX_IAMSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_username TYPE /AWS1/IAMUSERNAMETYPE /AWS1/IAMUSERNAMETYPE

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: _+=,.@-

iv_password TYPE /AWS1/IAMPASSWORDTYPE /AWS1/IAMPASSWORDTYPE

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.

iv_passwordresetrequired TYPE /AWS1/IAMBOOLEANTYPE /AWS1/IAMBOOLEANTYPE

Specifies whether the user is required to set a new password on next sign-in.

RETURNING

oo_output TYPE REF TO /aws1/cl_iamcreateloginpflrsp /AWS1/CL_IAMCREATELOGINPFLRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->createloginprofile(
  iv_password = |string|
  iv_passwordresetrequired = ABAP_TRUE
  iv_username = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_loginprofile = lo_result->get_loginprofile( ).
  IF lo_loginprofile IS NOT INITIAL.
    lv_usernametype = lo_loginprofile->get_username( ).
    lv_datetype = lo_loginprofile->get_createdate( ).
    lv_booleantype = lo_loginprofile->get_passwordresetrequired( ).
  ENDIF.
ENDIF.

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.

DATA(lo_result) = lo_client->createloginprofile(
  iv_password = |h]6EszR}vJ*m|
  iv_passwordresetrequired = ABAP_TRUE
  iv_username = |Bob|
).