How to access RDS running hours using boto3

0

Hi Team, I want to extract the running hours of RDS instances from past 6 months. I used the get_cost_and_usage API and filters as follows:

    Filter={
            'And':[{
            'Dimensions':{
                'Key':'SERVICE',
                'Values':['Amazon Relational Database Service']
            }},
            {
                'Dimensions':{
                'Key':'USAGE_TYPE_GROUP',
                'Values':['RDS: Running Hours']
            }
            }               
            ]       
        }

It does brings the RDS cost, but brings no output for 'DimensionValueAttributes': [].

Please assists.

Regards, Nikhil Shah

preguntada hace 2 años465 visualizaciones
1 Respuesta
0
Respuesta aceptada

Hey Guys.. I found the answer... I was missing the Metrics type, I just included 'AmortizedCost' hence it was showing only cost and not the usage. So Added both 'UsageQuantity' & 'AmortizedCost', now get both usage and cost associated with RDS.

Filter={ 'And':[{ 'Dimensions':{ 'Key':'SERVICE', 'Values':['Amazon Relational Database Service'] }}, { 'Dimensions':{ 'Key':'USAGE_TYPE_GROUP', 'Values':['RDS: Running Hours'] } }
]
}

respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas