RDS instance engine name versus pricing get-products databaseEngine name

0

Hi! I have a problem with the engine and databaseEngine mismatch.

When you use describe-db-instances you get a value for 'Engine', in the case of aurora mysql it would be

aurora-mysql

However, when you want to use aws pricing get-products --service-code AmazonRDS and you want to filter the engine you need to use

Aurora MySQL

Now this mismatch is annoying but can be fixed easily with a quick mapping for however needs to use it. The real problem is when you look at oracle dbs because there the engine values can be the following:

  • oracle-ee
  • oracle--ee-cdb
  • oracle--se2
  • oracle--se2-cdb
  • custom-oracle-ee

The corresponding databaseEngine name for the pricing for all of them is simply Oracle the difference this time is that you also need to map the correct databaseEdition, in the case of oracle-ee the query now would have to be dataBaseEngine="Oracle" & dataBaseEdition="Enterprise". Ontop of that you can have an Oracle db with databaseEdition Standard & Standard One which is not represented in one of the engine names.

I am not really sure on how how to best solve this and would appreciate the help!

1 Answer
0

Try creating a custom mappings for your values to interface with the CLI output .

# Define a mapping dictionary for engine values
engine_mapping = {
    "aurora-mysql": "Aurora MySQL",
    "oracle-ee": {"databaseEdition": "Enterprise", "databaseEngine": "Oracle"},
    "oracle--ee-cdb": {"databaseEdition": "Enterprise", "databaseEngine": "Oracle"},
    "oracle--se2": {"databaseEdition": "Standard", "databaseEngine": "Oracle"},
    "oracle--se2-cdb": {"databaseEdition": "Standard", "databaseEngine": "Oracle"},
    "custom-oracle-ee": {"databaseEdition": "Enterprise", "databaseEngine": "Oracle"},
    # Add more mappings as needed
}

# Function to retrieve pricing information based on engine
def get_pricing_info(engine):
    if engine in engine_mapping:
        if isinstance(engine_mapping[engine], str):
            return engine_mapping[engine]
        elif isinstance(engine_mapping[engine], dict):
            return engine_mapping[engine]["databaseEngine"], engine_mapping[engine]["databaseEdition"]
    else:
        return None

# Example usage:
engine = "aurora-mysql"
pricing_info = get_pricing_info(engine)
if pricing_info:
    print("Database Engine:", pricing_info)
else:
    print("Pricing information not found for engine:", engine)
profile picture
EXPERT
answered 2 months ago
  • Hi! Thanks so much for your reply however unfortunately this does not solve my problem, the engine names are limited. As I mentioned there can be RDS DBs with the dataBaseEngine 'Oracle' and the edition 'Standard One' OR the edition 'Standard One' , which one of the received engine names would I map to that? none of the 5 oracle related ones map to it perfectly which is why I am a bit confused.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions