Repository: getmoto/moto

Issue:
rds: `AvailabilityZone` is not printed out in `describe_db_instances`
Despite being taken as an argument for `create_db_instance` (and stored in the `Database` model), the `AvailabilityZone` (`DBInstance/AvailabilityZone`) is not printed out in the:
```python
rds.describe_db_instances(DBInstanceIdentifier='arn')
```
call.

Actual response in boto3:
* [create_db_instance](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.create_db_instance)
* [describe_db_instances](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.describe_db_instances)

This is not a problem for `describe_db_clusters`.

The description of this report is sparse, as I would like to submit a PR right away (this boils down to adding one line in `to_xml` of the `Database` model).


Discussion:

Resolving patch:
diff --git a/moto/rds/models.py b/moto/rds/models.py
--- a/moto/rds/models.py
+++ b/moto/rds/models.py
@@ -387,6 +387,8 @@ def __init__(self, **kwargs):
         if self.backup_retention_period is None:
             self.backup_retention_period = 1
         self.availability_zone = kwargs.get("availability_zone")
+        if not self.availability_zone:
+            self.availability_zone = f"{self.region_name}a"
         self.multi_az = kwargs.get("multi_az")
         self.db_subnet_group_name = kwargs.get("db_subnet_group_name")
         if self.db_subnet_group_name:
@@ -495,6 +497,7 @@ def default_db_parameter_group_details(self):
     def to_xml(self):
         template = Template(
             """<DBInstance>
+              <AvailabilityZone>{{ database.availability_zone }}</AvailabilityZone>
               <BackupRetentionPeriod>{{ database.backup_retention_period }}</BackupRetentionPeriod>
               <DBInstanceStatus>{{ database.status }}</DBInstanceStatus>
               {% if database.db_name %}<DBName>{{ database.db_name }}</DBName>{% endif %}


Test patch:
diff --git a/tests/test_rds/test_rds.py b/tests/test_rds/test_rds.py
--- a/tests/test_rds/test_rds.py
+++ b/tests/test_rds/test_rds.py
@@ -2019,3 +2019,39 @@ def test_create_db_instance_with_tags():
 
     resp = client.describe_db_instances(DBInstanceIdentifier=db_instance_identifier)
     resp["DBInstances"][0]["TagList"].should.equal(tags)
+
+
+@mock_rds
+def test_create_db_instance_without_availability_zone():
+    region = "us-east-1"
+    client = boto3.client("rds", region_name=region)
+    db_instance_identifier = "test-db-instance"
+    resp = client.create_db_instance(
+        DBInstanceIdentifier=db_instance_identifier,
+        Engine="postgres",
+        DBName="staging-postgres",
+        DBInstanceClass="db.m1.small",
+    )
+    resp["DBInstance"]["AvailabilityZone"].should.contain(region)
+
+    resp = client.describe_db_instances(DBInstanceIdentifier=db_instance_identifier)
+    resp["DBInstances"][0]["AvailabilityZone"].should.contain(region)
+
+
+@mock_rds
+def test_create_db_instance_with_availability_zone():
+    region = "us-east-1"
+    availability_zone = f"{region}c"
+    client = boto3.client("rds", region_name=region)
+    db_instance_identifier = "test-db-instance"
+    resp = client.create_db_instance(
+        DBInstanceIdentifier=db_instance_identifier,
+        Engine="postgres",
+        DBName="staging-postgres",
+        DBInstanceClass="db.m1.small",
+        AvailabilityZone=availability_zone,
+    )
+    resp["DBInstance"]["AvailabilityZone"].should.equal(availability_zone)
+
+    resp = client.describe_db_instances(DBInstanceIdentifier=db_instance_identifier)
+    resp["DBInstances"][0]["AvailabilityZone"].should.equal(availability_zone)