Repository: getmoto/moto

Issue:
motoserver return 400 status with golang elbv2.CreateLoadBalancer 
## Reporting Bugs

### environment

version: motoserver/moto1.3.16 standalone mode in docker
language: go:1.15
sdk-version: github.com/aws/aws-sdk-go v1.36.1

code repository: https://github.com/gainings/moto_server_issue_report

### description

I want create loadbalancer use golang.

Run code in docker, then moto_server return 400 without error message.

```
status code: 400, request id:
```

moto_server log
```
moto_1  | 172.29.0.4 - - [04/Dec/2020 03:13:58] "POST / HTTP/1.1" 400 -
```

But check the moto_server by awscli, loadbalancer created.

```bash
$ aws elbv2 --endpoint-url http://localhost:5000 --region ap-northeast-1 describe-load-balancer

{
    "LoadBalancers": [
        {
            "LoadBalancerArn": "arn:aws:elasticloadbalancing:ap-northeast-1:1:loadbalancer/test-lb/50dc6c495c0c9188",
            "DNSName": "test-lb-1.ap-northeast-1.elb.amazonaws.com",
            "CanonicalHostedZoneId": "Z2P70J7EXAMPLE",
            "CreatedTime": "2020-12-04T03:13:58.301200",
            "LoadBalancerName": "test-lb",
            "Scheme": "None",
            "VpcId": "vpc-5db936a3",
            "State": {
                "Code": "provisioning"
            },
            "Type": "application",
            "AvailabilityZones": [
                {
                    "ZoneName": "ap-northeast-1a",
                    "SubnetId": "subnet-aec6a925"
                },
                {
                    "ZoneName": "ap-northeast-1c",
                    "SubnetId": "subnet-3696d4f8"
                }
            ],
            "SecurityGroups": [],
            "IpAddressType": "ipv4"
        }
    ]
}
```

Execute the same code again, code show serializationError

```
2020/12/04 03:17:47 SerializationError: failed decoding Query response
	status code: 200, request id: 8P1USF14J6AKOAQ3AJ0PANRN1RHOX3YZXAPB9PG1SOXPO3O5MH12
caused by: parsing time "2020-12-04 03:13:58.301200" as "2006-01-02T15:04:05.999999999Z": cannot parse " 03:13:58.301200" as "T"
exit status 1
```




Discussion:
Thanks for raising this @gainings.

Looks like the fix would be similar to this PR: https://github.com/spulec/moto/pull/3326

Resolving patch:
diff --git a/moto/elbv2/models.py b/moto/elbv2/models.py
--- a/moto/elbv2/models.py
+++ b/moto/elbv2/models.py
@@ -7,7 +7,11 @@
 from moto.compat import OrderedDict
 from moto.core.exceptions import RESTError
 from moto.core import BaseBackend, BaseModel, CloudFormationModel
-from moto.core.utils import camelcase_to_underscores, underscores_to_camelcase
+from moto.core.utils import (
+    camelcase_to_underscores,
+    underscores_to_camelcase,
+    iso_8601_datetime_with_milliseconds,
+)
 from moto.ec2.models import ec2_backends
 from moto.acm.models import acm_backends
 from .utils import make_arn_for_target_group
@@ -380,7 +384,7 @@ def __init__(
         scheme="internet-facing",
     ):
         self.name = name
-        self.created_time = datetime.datetime.now()
+        self.created_time = iso_8601_datetime_with_milliseconds(datetime.datetime.now())
         self.scheme = scheme
         self.security_groups = security_groups
         self.subnets = subnets or []


Test patch:
diff --git a/tests/test_elbv2/test_elbv2.py b/tests/test_elbv2/test_elbv2.py
--- a/tests/test_elbv2/test_elbv2.py
+++ b/tests/test_elbv2/test_elbv2.py
@@ -51,6 +51,7 @@ def test_create_load_balancer():
             {"SubnetId": subnet2.id, "ZoneName": "us-east-1b"},
         ]
     )
+    lb.get("CreatedTime").tzinfo.should_not.be.none
 
     # Ensure the tags persisted
     response = conn.describe_tags(ResourceArns=[lb.get("LoadBalancerArn")])