title: How to add group for a Cognito user using Python SDK
body: <p>I am trying to add a user to cognito and assign it a group. Adding to group is successful, but I cannot add to which group a user belongs.</p>
  
  <pre><code>import boto3
  
  email = 'test@test.test'
  poolId = 'ap-northeast-1_xxxxxx'
  group = 'xxxx'
  password = 'String1234'
  aws_access_key_id = 'Axxxxxxxx'
  aws_secret_access_key = '6xxxxxxxxx'
  
  session = boto3.Session(aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key)
  client = session.client('cognito-idp')
  
  response = client.admin_create_user(
                  UserPoolId=poolId,
                  Username=email,
                  TemporaryPassword= password,
                  UserAttributes=[
  
                      {
                          "Name": "email",
                          "Value": email
                      },
                      {
                          "Name": "email_verified",
                          "Value": "true"
                      }
                  ]
              )
  
  response = client.admin_add_user_to_group(
                  UserPoolId=poolId,
                  Username=email,
                  GroupName=group
              )
  </code></pre>
  
  <p>The user is added successfully but a group is not added:</p>
  
  <pre><code>Traceback (most recent call last):   File "test.py", line 24, in &lt;module&gt;
  response = client.admin_add_user_to_group
  ( AttributeError: 'CognitoIdentityProvider' object has no attribute 'admin_add_user_to_group'
  </code></pre>
  
  <p>In my requirements.txt for creating virtual enviorment for python I use</p>
  
  <pre><code>boto3==1.4.5
  </code></pre>
  
  <p>Using <a href="http://boto3.readthedocs.io/en/latest/reference/services/cognito-idp.html#CognitoIdentityProvider.Client.admin_add_user_to_group" rel="nofollow noreferrer">this</a> boto3 docs for reference.</p>