RDS - return unknown bools as false, instead of none (#5164)

This commit is contained in:
Bert Blommers 2022-05-25 09:21:03 +00:00 committed by GitHub
parent 63a09da178
commit a2ed7aef4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -497,7 +497,7 @@ class Database(CloudFormationModel):
<BackupRetentionPeriod>{{ database.backup_retention_period }}</BackupRetentionPeriod> <BackupRetentionPeriod>{{ database.backup_retention_period }}</BackupRetentionPeriod>
<DBInstanceStatus>{{ database.status }}</DBInstanceStatus> <DBInstanceStatus>{{ database.status }}</DBInstanceStatus>
{% if database.db_name %}<DBName>{{ database.db_name }}</DBName>{% endif %} {% if database.db_name %}<DBName>{{ database.db_name }}</DBName>{% endif %}
<MultiAZ>{{ database.multi_az }}</MultiAZ> <MultiAZ>{{ 'true' if database.multi_az else 'false' }}</MultiAZ>
<VpcSecurityGroups> <VpcSecurityGroups>
{% for vpc_security_group_id in database.vpc_security_group_ids %} {% for vpc_security_group_id in database.vpc_security_group_ids %}
<VpcSecurityGroupMembership> <VpcSecurityGroupMembership>
@ -536,7 +536,7 @@ class Database(CloudFormationModel):
<ReadReplicaSourceDBInstanceIdentifier>{{ database.source_db_identifier }}</ReadReplicaSourceDBInstanceIdentifier> <ReadReplicaSourceDBInstanceIdentifier>{{ database.source_db_identifier }}</ReadReplicaSourceDBInstanceIdentifier>
{% endif %} {% endif %}
<Engine>{{ database.engine }}</Engine> <Engine>{{ database.engine }}</Engine>
<IAMDatabaseAuthenticationEnabled>{{database.enable_iam_database_authentication|lower }}</IAMDatabaseAuthenticationEnabled> <IAMDatabaseAuthenticationEnabled>{{'true' if database.enable_iam_database_authentication else 'false' }}</IAMDatabaseAuthenticationEnabled>
<LicenseModel>{{ database.license_model }}</LicenseModel> <LicenseModel>{{ database.license_model }}</LicenseModel>
<EngineVersion>{{ database.engine_version }}</EngineVersion> <EngineVersion>{{ database.engine_version }}</EngineVersion>
<OptionGroupMemberships> <OptionGroupMemberships>

View File

@ -25,4 +25,11 @@ def test_create_db_instance():
} }
res = test_client.post("/?Action=CreateDBInstance", data=json.dumps(body)) res = test_client.post("/?Action=CreateDBInstance", data=json.dumps(body))
res.data.decode("utf-8").shouldnt.contain("<DBClusterIdentifier>") response = res.data.decode("utf-8")
response.shouldnt.contain("<DBClusterIdentifier>")
# We do not pass these values - they should default to false
response.should.contain("<MultiAZ>false</MultiAZ>")
response.should.contain(
"<IAMDatabaseAuthenticationEnabled>false</IAMDatabaseAuthenticationEnabled>"
)