boto / boto3

AWS SDK for Python
https://aws.amazon.com/sdk-for-python/
Apache License 2.0
9.07k stars 1.87k forks source link

Neptune describe_db_instances returns RDS instances #1823

Closed CloudSecuritySmith closed 5 years ago

CloudSecuritySmith commented 5 years ago

Using Python 3.7 and boto3 v1.9.71

When using the describe_db_instances with a Neptune client, it returns RDS instances instead of only Neptune instances.

Seems like this is unintentional since the GUI only shows instances related to the service.

Was using the below code to surface usage of the service in our enterprise:

def has_neptune_use(session: boto3.Session) -> bool:
    regions = session.get_available_regions('neptune')
    for r in regions:
        client = session.client('neptune', region_name=r)
        response = client.describe_db_instances()
        try:
            if response['DBInstances']:
                print(response['DBInstances'])
                return True
        except KeyError:
            continue
    return False
JordonPhillips commented 5 years ago

Since this is coming from the service directly there's nothing we can do - I would recommend contacting the service team via their forum or support.