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개 답변
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
전문가
답변함 2달 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠