Skip to content

Commit

Permalink
Consolidate Neptune and RDS backends (#7925)
Browse files Browse the repository at this point in the history
Despite being documented as two distinct services (with two distinct boto3 clients), the Neptune and RDS services share a single AWS backend (RDS). This is reflected in the botocore service definition for Neptune, which lists `rds` as its endpoint. Calling the `DescribeDBClusters` API method with either the `neptune` or `rds` boto3 client results in the exact same list of clusters--no filtering is done on the AWS backend. Neptune clusters are commingled with Aurora clusters.
  • Loading branch information
bpandola authored Aug 2, 2024
1 parent 210a2a3 commit 7cd2763
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 721 deletions.
10 changes: 7 additions & 3 deletions moto/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
from moto.meteringmarketplace.models import MeteringMarketplaceBackend
from moto.moto_api._internal.models import MotoAPIBackend
from moto.mq.models import MQBackend
from moto.neptune.models import NeptuneBackend
from moto.networkmanager.models import NetworkManagerBackend
from moto.opensearch.models import OpenSearchServiceBackend
from moto.opensearchserverless.models import OpenSearchServiceServerlessBackend
Expand Down Expand Up @@ -147,13 +146,18 @@
from moto.xray.models import XRayBackend


ALT_SERVICE_NAMES = {"lambda": "awslambda", "moto_api": "moto_api._internal"}
ALT_SERVICE_NAMES = {
"lambda": "awslambda",
"moto_api": "moto_api._internal",
"neptune": "rds",
}
ALT_BACKEND_NAMES = {
"moto_api._internal": "moto_api",
"awslambda": "lambda",
"awslambda_simple": "lambda_simple",
"dynamodb_v20111205": "dynamodb",
"elasticbeanstalk": "eb",
"neptune": "rds",
}


Expand Down Expand Up @@ -556,7 +560,7 @@ def get_backend(name: "Literal['moto_api']") -> "BackendDict[MotoAPIBackend]": .
@overload
def get_backend(name: "Literal['mq']") -> "BackendDict[MQBackend]": ...
@overload
def get_backend(name: "Literal['neptune']") -> "BackendDict[NeptuneBackend]": ...
def get_backend(name: "Literal['neptune']") -> "BackendDict[RDSBackend]": ...
@overload
def get_backend(
name: "Literal['networkmanager']",
Expand Down
3 changes: 3 additions & 0 deletions moto/neptune/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Neptune service is handled by the RDS service backend located [here](../rds).

Neptune service has a dedicated test suite located [here](../../tests/test_neptune).
9 changes: 0 additions & 9 deletions moto/neptune/__init__.py

This file was deleted.

27 changes: 0 additions & 27 deletions moto/neptune/exceptions.py

This file was deleted.

Loading

0 comments on commit 7cd2763

Please sign in to comment.