Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_login_profile methode return error #8590

Closed
aladdin-taijan opened this issue Mar 21, 2024 · 1 comment
Closed

create_login_profile methode return error #8590

aladdin-taijan opened this issue Mar 21, 2024 · 1 comment
Labels
needs-triage This issue or PR still needs to be triaged. source-distribution cli v2 source distritbution related issues

Comments

@aladdin-taijan
Copy link

Describe the issue

import boto3
import string
import random
import pprint

aws_session = boto3.session.Session()
iam_client = aws_session.client('iam')

username = input("Enter the username to be created: ")

def random_password(S=10):
password = ''.join(random.choices(string.ascii_letters + string.digits + string.punctuation, k = S))
return str(password) # return the random data

PWD = random_password()

response = iam_client.create_login_profile(
UserName=username,
Password=PWD,
PasswordResetRequired=False
)

pprint(f"Your username is: {username}")
pprint(f"Your password is: {PWD}")

Additional Information/Context

Enter the username to be created: testlogin34

after exe file this error messages appear

Traceback (most recent call last):
File "/home/aladdin/AWS-project/python-handon/IAM_login.py", line 20, in
response = iam_client.create_login_profile(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/botocore/client.py", line 530, in _api_call
return self._make_api_call(operation_name, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/botocore/client.py", line 964, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.NoSuchEntityException: An error occurred (NoSuchEntity) when calling the CreateLoginProfile operation: The user with name testlogin34 cannot be found

CLI version used

aws-cli/2.12.0 Python/3.11.6

Environment details (OS name and version, etc.)

Linux/6.5.0-25-generic source/x86_64.ubuntu.23 prompt/off

@aladdin-taijan aladdin-taijan added needs-triage This issue or PR still needs to be triaged. source-distribution cli v2 source distritbution related issues labels Mar 21, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This issue or PR still needs to be triaged. source-distribution cli v2 source distritbution related issues
Projects
None yet
Development

No branches or pull requests

1 participant