How to get host for RDS instance with boto3
Based on the boto3 docs for describe_db_instances
, the response is a dictionary. To access your particular DB instance, access it as follows:
instances = source.describe_db_instances(DBInstanceIdentifier=db_instance)
rds_host = instances.get('DBInstances')[0].get('Endpoint').get('Address')
# or
# rds_host = instances.get('DBInstances')[0]['Endpoint']['Address']