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

demandé il y a 2 ans465 vues
1 réponse
0
Réponse acceptée

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'] } }
]
}

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions