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

feita há 2 anos465 visualizações
1 Resposta
0
Resposta aceita

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 há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas