Repository: getmoto/moto

Issue:
IAM: User tags are not applied
## Issue
When creating a user with tags on the IAM endpoint, the tags are not applied. Malformed tags are rejected so tags are clearly being parsed but seemingly not being associated with the user object. This occurs whether the client or resource API is used.

## Reproducing the issue
```python
# setup
import boto3
from moto import mock_iam
import os
os.environ['AWS_ACCESS_KEY_ID'] = 'testing'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'testing'
os.environ['AWS_SECURITY_TOKEN'] = 'testing'
os.environ['AWS_SESSION_TOKEN'] = 'testing'

# defining username and tags
USER_NAME = 'Jane Doe'
USER_TAGS = [
    {
         'Key': 'name',
         'Value': f'{USER_NAME}'
     },
     {
         'Key': 'team',
         'Value': 'systems'
     },
     {
         'Key': 'contact',
         'Value': 'testing@testing'
     },
     {
         'Key': 'category',
         'Value': 'infra'
     },
     {
         'Key': 'environment',
         'Value': 'sandbox'
     }
]

# testing resource mock
from moto import mock_iam
with mock_iam():
     iam = boto3.resource('iam')
     user = iam.create_user(UserName=USER_NAME, Tags=USER_TAGS)
     print(user)

# print results
>>> iam.User(name='Jane Doe')

# testing client mock
with mock_iam():
     iam = boto3.client('iam')
     user = iam.create_user(UserName=USER_NAME, Tags=USER_TAGS)
     print(user)
     iam.list_user_tags(UserName=USER_NAME)

# print results and list user tags
>>>{'User': {'Path': '/', 'UserName': 'Jane Doe', 'UserId': 'frikuih39hf6jvjkroca', 'Arn': 'arn:aws:iam::123456789012:user/Jane Doe', 'CreateDate': datetime.datetime(2020, 11, 9, 19, 27, 34, 676000, tzinfo=tzutc())}, 'ResponseMetadata': {'RequestId': '7a62c49f-347e-4fc4-9331-6e8eEXAMPLE', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'amazon.com'}, 'RetryAttempts': 0}}
>>> _nothing_here_

# Passing a malformed tag
USER_TAGS = [
     {
         'notAKey': 'environment',
         'Value': 'sandbox'
     }
]

with mock_iam():
     iam = boto3.client('iam')
     user = iam.create_user(UserName=USER_NAME, Tags=USER_TAGS)
     print(user)
     iam.list_user_tags(UserName=USER_NAME)

# Malformed tag output
Traceback (most recent call last):
  File "<input>", line 3, in <module>
  File "C:\Users\richardmc\code\aws\aws-iam-mgmt\venv\lib\site-packages\botocore\client.py", line 316, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "C:\Users\richardmc\code\aws\aws-iam-mgmt\venv\lib\site-packages\botocore\client.py", line 598, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "C:\Users\richardmc\code\aws\aws-iam-mgmt\venv\lib\site-packages\botocore\client.py", line 646, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "C:\Users\richardmc\code\aws\aws-iam-mgmt\venv\lib\site-packages\botocore\validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in Tags[0]: "Key"
Unknown parameter in Tags[0]: "notAKey", must be one of: Key, Value
```

## Expected results
Printing the user or querying the associated tags should show the tags associated with the user. 

e.g.
```python
with mock_iam():
     iam = boto3.client('iam')
     user = iam.create_user(UserName=USER_NAME, Tags=USER_TAGS)
     print(user)

>>>{'User': {'Path': '/', 'UserName': 'Jane Doe', 'UserId': 'frikuih39hf6jvjkroca', 'Arn': 'arn:aws:iam::123456789012:user/Jane Doe', 'CreateDate': datetime.datetime(2020, 11, 9, 19, 27, 34, 676000, tzinfo=tzutc())}, 'Tags': [
    {
         'Key': 'name',
         'Value': 'Jane Doe'
     },
     {
         'Key': 'team',
         'Value': 'systems'
     },
     {
         'Key': 'contact',
         'Value': 'testing@testing'
     },
     {
         'Key': 'category',
         'Value': 'infra'
     },
     {
         'Key': 'environment',
         'Value': 'sandbox'
     }
], 'ResponseMetadata': {'RequestId': '7a62c49f-347e-4fc4-9331-6e8eEXAMPLE', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'amazon.com'}, 'RetryAttempts': 0}}
```
## Actual results
No tags are displayed. It appears as though the user objects have never had tags applied. No error is thrown, it simply treats the users as though they have no tags.

## System info
Running moto as mock objects in pytest. No standalone server.
Windows 10
Python 3.8.1
moto 1.3.16
boto3 1.13.1

I was unable to find any related issues. A quick check through the moto model code for IAM suggested that user tags is implemented but I wasn't able to spot an obvious reason why they aren't getting applied. Any assistance would be awesome, thank you 


Discussion:

Resolving patch:
diff --git a/moto/iam/responses.py b/moto/iam/responses.py
--- a/moto/iam/responses.py
+++ b/moto/iam/responses.py
@@ -1684,6 +1684,16 @@ def get_account_summary(self):
          <UserId>{{ user.id }}</UserId>
          <CreateDate>{{ user.created_iso_8601 }}</CreateDate>
          <Arn>{{ user.arn }}</Arn>
+         {% if user.tags %}
+         <Tags>
+            {% for tag in user.tags %}
+            <member>
+                <Key>{{ tag['Key'] }}</Key>
+                <Value>{{ tag['Value'] }}</Value>
+            </member>
+            {% endfor %}
+         </Tags>
+         {% endif %}
      </User>
    </{{ action }}UserResult>
    <ResponseMetadata>


Test patch:
diff --git a/tests/test_iam/test_iam.py b/tests/test_iam/test_iam.py
--- a/tests/test_iam/test_iam.py
+++ b/tests/test_iam/test_iam.py
@@ -4007,3 +4007,20 @@ def test_list_roles_none_found_returns_empty_list():
     response = iam.list_roles(MaxItems=10)
     roles = response["Roles"]
     assert len(roles) == 0
+
+
+@mock_iam()
+def test_create_user_with_tags():
+    conn = boto3.client("iam", region_name="us-east-1")
+    user_name = "test-user"
+    tags = [
+        {"Key": "somekey", "Value": "somevalue"},
+        {"Key": "someotherkey", "Value": "someothervalue"},
+    ]
+    resp = conn.create_user(UserName=user_name, Tags=tags)
+    assert resp["User"]["Tags"] == tags
+    resp = conn.list_user_tags(UserName=user_name)
+    assert resp["Tags"] == tags
+
+    resp = conn.create_user(UserName="test-create-user-no-tags")
+    assert "Tags" not in resp["User"]