PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist



PHP Snippet 1:

 // use Aws\Exception\AwsException;
    
 // use Aws\CognitoIdentityProvider\CognitoIdentityProviderClient;

$awsCognitoClient = new CognitoIdentityProviderClient([
    'version' => 'latest',
    'region' => 'us-east-1',//Change with your region
    'credentials' => [
        'key'    => YOUR_AWS_ACCESS_KEY,
        'secret' => YOUR_AWS_SECRET,
    ],
]);

try {
    $result = $awsCognitoClient->adminInitiateAuth([
        'AuthFlow' => 'ADMIN_NO_SRP_AUTH',
        'ClientId' => YOUR_APP_CLIENT_ID,
        'UserPoolId' => YOUR_USER_POOL_ID,
        'AuthParameters' => [
            'USERNAME' => $userName,
            'PASSWORD' => $password,
        ],
    ]);

    $arr = $result->toArray();
} catch (AwsException $e) {
    $errorArr = $e->toArray();
    $statusCode = $e->getStatusCode();
    $errorMessageCompleteLog = $e->getMessage();
}