0

I have this test that I'm trying to check for but it doesn't seem like EnableIAMDatabaseAuthentication is being passed to moto

@mock_rds
def test_iam_database_authentication_enabled(self):
    print(self.client.create_db_instance(
        DBInstanceIdentifier='db-master-1',
        AllocatedStorage=10,
        Engine='postgres',
        DBInstanceClass='db.m1.small',
        EnableIAMDatabaseAuthentication=True,
        MasterUsername='root',
        MasterUserPassword='hunter2',
        Port=1234,
    ))

{'DBInstance': {'DBInstanceIdentifier': 'db-master-1', 'DBInstanceClass': 'db.m1.small', 'Engine': 'postgres', 'DBInstanceStatus': 'available', 'MasterUsername': 'root', 'Endpoint': {'Address': 'db-master-1.aaaaaaaaaa.us-east-2.rds.amazonaws.com', 'Port': 1234}, 'AllocatedStorage': 10, 'InstanceCreateTime': datetime.datetime(2020, 1, 13, 13, 1, 10, 665000, tzinfo=tzutc()), 'PreferredBackupWindow': '03:50-04:20', 'BackupRetentionPeriod': 1, 'DBSecurityGroups': [], 'VpcSecurityGroups': [], 'DBParameterGroups': [{'DBParameterGroupName': 'default.postgres9.3', 'ParameterApplyStatus': 'in-sync'}], 'PreferredMaintenanceWindow': 'wed:06:38-wed:07:08', 'MultiAZ': False, 'EngineVersion': '9.3.3', 'AutoMinorVersionUpgrade': False, 'ReadReplicaDBInstanceIdentifiers': [], 'LicenseModel': 'general-public-license', 'OptionGroupMemberships': [{'OptionGroupName': 'default.postgres9.3', 'Status': 'in-sync'}], 'PubliclyAccessible': False, 'StatusInfos': [], 'StorageType': 'gp2', 'StorageEncrypted': False, 'DbiResourceId': 'db-M5ENSHXFPU6XHZ4G4ZEI5QIO2U', 'CopyTagsToSnapshot': False, 'DBInstanceArn': 'arn:aws:rds:us-east-2:1234567890:db:db-master-1', 'IAMDatabaseAuthenticationEnabled': False}, 'ResponseMetadata': {'RequestId': '523e3218-afc7-11c3-90f5-f90431260ab4', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'amazon.com'}, 'RetryAttempts': 0}}

Am I doing something wrong trying to pass the EnableIAMDatabaseAuthentication param? It should be setting: IAMDatabaseAuthenticationEnabled

Stupid.Fat.Cat
  • 10,755
  • 23
  • 83
  • 144

1 Answers1

0

I can confirm that the moto library itself is not passing the EnableIAMDatabaseAuthentication param from this line of code in moto library.

However, I drew the conclusion from the link above, rather than looking at the return value of the create_db_instance function because I took a look at boto3 rds reference, its response value doesn't return EnableIAMDatabaseAuthentication anyways.

You didn't do anything wrong, that value just doesn't exist in the response from boto3. Even if one day moto does pass in that parameter, it will not show up until boto3. One example of that is the MasterUserPassword param, which moto does pass it, but boto3 doesn't include that in the response.

congbaoguier
  • 985
  • 4
  • 20