'Error Parameter Creating user in AWS Quicksight

I iam trying to create an user with AWS Quicksight with Quicksight API in Lambda:

def registerUser(): nonlocal awsAccountId, email, quickSightIdentity

    logger.info(email)
    
    try:
    
        #Register the user
        quickSightIdentity.register_user(
            IdentityType ='QUICKSIGHT',
            Email = email,
            UserRole ='AUTHOR',
            AwsAccountId = awsAccountId,
            Namespace = 'default'
        )

    except Exception as e:
        raise Exception('Lambda registerUser function:'+str(e))

And i'm getting the following error:

{ "statusCode": 400, "headers": { "Access-Control-Allow-Origin": "*", "Content-Type": "text/plain" }, "body": ""Error: Lambda handler function:Before getDashboardList call: Lambda registerUser function:An error occurred (InvalidParameterValueException) when calling the RegisterUser operation: Invalid resource identifiers provided. Please check the documentation. "" }

What can be wrong in this function? The email and awsAccountId values are ok.

Thank you so much.



Solution 1:[1]

I think you need to add a field for UserName when the IdentityType is QUICKSIGHT.

quickSightIdentity.register_user(
                IdentityType ='QUICKSIGHT',
                Email = email,
                UserRole ='AUTHOR',
                AwsAccountId = awsAccountId,
                Namespace = 'default',
                UserName: username
            )

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 manfred