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

1개 답변
0
수락된 답변

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

답변함 2년 전

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

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

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

관련 콘텐츠